Package ai.djl.huggingface.translator
Class ZeroShotObjectDetectionTranslator
java.lang.Object
ai.djl.huggingface.translator.ZeroShotObjectDetectionTranslator
- All Implemented Interfaces:
ai.djl.translate.NoBatchifyTranslator<ai.djl.modality.cv.VisionLanguageInput,,ai.djl.modality.cv.output.DetectedObjects> ai.djl.translate.PostProcessor<ai.djl.modality.cv.output.DetectedObjects>,ai.djl.translate.PreProcessor<ai.djl.modality.cv.VisionLanguageInput>,ai.djl.translate.Translator<ai.djl.modality.cv.VisionLanguageInput,ai.djl.modality.cv.output.DetectedObjects>
public class ZeroShotObjectDetectionTranslator
extends Object
implements ai.djl.translate.NoBatchifyTranslator<ai.djl.modality.cv.VisionLanguageInput,ai.djl.modality.cv.output.DetectedObjects>
The translator for Huggingface zero-shot-object-detection model.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe builder for zero-shot classification translator. -
Method Summary
Modifier and TypeMethodDescriptionbuilder(HuggingFaceTokenizer tokenizer) Creates a builder to build aZeroShotObjectDetectionTranslator.builder(HuggingFaceTokenizer tokenizer, Map<String, ?> arguments) Creates a builder to build aZeroShotObjectDetectionTranslator.ai.djl.ndarray.NDListprocessInput(ai.djl.translate.TranslatorContext ctx, ai.djl.modality.cv.VisionLanguageInput input) ai.djl.modality.cv.output.DetectedObjectsprocessOutput(ai.djl.translate.TranslatorContext ctx, ai.djl.ndarray.NDList list) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ai.djl.translate.NoBatchifyTranslator
getBatchifierMethods inherited from interface ai.djl.translate.Translator
batchProcessInput, batchProcessOutput, getExpansions, prepare
-
Method Details
-
processInput
public ai.djl.ndarray.NDList processInput(ai.djl.translate.TranslatorContext ctx, ai.djl.modality.cv.VisionLanguageInput input) throws ai.djl.translate.TranslateException - Specified by:
processInputin interfaceai.djl.translate.PreProcessor<ai.djl.modality.cv.VisionLanguageInput>- Throws:
ai.djl.translate.TranslateException
-
processOutput
public ai.djl.modality.cv.output.DetectedObjects processOutput(ai.djl.translate.TranslatorContext ctx, ai.djl.ndarray.NDList list) throws ai.djl.translate.TranslateException - Specified by:
processOutputin interfaceai.djl.translate.PostProcessor<ai.djl.modality.cv.output.DetectedObjects>- Throws:
ai.djl.translate.TranslateException
-
builder
Creates a builder to build aZeroShotObjectDetectionTranslator.- Parameters:
tokenizer- the tokenizer- Returns:
- a new builder
-
builder
public static ZeroShotObjectDetectionTranslator.Builder builder(HuggingFaceTokenizer tokenizer, Map<String, ?> arguments) Creates a builder to build aZeroShotObjectDetectionTranslator.- Parameters:
tokenizer- the tokenizerarguments- the models' arguments- Returns:
- a new builder
-