Package ai.djl.modality.cv.translator
Class YoloTranslator
- java.lang.Object
-
- ai.djl.modality.cv.translator.BaseImageTranslator<DetectedObjects>
-
- ai.djl.modality.cv.translator.ObjectDetectionTranslator
-
- ai.djl.modality.cv.translator.YoloTranslator
-
- All Implemented Interfaces:
PostProcessor<DetectedObjects>,PreProcessor<Image>,Translator<Image,DetectedObjects>
public class YoloTranslator extends ObjectDetectionTranslator
A translator for yolo models.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classYoloTranslator.BuilderThe builder forYoloTranslator.-
Nested classes/interfaces inherited from class ai.djl.modality.cv.translator.ObjectDetectionTranslator
ObjectDetectionTranslator.ObjectDetectionBuilder<T extends ObjectDetectionTranslator.ObjectDetectionBuilder>
-
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 inherited from class ai.djl.modality.cv.translator.ObjectDetectionTranslator
applyRatio, classes, imageHeight, imageWidth, threshold
-
Fields inherited from class ai.djl.modality.cv.translator.BaseImageTranslator
pipeline
-
-
Constructor Summary
Constructors Constructor Description YoloTranslator(YoloTranslator.Builder builder)Constructs an ImageTranslator with the provided builder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static YoloTranslator.Builderbuilder()Creates a builder to build aYoloTranslator.static YoloTranslator.Builderbuilder(java.util.Map<java.lang.String,?> arguments)Creates a builder to build aYoloTranslatorwith specified arguments.DetectedObjectsprocessOutput(TranslatorContext ctx, NDList list)Processes the output NDList to the corresponding output object.-
Methods inherited from class ai.djl.modality.cv.translator.ObjectDetectionTranslator
prepare
-
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.Translator
getExpansions, toBatchTranslator, toBatchTranslator
-
-
-
-
Constructor Detail
-
YoloTranslator
public YoloTranslator(YoloTranslator.Builder builder)
Constructs an ImageTranslator with the provided builder.- Parameters:
builder- the data to build with
-
-
Method Detail
-
processOutput
public DetectedObjects processOutput(TranslatorContext ctx, NDList list)
Processes the output NDList to the corresponding output object.- Parameters:
ctx- the toolkit used for post-processinglist- the output NDList after inference, usually immutable in engines like PyTorch. @see Issue 1774- Returns:
- the output object of expected type
-
builder
public static YoloTranslator.Builder builder()
Creates a builder to build aYoloTranslator.- Returns:
- a new builder
-
builder
public static YoloTranslator.Builder builder(java.util.Map<java.lang.String,?> arguments)
Creates a builder to build aYoloTranslatorwith specified arguments.- Parameters:
arguments- arguments to specify builder options- Returns:
- a new builder
-
-