Class UrlImagePreProcessor<T>
- java.lang.Object
-
- ai.djl.modality.cv.translator.wrapper.UrlImagePreProcessor<T>
-
- Type Parameters:
T- the output object type
- All Implemented Interfaces:
PreProcessor<java.net.URL>
public class UrlImagePreProcessor<T> extends java.lang.Object implements PreProcessor<java.net.URL>
Built-inPreProcessorthat provides image pre-processing from URL.
-
-
Constructor Summary
Constructors Constructor Description UrlImagePreProcessor(PreProcessor<Image> preProcessor)Creates aUrlImagePreProcessorinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NDListprocessInput(TranslatorContext ctx, java.net.URL input)Processes the input and converts it to NDList.
-
-
-
Constructor Detail
-
UrlImagePreProcessor
public UrlImagePreProcessor(PreProcessor<Image> preProcessor)
Creates aUrlImagePreProcessorinstance.- Parameters:
preProcessor- aPreProcessorthat can process image
-
-
Method Detail
-
processInput
public NDList processInput(TranslatorContext ctx, java.net.URL input) throws java.lang.Exception
Processes the input and converts it to NDList.- Specified by:
processInputin interfacePreProcessor<T>- Parameters:
ctx- the toolkit for creating the input NDArrayinput- the input object- Returns:
- the
NDListafter pre-processing - Throws:
java.lang.Exception- if an error occurs during processing input
-
-