Package ai.djl.modality.cv.translator
Class InstanceSegmentationTranslator.Builder
java.lang.Object
ai.djl.modality.cv.translator.BaseImageTranslator.BaseBuilder<T>
ai.djl.modality.cv.translator.BaseImageTranslator.ClassificationBuilder<InstanceSegmentationTranslator.Builder>
ai.djl.modality.cv.translator.InstanceSegmentationTranslator.Builder
- Enclosing class:
- InstanceSegmentationTranslator
public static class InstanceSegmentationTranslator.Builder
extends BaseImageTranslator.ClassificationBuilder<InstanceSegmentationTranslator.Builder>
The builder for Instance Segmentation translator.
-
Field Summary
Fields inherited from class ai.djl.modality.cv.translator.BaseImageTranslator.ClassificationBuilder
synsetLoaderFields inherited from class ai.djl.modality.cv.translator.BaseImageTranslator.BaseBuilder
batchifier, flag, height, pipeline, width -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the translator.protected voidconfigPostProcess(Map<String, ?> arguments) optMaxEdge(int maxEdge) Sets the maximum edge length of the rescaled image.optShortEdge(int shortEdge) Sets the shorter edge length of the rescaled image.optThreshold(float threshold) Sets the threshold for prediction accuracy.protected InstanceSegmentationTranslator.Builderself()Methods inherited from class ai.djl.modality.cv.translator.BaseImageTranslator.ClassificationBuilder
optSynset, optSynsetArtifactName, optSynsetUrl, validateMethods inherited from class ai.djl.modality.cv.translator.BaseImageTranslator.BaseBuilder
addTransform, configPreProcess, optBatchifier, optFlag, setPipeline
-
Method Details
-
optThreshold
Sets the threshold for prediction accuracy.Predictions below the threshold will be dropped.
- Parameters:
threshold- the threshold for prediction accuracy- Returns:
- the builder
-
optShortEdge
Sets the shorter edge length of the rescaled image.- Parameters:
shortEdge- the length of the short edge- Returns:
- the builder
-
optMaxEdge
Sets the maximum edge length of the rescaled image.- Parameters:
maxEdge- the length of the longest edge- Returns:
- the builder
-
self
- Specified by:
selfin classBaseImageTranslator.BaseBuilder<InstanceSegmentationTranslator.Builder>
-
configPostProcess
-
build
Builds the translator.- Returns:
- the new translator
-