Class StringImagePreProcessor
java.lang.Object
ai.djl.modality.cv.translator.wrapper.StringImagePreProcessor
- All Implemented Interfaces:
PreProcessor<String>
Built-in
PreProcessor that provides image pre-processing from url or base64 encoded
string.-
Constructor Summary
ConstructorsConstructorDescriptionStringImagePreProcessor(PreProcessor<Image> preProcessor) Creates aStringImagePreProcessorinstance. -
Method Summary
Modifier and TypeMethodDescriptionprocessInput(TranslatorContext ctx, String input) Processes the input and converts it to NDList.
-
Constructor Details
-
StringImagePreProcessor
Creates aStringImagePreProcessorinstance.- Parameters:
preProcessor- aPreProcessorthat can process image
-
-
Method Details
-
processInput
Processes the input and converts it to NDList.- Specified by:
processInputin interfacePreProcessor<String>- Parameters:
ctx- the toolkit for creating the input NDArrayinput- the input object- Returns:
- the
NDListafter pre-processing - Throws:
Exception- if an error occurs during processing input
-