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 Details

  • Constructor Details

    • ClassificationBuilder

      public ClassificationBuilder()
  • Method Details

    • optSynsetArtifactName

      public T optSynsetArtifactName(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(String synsetUrl)
      Sets the URL of the synset file.
      Parameters:
      synsetUrl - the URL of the synset file
      Returns:
      the builder
    • optSynset

      public T optSynset(List<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 class BaseImageTranslator.BaseBuilder<T extends BaseImageTranslator.BaseBuilder>
    • configPostProcess

      protected void configPostProcess(Map<String,?> arguments)
      Overrides:
      configPostProcess in class BaseImageTranslator.BaseBuilder<T extends BaseImageTranslator.BaseBuilder>