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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Destroy the model.org.jamdev.jdl4pam.ArchiveModel
getModel()
Get the currently loaded mode.boolean
Check whether a model is null or not.org.jamdev.jdl4pam.ArchiveModel
Load a model from a fileorg.jamdev.jdl4pam.genericmodel.GenericModelParams
makeModelParams
(String jsonString) Create the parameters from a JSON string.makeModelResult
(float[] prob, double time) void
prepModel
(StandardModelParams dlParams, DLControl dlControl) Prepare the model.Methods inherited from class rawDeepLearningClassifier.dlClassification.genericModel.GenericModelWorker
runModel
Methods 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:
prepModel
in classGenericModelWorker
-
loadModel
public org.jamdev.jdl4pam.ArchiveModel loadModel(String currentPath2) throws ai.djl.MalformedModelException, IOException Load a model from a file- Parameters:
currentPath
- - the path to the model.- Throws:
ai.djl.MalformedModelException
IOException
-
makeModelParams
Create the parameters from a JSON string.- Parameters:
jsonString
- - the json string.- Returns:
- the paramters.
-
makeModelResult
- Overrides:
makeModelResult
in classGenericModelWorker
-
closeModel
public void closeModel()Destroy the model.- Overrides:
closeModel
in classGenericModelWorker
-
getModel
public org.jamdev.jdl4pam.ArchiveModel getModel()Get the currently loaded mode.- Overrides:
getModel
in classGenericModelWorker
- Returns:
- - the currently loaded mode.
-
isModelNull
public boolean isModelNull()Description copied from class:DLModelWorker
Check whether a model is null or not.- Overrides:
isModelNull
in classGenericModelWorker
- Returns:
- true of the model is null.
-