public class ObjectDetectionModelLoader extends BaseModelLoader
ModelLoader
for Single Shot Detection (SSD) models.
These models were built as part of the Gluon CV library and imported into DJL.
SSD is a model to solve Application.CV#OBJECT_DETECTION
. Prior models before SSD
typically used non-deep learning strategies to find object proposals and then would execute
classification at those proposed locations. SSD integrated the proposal process into the model
and then classifies at all of those locations in parallel. This both simplifies the model and
training process while better leveraging the power of model DL engines. [paper]
Today, SSD is not typically used in favor of newer models which outperform it.
factories, modelZoo, resource
Constructor and Description |
---|
ObjectDetectionModelLoader(Repository repository,
java.lang.String groupId,
java.lang.String artifactId,
java.lang.String version,
ModelZoo modelZoo)
Creates the Model loader from the given repository.
|
Modifier and Type | Method and Description |
---|---|
ZooModel<Image,DetectedObjects> |
loadModel()
Loads the model.
|
ZooModel<Image,DetectedObjects> |
loadModel(java.util.Map<java.lang.String,java.lang.String> filters,
Device device,
ai.djl.util.Progress progress)
Loads the model with the given search filters.
|
ZooModel<Image,DetectedObjects> |
loadModel(ai.djl.util.Progress progress)
Loads the model.
|
createModel, getApplication, getArtifactId, listModels, loadModel, toString
public ObjectDetectionModelLoader(Repository repository, java.lang.String groupId, java.lang.String artifactId, java.lang.String version, ModelZoo modelZoo)
repository
- the repository to load the model fromgroupId
- the group id of the modelartifactId
- the artifact id of the modelversion
- the version number of the modelmodelZoo
- the modelZoo type that is being used to get supported engine typespublic ZooModel<Image,DetectedObjects> loadModel() throws MalformedModelException, ModelNotFoundException, java.io.IOException
java.io.IOException
- for various exceptions loading data from the repositoryModelNotFoundException
- if no model with the specified criteria is foundMalformedModelException
- if the model data is malformedpublic ZooModel<Image,DetectedObjects> loadModel(ai.djl.util.Progress progress) throws MalformedModelException, ModelNotFoundException, java.io.IOException
progress
- the progress tracker to update while loading the modeljava.io.IOException
- for various exceptions loading data from the repositoryModelNotFoundException
- if no model with the specified criteria is foundMalformedModelException
- if the model data is malformedpublic ZooModel<Image,DetectedObjects> loadModel(java.util.Map<java.lang.String,java.lang.String> filters, Device device, ai.djl.util.Progress progress) throws java.io.IOException, ModelNotFoundException, MalformedModelException
filters
- the search filters to match against the loaded modeldevice
- the device the loaded model should useprogress
- the progress tracker to update while loading the modeljava.io.IOException
- for various exceptions loading data from the repositoryModelNotFoundException
- if no model with the specified criteria is foundMalformedModelException
- if the model data is malformed