Package ai.djl.modality.cv.translator
Class InstanceSegmentationTranslator
java.lang.Object
ai.djl.modality.cv.translator.BaseImageTranslator<DetectedObjects>
ai.djl.modality.cv.translator.InstanceSegmentationTranslator
- All Implemented Interfaces:
PostProcessor<DetectedObjects>,PreProcessor<Image>,Translator<Image,DetectedObjects>
A
BaseImageTranslator that post-process the NDArray into DetectedObjects
with boundaries at the detailed pixel level.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe builder for Instance 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
height, pipeline, width -
Constructor Summary
ConstructorsConstructorDescriptionCreates the Instance Segmentation translator from the given builder. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder to build aInstanceSegmentationTranslator.Creates a builder to build aInstanceSegmentationTranslatorwith specified arguments.voidprepare(TranslatorContext ctx) Prepares the translator with the manager and model to use.processOutput(TranslatorContext ctx, NDList list) Processes the output NDList to the corresponding output object.Methods inherited from class ai.djl.modality.cv.translator.BaseImageTranslator
getBatchifier, processInputMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ai.djl.translate.Translator
batchProcessInput, batchProcessOutput, getExpansions
-
Constructor Details
-
InstanceSegmentationTranslator
Creates the Instance Segmentation translator from the given builder.- Parameters:
builder- the builder for the translator
-
-
Method Details
-
prepare
Prepares the translator with the manager and model to use.- Parameters:
ctx- the context for thePredictor.- Throws:
IOException
-
processOutput
Processes the output NDList to the corresponding output object.- Parameters:
ctx- the toolkit used for post-processinglist- the output NDList after inference, usually immutable in engines like PyTorch. @see Issue 1774- Returns:
- the output object of expected type
-
builder
Creates a builder to build aInstanceSegmentationTranslator.- Returns:
- a new builder
-
builder
Creates a builder to build aInstanceSegmentationTranslatorwith specified arguments.- Parameters:
arguments- arguments to specify builder options- Returns:
- a new builder
-