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.
  • Constructor Details

    • StandardClassifierModel

      public StandardClassifierModel(DLControl dlControl)
  • 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 interface DLClassiferModel
      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 interface DLClassiferModel
    • getDLWorker

      public abstract DLModelWorker<? extends PredictionResult> getDLWorker()
      Get the sound spot worker.
      Returns:
      the sound spot worker.
    • getDLParams

      public abstract StandardModelParams getDLParams()
      Get the sound spot worker.
      Returns:
      the sound spot worker.
    • getDLControl

      public DLControl getDLControl()
      Description copied from interface: DLClassiferModel
      Reference to the dlControl
      Specified by:
      getDLControl in interface DLClassiferModel
      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 interface DLClassiferModel
      Returns:
      the number of output classes.
    • getClassNames

      public DLClassName[] getClassNames()
      Description copied from interface: DLClassiferModel
      Get the number of output classes.
      Specified by:
      getClassNames in interface DLClassiferModel
      Returns:
      the number of output classes.
    • getModelStatus

      public DLStatus getModelStatus()
      Description copied from interface: DLClassiferModel
      Check whether a model has been selected and can be loaded successfully.
      Specified by:
      getModelStatus in interface DLClassiferModel
    • setModel

      public DLStatus setModel(URI uri)
      Description copied from interface: DLClassiferModel
      Called whenever PAMGuard stops.
      Specified by:
      setModel in interface DLClassiferModel
      Returns:
    • isDecision

      public boolean isDecision(StandardPrediction modelResult, StandardModelParams modelParmas)
      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

      public static short[] getClassNameIDs(StandardModelParams standardModelParams)
      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 interface DLClassiferModel
    • millis2Samples

      public double millis2Samples(double millis)
      Get the number of samples for microseconds. Based on the sample rate of the parent data block.
    • getRawSettingsPane

      public DLSettingsPane getRawSettingsPane()
      Get raw settings pane
      Returns:
      the setting pane.
    • isModelExtensions

      public boolean isModelExtensions(URI uri)
    • checkSettingsOK

      @Deprecated public static ArrayList<PamWarning> checkSettingsOK(StandardModelParams genericModelParams, DLControl dlControl)
      Deprecated.