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.
  • Field Details Link icon

  • Constructor Details Link icon

    • StandardClassifierModel Link icon

      public StandardClassifierModel(DLControl dlControl)
  • Method Details Link icon

    • runModel Link icon

      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 Link icon

      public void prepModel()
      Description copied from interface: DLClassiferModel
      Prepare the model. This is called on PAMGuard start up and before processing in viewer mode.
      Specified by:
      prepModel in interface DLClassiferModel
    • getDLWorker Link icon

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

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

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      public DLStatus setModel(URI uri)
      Description copied from interface: DLClassiferModel
      Set and load the model.
      Specified by:
      setModel in interface DLClassiferModel
      Returns:
      the status of the model e.g. if there has been an error loading
    • isDecision Link icon

      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 Link icon

      public static short[] getClassNameIDs(StandardModelParams standardModelParams)
      Get the class name IDs
      Returns:
      an array of class name IDs
    • closeModel Link icon

      public void closeModel()
      Description copied from interface: DLClassiferModel
      Called whenever PAMGuard stops.
      Specified by:
      closeModel in interface DLClassiferModel
    • newResult Link icon

      protected void newResult(StandardPrediction modelResult, PamDataUnit groupedRawData)
      Send a new result form the thread queue to the process.
      Parameters:
      modelResult - - the model result;
      groupedRawData - - the grouped raw data.
    • millis2Samples Link icon

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

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

      public boolean isModelExtensions(URI uri)
    • checkSettingsOK Link icon

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

      public ArrayList<Class> getAllowedDataTypes()
      Description copied from interface: DLClassiferModel
      Get the allowed data types for the model.The can be null in which case only data units with raw data are allowed.
      Specified by:
      getAllowedDataTypes in interface DLClassiferModel
      Returns:
      a list of the allowed data types.