Package ai.djl.modality.cv.translator
Class ObjectDetectionTranslator.ObjectDetectionBuilder<T extends ObjectDetectionTranslator.ObjectDetectionBuilder>
java.lang.Object
ai.djl.modality.cv.translator.BaseImageTranslator.BaseBuilder<T>
ai.djl.modality.cv.translator.BaseImageTranslator.ClassificationBuilder<T>
ai.djl.modality.cv.translator.ObjectDetectionTranslator.ObjectDetectionBuilder<T>
- Direct Known Subclasses:
SingleShotDetectionTranslator.Builder,YoloTranslator.Builder,YoloV5Translator.Builder
- Enclosing class:
- ObjectDetectionTranslator
public abstract static class ObjectDetectionTranslator.ObjectDetectionBuilder<T extends ObjectDetectionTranslator.ObjectDetectionBuilder>
extends BaseImageTranslator.ClassificationBuilder<T>
The base builder for the object detection translator.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected floatFields 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigPostProcess(Map<String, ?> arguments) optApplyRatio(boolean value) Determine Whether to divide output object width/height on the inference result.optThreshold(float threshold) Sets the threshold for prediction accuracy.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, self, setImageSize, setPipeline
-
Field Details
-
threshold
protected float threshold -
applyRatio
protected boolean applyRatio -
removePadding
protected boolean removePadding
-
-
Constructor Details
-
ObjectDetectionBuilder
public ObjectDetectionBuilder()
-
-
Method Details
-
optThreshold
Sets the threshold for prediction accuracy.Predictions below the threshold will be dropped.
- Parameters:
threshold- the threshold for the prediction accuracy- Returns:
- this builder
-
optApplyRatio
Determine Whether to divide output object width/height on the inference result. Default false.DetectedObject value should always bring a ratio based on the width/height instead of actual width/height. Most of the model will produce ratio as the inference output. This function is aimed to cover those who produce the pixel value. Make this to true to divide the width/height in postprocessing in order to get ratio in detectedObjects.
- Parameters:
value- whether to apply ratio- Returns:
- this builder
-
configPostProcess
- Overrides:
configPostProcessin classBaseImageTranslator.ClassificationBuilder<T extends ObjectDetectionTranslator.ObjectDetectionBuilder>
-