Class DeepAcousticsModel
java.lang.Object
org.jamdev.jdl4pam.genericmodel.GenericModel
org.jamdev.jdl4pam.ArchiveModel
rawDeepLearningClassifier.dlClassification.archiveModel.SimpleArchiveModel
rawDeepLearningClassifier.dlClassification.deepAcoustics.DeepAcousticsModel
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic float[][][][]formatDataStack4D(float[][][] transformedDataStack) Format the data stack into a 4D array suitable for the model input.static voidList<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, getModelRelPathMethods inherited from class org.jamdev.jdl4pam.ArchiveModel
getAudioReprFile, loadModelMethods inherited from class org.jamdev.jdl4pam.genericmodel.GenericModel
getInputShape, getModel, getOutShape, getSpecPredictor, getWavePredictor, runModel, runModel, setInputShape, setModel
-
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
-