Class ArchiveModelWorker
java.lang.Object
rawDeepLearningClassifier.dlClassification.genericModel.DLModelWorker<StandardPrediction>
rawDeepLearningClassifier.dlClassification.genericModel.GenericModelWorker
rawDeepLearningClassifier.dlClassification.archiveModel.ArchiveModelWorker
- Direct Known Subclasses:
DelphinIDWorker,KetosWorker2,KooguModelWorker
Runs a Ketos deep learning model and performs feature extraction.
- Author:
- Jamie Macaulay
-
Field Summary
Fields inherited from class rawDeepLearningClassifier.dlClassification.genericModel.DLModelWorker
MAX_QUEUE_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDestroy the model.org.jamdev.jdl4pam.ArchiveModelgetModel()Get the currently loaded mode.booleanCheck whether a model is null or not.org.jamdev.jdl4pam.ArchiveModelLoad a model from a fileorg.jamdev.jdl4pam.genericmodel.GenericModelParamsmakeModelParams(String jsonString) Create the parameters from a JSON string.makeModelResult(float[] prob, double time) prepModel(StandardModelParams dlParams, DLControl dlControl) Prepare the model.protected voidsetModel(org.jamdev.jdl4pam.ArchiveModel dlModel) Methods inherited from class rawDeepLearningClassifier.dlClassification.genericModel.GenericModelWorker
runModel, setWaveFreqModelMethods inherited from class rawDeepLearningClassifier.dlClassification.genericModel.DLModelWorker
dataUnits2ModelInput, getModelTransforms, isEnableSoftMax, model2DLTransforms, runModel, setEnableSoftMax, setModelTransforms
-
Constructor Details
-
ArchiveModelWorker
public ArchiveModelWorker()SoundSpotWorker constructor.
-
-
Method Details
-
prepModel
Prepare the model. Note it is important to put a synchonized here or the model loading can fail.- Overrides:
prepModelin classGenericModelWorker
-
loadModel
public org.jamdev.jdl4pam.ArchiveModel loadModel(String currentPath2) throws ai.djl.MalformedModelException, IOException, ai.djl.engine.EngineException Load a model from a file- Parameters:
currentPath- - the path to the model.- Throws:
ai.djl.MalformedModelExceptionIOExceptionai.djl.engine.EngineException
-
makeModelParams
Create the parameters from a JSON string.- Parameters:
jsonString- - the json string.- Returns:
- the paramters.
-
makeModelResult
- Overrides:
makeModelResultin classGenericModelWorker
-
closeModel
public void closeModel()Destroy the model.- Overrides:
closeModelin classGenericModelWorker
-
getModel
public org.jamdev.jdl4pam.ArchiveModel getModel()Get the currently loaded mode.- Overrides:
getModelin classGenericModelWorker- Returns:
- - the currently loaded mode.
-
setModel
protected void setModel(org.jamdev.jdl4pam.ArchiveModel dlModel) -
isModelNull
public boolean isModelNull()Description copied from class:DLModelWorkerCheck whether a model is null or not.- Overrides:
isModelNullin classGenericModelWorker- Returns:
- true of the model is null.
-