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
- 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.SynsetLoader
synsetLoader
-
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 void
configPostProcess(java.util.Map<java.lang.String,?> arguments)
T
optSynset(java.util.List<java.lang.String> synset)
Sets the potential classes for an image.T
optSynsetArtifactName(java.lang.String synsetArtifactName)
Sets the name of the synset file listing the potential classes for an image.T
optSynsetUrl(java.lang.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 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:
validate
in classBaseImageTranslator.BaseBuilder<T extends BaseImageTranslator.BaseBuilder>
-
configPostProcess
protected void configPostProcess(java.util.Map<java.lang.String,?> arguments)
- Overrides:
configPostProcess
in classBaseImageTranslator.BaseBuilder<T extends BaseImageTranslator.BaseBuilder>
-
-