mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-25 16:42:27 +00:00
Merge branch 'main' into main
This commit is contained in:
commit
cf4c97a244
@ -10,6 +10,7 @@ import clickTrainDetector.CTDataUnit;
|
|||||||
import clickTrainDetector.CTDetectionGroupDataUnit;
|
import clickTrainDetector.CTDetectionGroupDataUnit;
|
||||||
import clickTrainDetector.ClickTrainControl;
|
import clickTrainDetector.ClickTrainControl;
|
||||||
import clickTrainDetector.ClickTrainDataBlock;
|
import clickTrainDetector.ClickTrainDataBlock;
|
||||||
|
import clickTrainDetector.classification.CTClassification;
|
||||||
import clickTrainDetector.layout.dataselector.CTDataSelectPane;
|
import clickTrainDetector.layout.dataselector.CTDataSelectPane;
|
||||||
import clickTrainDetector.layout.dataselector.CTDataSelectPanel;
|
import clickTrainDetector.layout.dataselector.CTDataSelectPanel;
|
||||||
import pamViewFX.fxSettingsPanes.DynamicSettingsPane;
|
import pamViewFX.fxSettingsPanes.DynamicSettingsPane;
|
||||||
@ -125,10 +126,6 @@ public class CTDataSelector extends DataSelector {
|
|||||||
|
|
||||||
if (ctSelectParams.allowAnyClassification) return true;
|
if (ctSelectParams.allowAnyClassification) return true;
|
||||||
|
|
||||||
if (this.getSelectorName().contains("Dolphin")) {
|
|
||||||
System.out.println("Dolphin classifier looking at " + ctDataUnit);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ctDataUnit instanceof CTDataUnit) {
|
if (ctDataUnit instanceof CTDataUnit) {
|
||||||
|
|
||||||
CTDataUnit clickTrain = (CTDataUnit) ctDataUnit;
|
CTDataUnit clickTrain = (CTDataUnit) ctDataUnit;
|
||||||
@ -137,8 +134,22 @@ public class CTDataSelector extends DataSelector {
|
|||||||
|
|
||||||
int nClass = clickTrain.ctClassifications.size();
|
int nClass = clickTrain.ctClassifications.size();
|
||||||
if (ctSelectParams.allowMultipleChoices == false) {
|
if (ctSelectParams.allowMultipleChoices == false) {
|
||||||
nClass = Math.min(nClass, 1);
|
int clsInd = clickTrain.getClassificationIndex();
|
||||||
|
if (clsInd < 0) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
if (clsInd >= clickTrain.ctClassifications.size()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
CTClassification singleClass = clickTrain.ctClassifications.get(clsInd);
|
||||||
|
for (int i = 0; i < ctSelectParams.classifier.length; i++) {
|
||||||
|
if (ctSelectParams.classifier[i] == singleClass.getSpeciesID()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
//iterate through all the classifiers and allowed classification types.
|
//iterate through all the classifiers and allowed classification types.
|
||||||
for (int i=0; i<ctSelectParams.classifier.length; i++) {
|
for (int i=0; i<ctSelectParams.classifier.length; i++) {
|
||||||
for (int j=0; j<nClass; j++) {
|
for (int j=0; j<nClass; j++) {
|
||||||
@ -148,6 +159,7 @@ public class CTDataSelector extends DataSelector {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user