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
Nested ClassesModifier and TypeClassDescriptionstatic classObjectDetectionTranslator.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
FieldsModifier and TypeFieldDescriptionprotected booleanprotected doubleprotected doubleprotected floatFields inherited from class ai.djl.modality.cv.translator.BaseImageTranslator
pipeline -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates theObjectDetectionTranslatorfrom the given builder. -
Method Summary
Modifier and TypeMethodDescriptionvoidprepare(TranslatorContext ctx) Prepares the translator with the manager and model to use.Methods inherited from class ai.djl.modality.cv.translator.BaseImageTranslator
getBatchifier, processInputMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ai.djl.translate.PostProcessor
processOutputMethods inherited from interface ai.djl.translate.Translator
batchProcessInput, batchProcessOutput, getExpansions
-
Field Details
-
threshold
protected float threshold -
classes
-
imageWidth
protected double imageWidth -
imageHeight
protected double imageHeight -
applyRatio
protected boolean applyRatio
-
-
Constructor Details
-
ObjectDetectionTranslator
Creates theObjectDetectionTranslatorfrom 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
-