Class DLDetection

java.lang.Object
PamguardMVC.PamDataUnit
rawDeepLearningClassifier.dlClassification.DLDetection
All Implemented Interfaces:
Comparable, PamDetection, AcousticDataUnit, RawDataHolder

public class DLDetection extends PamDataUnit implements PamDetection, RawDataHolder
A detected DL data unit. These data units are only ever generated from raw sound data from the segmenter. Otherwise DL results are saved as annotations on other data units.
Author:
Jamie Macaulay
  • Constructor Details

    • DLDetection

      @Deprecated public DLDetection(long timeMilliseconds, int channelBitmap, long startSample, long durationSamples, ArrayList<PredictionResult> modelResults, double[][] waveData)
      Deprecated.
      Create a data unit for DL which has passed binary classification.
      Parameters:
      timeMilliseconds - - the time in milliseconds.
      channelBitmap - - the channel bit map.
      startSample - - the start sample.
      durationSamples - - the duration in samples.
      modelResults - - the model results that were used to construct the data unit.
    • DLDetection

      public DLDetection(DataUnitBaseData baseData, double[][] waveData)
      Create a data unit for DL which has passed binary classification. Usually used for loading data units from binary files.
      Parameters:
      baseData - - the base binary data.
      waveData - - the wave data.
      probdata - - the probability data.
  • Method Details

    • addDataAnnotation

      public void addDataAnnotation(DataAnnotation dataAnnotation)
      Description copied from class: PamDataUnit
      Adds a data annotation to the data unit. Removes any existing annotation of the same type and name.
      Overrides:
      addDataAnnotation in class PamDataUnit
      Parameters:
      dataAnnotation - data annotation
    • getLocalisation

      public AbstractLocalisation getLocalisation()
      Overrides:
      getLocalisation in class PamDataUnit
      Returns:
      Returns the localisation.
    • getWaveData

      public double[][] getWaveData()
      Description copied from interface: RawDataHolder
      Get arrays of raw audio data, one per channel. Assume that the array matches getChannelMap() !
      Specified by:
      getWaveData in interface RawDataHolder
      Returns:
      arrays of raw data by channel
    • getModelResults

      public ArrayList<PredictionResult> getModelResults()
      Get the model results that were used to construct the data unit. The number of results will generally be the raw data length divided by hop size.
      Returns:
      the model results.
    • getSpectrogram

      public ClipSpectrogram getSpectrogram(int fftSize, int fftHop)
      Get a spectrogram image of the wave clip. The clip is null until called. It is recalculated if the FFT length and/or hop size are different.
      Parameters:
      fftSize - - the FFT size in samples
      fftHop - - the FFT hop in samples
      Returns:
      a spectrogram clip (dB/Hz ).
    • getPowerSpectrum

      public double[][] getPowerSpectrum(int fftLength)
      Get the power spectrum for all channels.
      Parameters:
      fftLength - - the fft length to use.
      Returns:
      the power sepctrums for all channels.
    • getDataTransforms

      public RawDataTransforms getDataTransforms()
      Description copied from interface: RawDataHolder
      Get the raw data transforms class. This handles standard data transforms that are often used in raw data units, e.g. calculating the spectrum, filtering waveforms, getting data as an int16 (short) array, etc.
      Specified by:
      getDataTransforms in interface RawDataHolder
      Returns:
      the data transforms object.