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 a
ImageClassificationTranslator
.-
Field Summary
Fields inherited from class ai.djl.modality.cv.translator.BaseImageTranslator.BaseBuilder
batchifier, flag, height, pipeline, width
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
configPostProcess
(Map<String, ?> arguments) Sets the potential classes for an image.optSynsetArtifactName
(String synsetArtifactName) Sets the name of the synset file listing the potential classes for an image.optSynsetUrl
(String synsetUrl) Sets the URL of the synset file.protected void
validate()
Methods inherited from class ai.djl.modality.cv.translator.BaseImageTranslator.BaseBuilder
addTransform, configPreProcess, optBatchifier, optFlag, self, setPipeline
-
Field Details
-
synsetLoader
-
-
Constructor Details
-
ClassificationBuilder
public ClassificationBuilder()
-
-
Method Details
-
optSynsetArtifactName
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
Sets the URL of the synset file.- Parameters:
synsetUrl
- the URL of the synset file- Returns:
- the builder
-
optSynset
Sets the potential classes for an image.- Parameters:
synset
- the potential classes for an image- Returns:
- the builder
-
validate
protected void validate()- Overrides:
validate
in classBaseImageTranslator.BaseBuilder<T extends BaseImageTranslator.BaseBuilder>
-
configPostProcess
- Overrides:
configPostProcess
in classBaseImageTranslator.BaseBuilder<T extends BaseImageTranslator.BaseBuilder>
-