Package ai.djl.modality.cv.translator
Class ObjectDetectionTranslator
java.lang.Object
ai.djl.modality.cv.translator.BaseImageTranslator<DetectedObjects>
ai.djl.modality.cv.translator.ObjectDetectionTranslator
- All Implemented Interfaces:
PostProcessor<DetectedObjects>
,PreProcessor<Image>
,Translator<Image,
DetectedObjects>
- Direct Known Subclasses:
SingleShotDetectionTranslator
,YoloTranslator
,YoloV5Translator
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
ObjectDetectionTranslator.ObjectDetectionBuilder<T extends ObjectDetectionTranslator.ObjectDetectionBuilder>
The base builder for the object detection 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
Modifier and TypeFieldDescriptionprotected boolean
protected double
protected double
protected float
Fields inherited from class ai.djl.modality.cv.translator.BaseImageTranslator
pipeline
-
Constructor Summary
ModifierConstructorDescriptionprotected
Creates theObjectDetectionTranslator
from the given builder. -
Method Summary
Modifier and TypeMethodDescriptionvoid
prepare
(TranslatorContext ctx) Prepares the translator with the manager and model to use.Methods inherited from class ai.djl.modality.cv.translator.BaseImageTranslator
getBatchifier, processInput
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ai.djl.translate.PostProcessor
processOutput
Methods inherited from interface ai.djl.translate.Translator
getExpansions, toBatchTranslator, toBatchTranslator
-
Field Details
-
threshold
protected float threshold -
classes
-
imageWidth
protected double imageWidth -
imageHeight
protected double imageHeight -
applyRatio
protected boolean applyRatio
-
-
Constructor Details
-
ObjectDetectionTranslator
Creates theObjectDetectionTranslator
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:
Exception
- if there is an error for preparing the translator
-