Class StandardClassifierModel
java.lang.Object
rawDeepLearningClassifier.dlClassification.StandardClassifierModel
- All Implemented Interfaces:
PamSettings
,SettingsNameProvider
,DLClassiferModel
- Direct Known Subclasses:
ArchiveModelClassifier
,DelphinIDClassifier
,GenericDLClassifier
,KetosClassifier
,SoundSpotClassifier
public abstract class StandardClassifierModel
extends Object
implements DLClassiferModel, PamSettings
A useful abstract class for standard models which are a file or URL that is loaded, have a UI and
utilise PAMSettings to save settings state. These models only accept raw sound data segments.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ArrayList<PamWarning>
checkSettingsOK
(StandardModelParams genericModelParams, DLControl dlControl) Deprecated.void
Called whenever PAMGuard stops.static short[]
getClassNameIDs
(StandardModelParams standardModelParams) Get the class name IDsGet the number of output classes.Reference to the dlControlabstract StandardModelParams
Get the sound spot worker.abstract DLModelWorker<? extends PredictionResult>
Get the sound spot worker.Check whether a model has been selected and can be loaded successfully.int
Get the number of output classes.Get raw settings paneboolean
isDecision
(StandardPrediction modelResult, StandardModelParams modelParmas) Make a decision on whether a result passed a decisionboolean
isModelExtensions
(URI uri) double
millis2Samples
(double millis) Get the number of samples for microseconds.void
Prepare the model.ArrayList<? extends PredictionResult>
runModel
(ArrayList<? extends PamDataUnit> groupedRawData) Run the deep learning model on a list of grouped raw data units and return a corresponding list of model results.Called whenever PAMGuard stops.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface rawDeepLearningClassifier.dlClassification.DLClassiferModel
getDLModelSettings, getModelUI, getName, isModelType
Methods inherited from interface PamController.PamSettings
getSettingsReference, getSettingsVersion, getUnitType, restoreSettings
Methods inherited from interface PamController.SettingsNameProvider
getUnitName
-
Constructor Details
-
StandardClassifierModel
-
-
Method Details
-
runModel
public ArrayList<? extends PredictionResult> runModel(ArrayList<? extends PamDataUnit> groupedRawData) Description copied from interface:DLClassiferModel
Run the deep learning model on a list of grouped raw data units and return a corresponding list of model results.Note the reason we use list is that often it is more efficient to get a model to predict a stacked group of inputs rather than one at a time.
- Specified by:
runModel
in interfaceDLClassiferModel
- Returns:
- the deep learning model.
-
prepModel
public void prepModel()Description copied from interface:DLClassiferModel
Prepare the model. This is called on PAMGuard start up.- Specified by:
prepModel
in interfaceDLClassiferModel
-
getDLWorker
Get the sound spot worker.- Returns:
- the sound spot worker.
-
getDLParams
Get the sound spot worker.- Returns:
- the sound spot worker.
-
getDLControl
Description copied from interface:DLClassiferModel
Reference to the dlControl- Specified by:
getDLControl
in interfaceDLClassiferModel
- Returns:
- reference to the DL control.
-
getNumClasses
public int getNumClasses()Description copied from interface:DLClassiferModel
Get the number of output classes.- Specified by:
getNumClasses
in interfaceDLClassiferModel
- Returns:
- the number of output classes.
-
getClassNames
Description copied from interface:DLClassiferModel
Get the number of output classes.- Specified by:
getClassNames
in interfaceDLClassiferModel
- Returns:
- the number of output classes.
-
getModelStatus
Description copied from interface:DLClassiferModel
Check whether a model has been selected and can be loaded successfully.- Specified by:
getModelStatus
in interfaceDLClassiferModel
-
setModel
Description copied from interface:DLClassiferModel
Called whenever PAMGuard stops.- Specified by:
setModel
in interfaceDLClassiferModel
- Returns:
-
isDecision
Make a decision on whether a result passed a decision- Parameters:
modelResult
- - the model result.modelParmas
- - the model parameters.- Returns:
- true if a threshold has been met.
-
getClassNameIDs
Get the class name IDs- Returns:
- an array of class name IDs
-
closeModel
public void closeModel()Description copied from interface:DLClassiferModel
Called whenever PAMGuard stops.- Specified by:
closeModel
in interfaceDLClassiferModel
-
millis2Samples
public double millis2Samples(double millis) Get the number of samples for microseconds. Based on the sample rate of the parent data block. -
getRawSettingsPane
Get raw settings pane- Returns:
- the setting pane.
-
isModelExtensions
-
checkSettingsOK
@Deprecated public static ArrayList<PamWarning> checkSettingsOK(StandardModelParams genericModelParams, DLControl dlControl) Deprecated.
-