public abstract class ModelZoo
extends java.lang.Object
Constructor and Description |
---|
ModelZoo() |
Modifier and Type | Method and Description |
---|---|
abstract java.lang.String |
getGroupId()
Returns the global unique identifier of the
ModelZoo . |
ModelLoader |
getModelLoader(java.lang.String name)
Returns the
ModelLoader based on the model name. |
abstract java.util.List<ModelLoader> |
getModelLoaders()
Lists the available model families in the ModelZoo.
|
static ModelZoo |
getModelZoo(java.lang.String groupId)
Returns the
ModelZoo with the groupId . |
abstract java.util.Set<java.lang.String> |
getSupportedEngines()
Returns all supported engine names.
|
static boolean |
hasModelZoo(java.lang.String groupId)
Returns whether a model zoo with the group id is available.
|
static java.util.Map<Application,java.util.List<Artifact>> |
listModels()
Returns the available
Application and their model artifact metadata. |
static java.util.Map<Application,java.util.List<Artifact>> |
listModels(Criteria<?,?> criteria)
Returns the available
Application and their model artifact metadata. |
static java.util.Collection<ModelZoo> |
listModelZoo()
Returns available model zoos.
|
static <I,O> ZooModel<I,O> |
loadModel(Criteria<I,O> criteria)
Load the
ZooModel that matches this criteria. |
public abstract java.lang.String getGroupId()
ModelZoo
.
We recommend to use reverse DNS name as your model zoo group ID to make sure it's not conflict with other ModelZoos.
ModelZoo
public abstract java.util.List<ModelLoader> getModelLoaders()
public ModelLoader getModelLoader(java.lang.String name)
ModelLoader
based on the model name.name
- the name of the modelModelLoader
of the modelpublic abstract java.util.Set<java.lang.String> getSupportedEngines()
public static java.util.Collection<ModelZoo> listModelZoo()
public static ModelZoo getModelZoo(java.lang.String groupId)
ModelZoo
with the groupId
.groupId
- the model zoo group id to check forModelZoo
with the groupId
public static boolean hasModelZoo(java.lang.String groupId)
groupId
- the model zoo group id to check forpublic static <I,O> ZooModel<I,O> loadModel(Criteria<I,O> criteria) throws java.io.IOException, ModelNotFoundException, MalformedModelException
ZooModel
that matches this criteria.I
- the input data type for preprocessingO
- the output data type after postprocessingcriteria
- the requirements for 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 static java.util.Map<Application,java.util.List<Artifact>> listModels() throws java.io.IOException, ModelNotFoundException
Application
and their model artifact metadata.Application
and their model artifact metadatajava.io.IOException
- if failed to download to repository metadataModelNotFoundException
- if failed to parse repository metadatapublic static java.util.Map<Application,java.util.List<Artifact>> listModels(Criteria<?,?> criteria) throws java.io.IOException, ModelNotFoundException
Application
and their model artifact metadata.criteria
- the requirements for the modelApplication
and their model artifact metadatajava.io.IOException
- if failed to download to repository metadataModelNotFoundException
- if failed to parse repository metadata