Package ai.djl.huggingface.translator
Class ZeroShotObjectDetectionTranslator.Builder
java.lang.Object
ai.djl.modality.cv.translator.BaseImageTranslator.BaseBuilder<ZeroShotObjectDetectionTranslator.Builder>
ai.djl.huggingface.translator.ZeroShotObjectDetectionTranslator.Builder
- Enclosing class:
- ZeroShotObjectDetectionTranslator
public static final class ZeroShotObjectDetectionTranslator.Builder
extends ai.djl.modality.cv.translator.BaseImageTranslator.BaseBuilder<ZeroShotObjectDetectionTranslator.Builder>
The builder for zero-shot classification translator.
-
Field Summary
Fields inherited from class ai.djl.modality.cv.translator.BaseImageTranslator.BaseBuilder
batchifier, flag, height, pipeline, width -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the translator.voidConfigures the builder with the model arguments.optInt32(boolean int32) Sets if use int32 datatype for theTranslator.optThreshold(float threshold) Sets the threshold for prediction accuracy.self()Methods inherited from class ai.djl.modality.cv.translator.BaseImageTranslator.BaseBuilder
addTransform, configPostProcess, configPreProcess, optBatchifier, optFlag, setImageSize, setPipeline, validate
-
Method Details
-
self
- Specified by:
selfin classai.djl.modality.cv.translator.BaseImageTranslator.BaseBuilder<ZeroShotObjectDetectionTranslator.Builder>
-
optThreshold
Sets the threshold for prediction accuracy.Predictions below the threshold will be dropped.
- Parameters:
threshold- the threshold for the prediction accuracy- Returns:
- this builder
-
optInt32
Sets if use int32 datatype for theTranslator.- Parameters:
int32- true to include token types- Returns:
- this builder
-
configure
Configures the builder with the model arguments.- Parameters:
arguments- the model arguments
-
build
Builds the translator.- Returns:
- the new translator
- Throws:
IOException- if I/O error occurs
-