Package ai.djl.modality.cv.translator
Class YoloV5Translator.Builder
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<YoloV5Translator.Builder>
ai.djl.modality.cv.translator.YoloV5Translator.Builder
- Direct Known Subclasses:
YoloV8Translator.Builder
- Enclosing class:
- YoloV5Translator
public static class YoloV5Translator.Builder
extends ObjectDetectionTranslator.ObjectDetectionBuilder<YoloV5Translator.Builder>
The builder for
YoloV5Translator
.-
Field Summary
Fields inherited from class ai.djl.modality.cv.translator.ObjectDetectionTranslator.ObjectDetectionBuilder
applyRatio, imageHeight, imageWidth, 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
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the translator.protected void
configPostProcess
(Map<String, ?> arguments) optNmsThreshold
(float nmsThreshold) Sets the NMS threshold.optOutputType
(YoloV5Translator.YoloOutputType outputType) Sets theYoloOutputType
.protected YoloV5Translator.Builder
self()
Methods inherited from class ai.djl.modality.cv.translator.ObjectDetectionTranslator.ObjectDetectionBuilder
getImageHeight, getImageWidth, optApplyRatio, optRescaleSize, optThreshold
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, setPipeline
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
optOutputType
Sets theYoloOutputType
.- Parameters:
outputType
- theYoloOutputType
- Returns:
- this builder
-
optNmsThreshold
Sets the NMS threshold.- Parameters:
nmsThreshold
- the NMS threshold- Returns:
- this builder
-
self
- Specified by:
self
in classBaseImageTranslator.BaseBuilder<YoloV5Translator.Builder>
-
configPostProcess
- Overrides:
configPostProcess
in classObjectDetectionTranslator.ObjectDetectionBuilder<YoloV5Translator.Builder>
-
build
Builds the translator.- Returns:
- the new translator
-