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
Fields Modifier and Type Field Description protected double
imageHeight
protected double
imageWidth
protected float
threshold
-
Fields inherited from class ai.djl.modality.cv.translator.BaseImageTranslator.ClassificationBuilder
synsetLoader
-
Fields inherited from class ai.djl.modality.cv.translator.BaseImageTranslator.BaseBuilder
batchifier, flag, height, pipeline, width
-
-
Constructor Summary
Constructors Constructor Description ObjectDetectionBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configPostProcess(java.util.Map<java.lang.String,?> arguments)
double
getImageHeight()
Get resized image height.double
getImageWidth()
Get resized image width.T
optRescaleSize(double imageWidth, double imageHeight)
Sets the optional rescale size.T
optThreshold(float threshold)
Sets the threshold for prediction accuracy.-
Methods inherited from class ai.djl.modality.cv.translator.BaseImageTranslator.ClassificationBuilder
optSynset, optSynsetArtifactName, optSynsetUrl, validate
-
Methods inherited from class ai.djl.modality.cv.translator.BaseImageTranslator.BaseBuilder
addTransform, configPreProcess, optBatchifier, optFlag, self, setPipeline
-
-
-
-
Method Detail
-
optThreshold
public T optThreshold(float threshold)
Sets the threshold for prediction accuracy.Predictions below the threshold will be dropped.
- Parameters:
threshold
- the threshold for the prediction accuracy- Returns:
- this builder
-
optRescaleSize
public T optRescaleSize(double imageWidth, double imageHeight)
Sets the optional rescale size.- Parameters:
imageWidth
- the width to rescale images toimageHeight
- the height to rescale images to- Returns:
- this builder
-
getImageWidth
public double getImageWidth()
Get resized image width.- Returns:
- image width
-
getImageHeight
public double getImageHeight()
Get resized image height.- Returns:
- image height
-
configPostProcess
protected void configPostProcess(java.util.Map<java.lang.String,?> arguments)
- Overrides:
configPostProcess
in classBaseImageTranslator.ClassificationBuilder<T extends ObjectDetectionTranslator.ObjectDetectionBuilder>
-
-