java.lang.Object
org.jamdev.jdl4pam.genericmodel.GenericModel
org.jamdev.jdl4pam.ArchiveModel
rawDeepLearningClassifier.dlClassification.archiveModel.SimpleArchiveModel
rawDeepLearningClassifier.dlClassification.deepAcoustics.DeepAcousticsModel

public class DeepAcousticsModel extends SimpleArchiveModel
The DeepAcousticsModel class extends SimpleArchiveModel to provide functionality for running deep acoustics models via a new djl translator and extracting some extra info from the JSON file that is not included in the generalised metadata.
Author:
Jamie Macaulay
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for the DeepAcousticsModel.
  • Method Summary

    Modifier and Type
    Method
    Description
    static float[][][][]
    formatDataStack4D(float[][][] transformedDataStack)
    Format the data stack into a 4D array suitable for the model input.
    static void
    main(String[] args)
     
    List<org.jamdev.jdl4pam.deepAcoustics.DeepAcousticResultArray>
    runModel(float[][][][] specImage)
    Run the model with the given spectrogram image input.

    Methods inherited from class rawDeepLearningClassifier.dlClassification.archiveModel.SimpleArchiveModel

    getAudioReprRelPath, getModelFolderName, getModelRelPath

    Methods inherited from class org.jamdev.jdl4pam.ArchiveModel

    getAudioReprFile, loadModel

    Methods inherited from class org.jamdev.jdl4pam.genericmodel.GenericModel

    getInputShape, getModel, getOutShape, getSpecPredictor, getWavePredictor, runModel, runModel, setInputShape, setModel

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DeepAcousticsModel

      public DeepAcousticsModel(File file) throws ai.djl.MalformedModelException, IOException, ai.djl.engine.EngineException
      Constructor for the DeepAcousticsModel.
      Parameters:
      file - The model file.
      network - The network configuration.
      Throws:
      ai.djl.MalformedModelException - If the model is malformed.
      IOException - If there is an I/O error.
      ai.djl.engine.EngineException - If there is an engine error.
  • Method Details

    • runModel

      public List<org.jamdev.jdl4pam.deepAcoustics.DeepAcousticResultArray> runModel(float[][][][] specImage)
      Run the model with the given spectrogram image input.
      Parameters:
      specImage - The input spectrogram image as a 4D float array.
      Returns:
      The results of the model prediction as a DeepAcousticResultArray.
    • formatDataStack4D

      public static float[][][][] formatDataStack4D(float[][][] transformedDataStack)
      Format the data stack into a 4D array suitable for the model input.
      Parameters:
      transformedDataStack - The input data stack as a 3D float array.
      Returns:
      The formatted data stack as a 4D float array.
    • main

      public static void main(String[] args)