Package ai.djl.modality.cv.translator
Class BaseImageTranslator.ClassificationBuilder<T extends BaseImageTranslator.BaseBuilder>
- java.lang.Object
-
- ai.djl.modality.cv.translator.BaseImageTranslator.BaseBuilder<T>
-
- ai.djl.modality.cv.translator.BaseImageTranslator.ClassificationBuilder<T>
-
- Direct Known Subclasses:
ImageClassificationTranslator.Builder,InstanceSegmentationTranslator.Builder,ObjectDetectionTranslator.ObjectDetectionBuilder,SemanticSegmentationTranslator.Builder
- Enclosing class:
- BaseImageTranslator<T>
public abstract static class BaseImageTranslator.ClassificationBuilder<T extends BaseImageTranslator.BaseBuilder> extends BaseImageTranslator.BaseBuilder<T>
A Builder to construct aImageClassificationTranslator.
-
-
Field Summary
Fields Modifier and Type Field Description protected BaseImageTranslator.SynsetLoadersynsetLoader-
Fields inherited from class ai.djl.modality.cv.translator.BaseImageTranslator.BaseBuilder
batchifier, flag, height, pipeline, width
-
-
Constructor Summary
Constructors Constructor Description ClassificationBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconfigPostProcess(java.util.Map<java.lang.String,?> arguments)ToptSynset(java.util.List<java.lang.String> synset)Sets the potential classes for an image.ToptSynsetArtifactName(java.lang.String synsetArtifactName)Sets the name of the synset file listing the potential classes for an image.ToptSynsetUrl(java.lang.String synsetUrl)Sets the URL of the synset file.protected voidvalidate()-
Methods inherited from class ai.djl.modality.cv.translator.BaseImageTranslator.BaseBuilder
addTransform, configPreProcess, optBatchifier, optFlag, self, setPipeline
-
-
-
-
Field Detail
-
synsetLoader
protected BaseImageTranslator.SynsetLoader synsetLoader
-
-
Method Detail
-
optSynsetArtifactName
public T optSynsetArtifactName(java.lang.String synsetArtifactName)
Sets the name of the synset file listing the potential classes for an image.- Parameters:
synsetArtifactName- a file listing the potential classes for an image- Returns:
- the builder
-
optSynsetUrl
public T optSynsetUrl(java.lang.String synsetUrl)
Sets the URL of the synset file.- Parameters:
synsetUrl- the URL of the synset file- Returns:
- the builder
-
optSynset
public T optSynset(java.util.List<java.lang.String> synset)
Sets the potential classes for an image.- Parameters:
synset- the potential classes for an image- Returns:
- the builder
-
validate
protected void validate()
- Overrides:
validatein classBaseImageTranslator.BaseBuilder<T extends BaseImageTranslator.BaseBuilder>
-
configPostProcess
protected void configPostProcess(java.util.Map<java.lang.String,?> arguments)
- Overrides:
configPostProcessin classBaseImageTranslator.BaseBuilder<T extends BaseImageTranslator.BaseBuilder>
-
-