Package ai.djl.modality.cv.translator
Class SemanticSegmentationTranslator
- java.lang.Object
-
- ai.djl.modality.cv.translator.BaseImageTranslator<Image>
-
- ai.djl.modality.cv.translator.SemanticSegmentationTranslator
-
- All Implemented Interfaces:
PostProcessor<Image>,PreProcessor<Image>,Translator<Image,Image>
public class SemanticSegmentationTranslator extends BaseImageTranslator<Image>
ABaseImageTranslatorthat post-process theNDArrayintoDetectedObjectswith boundaries at the detailed pixel level.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSemanticSegmentationTranslator.BuilderThe builder for Semantic Segmentation translator.-
Nested classes/interfaces inherited from class ai.djl.modality.cv.translator.BaseImageTranslator
BaseImageTranslator.BaseBuilder<T extends BaseImageTranslator.BaseBuilder>, BaseImageTranslator.ClassificationBuilder<T extends BaseImageTranslator.BaseBuilder>, BaseImageTranslator.SynsetLoader
-
-
Field Summary
-
Fields inherited from class ai.djl.modality.cv.translator.BaseImageTranslator
pipeline
-
-
Constructor Summary
Constructors Constructor Description SemanticSegmentationTranslator(SemanticSegmentationTranslator.Builder builder)Creates the Semantic Segmentation translator from the given builder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SemanticSegmentationTranslator.Builderbuilder()Creates a builder to build aSemanticSegmentationTranslator.static SemanticSegmentationTranslator.Builderbuilder(java.util.Map<java.lang.String,?> arguments)Creates a builder to build aSemanticSegmentationTranslatorwith specified arguments.NDListprocessInput(TranslatorContext ctx, Image image)Processes the input and converts it to NDList.ImageprocessOutput(TranslatorContext ctx, NDList list)Processes the output NDList to the corresponding output object.-
Methods inherited from class ai.djl.modality.cv.translator.BaseImageTranslator
getBatchifier
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ai.djl.translate.Translator
prepare
-
-
-
-
Constructor Detail
-
SemanticSegmentationTranslator
public SemanticSegmentationTranslator(SemanticSegmentationTranslator.Builder builder)
Creates the Semantic Segmentation translator from the given builder.- Parameters:
builder- the builder for the translator
-
-
Method Detail
-
processInput
public NDList processInput(TranslatorContext ctx, Image image)
Processes the input and converts it to NDList.- Specified by:
processInputin interfacePreProcessor<Image>- Overrides:
processInputin classBaseImageTranslator<Image>- Parameters:
ctx- the toolkit for creating the input NDArrayimage- the input object- Returns:
- the
NDListafter pre-processing
-
processOutput
public Image processOutput(TranslatorContext ctx, NDList list)
Processes the output NDList to the corresponding output object.- Parameters:
ctx- the toolkit used for post-processinglist- the output NDList after inference- Returns:
- the output object of expected type
-
builder
public static SemanticSegmentationTranslator.Builder builder()
Creates a builder to build aSemanticSegmentationTranslator.- Returns:
- a new builder
-
builder
public static SemanticSegmentationTranslator.Builder builder(java.util.Map<java.lang.String,?> arguments)
Creates a builder to build aSemanticSegmentationTranslatorwith specified arguments.- Parameters:
arguments- arguments to specify builder options- Returns:
- a new builder
-
-