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
public abstract class ObjectDetectionTranslator extends BaseImageTranslator<DetectedObjects>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static 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
Fields Modifier and Type Field Description protected java.util.List<java.lang.String>
classes
protected double
imageHeight
protected double
imageWidth
protected float
threshold
-
Fields inherited from class ai.djl.modality.cv.translator.BaseImageTranslator
pipeline
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ObjectDetectionTranslator(ObjectDetectionTranslator.ObjectDetectionBuilder<?> builder)
Creates theObjectDetectionTranslator
from the given builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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
-
-
-
-
Constructor Detail
-
ObjectDetectionTranslator
protected ObjectDetectionTranslator(ObjectDetectionTranslator.ObjectDetectionBuilder<?> builder)
Creates theObjectDetectionTranslator
from the given builder.- Parameters:
builder
- the builder for the translator
-
-
Method Detail
-
prepare
public void prepare(TranslatorContext ctx) throws java.lang.Exception
Prepares the translator with the manager and model to use.- Parameters:
ctx
- the context for thePredictor
.- Throws:
java.lang.Exception
- if there is an error for preparing the translator
-
-