public class InstanceSegmentationTranslator extends BaseImageTranslator<DetectedObjects> implements Transform
BaseImageTranslator
that post-process the NDArray
into DetectedObjects
with boundaries at the detailed pixel level.Modifier and Type | Class and Description |
---|---|
static class |
InstanceSegmentationTranslator.Builder
The builder for Instance Segmentation translator.
|
BaseImageTranslator.BaseBuilder<T extends BaseImageTranslator.BaseBuilder>, BaseImageTranslator.ClassificationBuilder<T extends BaseImageTranslator.BaseBuilder>, BaseImageTranslator.SynsetLoader
Constructor and Description |
---|
InstanceSegmentationTranslator(InstanceSegmentationTranslator.Builder builder)
Creates the Instance Segmentation translator from the given builder.
|
Modifier and Type | Method and Description |
---|---|
static InstanceSegmentationTranslator.Builder |
builder()
Creates a builder to build a
InstanceSegmentationTranslator . |
static InstanceSegmentationTranslator.Builder |
builder(java.util.Map<java.lang.String,?> arguments)
Creates a builder to build a
InstanceSegmentationTranslator with specified arguments. |
void |
prepare(NDManager manager,
Model model)
Prepares the translator with the manager and model to use.
|
NDList |
processInput(TranslatorContext ctx,
Image image)
Processes the
Image input and converts it to NDList. |
DetectedObjects |
processOutput(TranslatorContext ctx,
NDList list)
Processes the output NDList to the corresponding output object.
|
NDArray |
transform(NDArray array)
Applies the
Transform to the given NDArray . |
getBatchifier, getBooleanValue, getFloatValue, getIntValue, getPipeline, getStringValue
public InstanceSegmentationTranslator(InstanceSegmentationTranslator.Builder builder)
builder
- the builder for the translatorpublic void prepare(NDManager manager, Model model) throws java.io.IOException
prepare
in interface Translator<Image,DetectedObjects>
manager
- the manager for the translatormodel
- the model to translate forjava.io.IOException
- if there is an error reading inputs for preparing the translatorpublic NDList processInput(TranslatorContext ctx, Image image)
Image
input and converts it to NDList.processInput
in interface PreProcessor<Image>
processInput
in class BaseImageTranslator<DetectedObjects>
ctx
- the toolkit that helps create the input NDArrayimage
- the Image
inputNDList
public DetectedObjects processOutput(TranslatorContext ctx, NDList list)
processOutput
in interface PostProcessor<DetectedObjects>
ctx
- the toolkit used for post-processinglist
- the output NDList after inferencepublic static InstanceSegmentationTranslator.Builder builder()
InstanceSegmentationTranslator
.public static InstanceSegmentationTranslator.Builder builder(java.util.Map<java.lang.String,?> arguments)
InstanceSegmentationTranslator
with specified arguments.arguments
- arguments to specify builder options