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-inPreProcessor
that provides image pre-processing from URL.
-
-
Constructor Summary
Constructors Constructor Description UrlImagePreProcessor(PreProcessor<Image> preProcessor)
Creates aUrlImagePreProcessor
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NDList
processInput(TranslatorContext ctx, java.net.URL input)
Processes the input and converts it to NDList.
-
-
-
Constructor Detail
-
UrlImagePreProcessor
public UrlImagePreProcessor(PreProcessor<Image> preProcessor)
Creates aUrlImagePreProcessor
instance.- Parameters:
preProcessor
- aPreProcessor
that 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:
processInput
in interfacePreProcessor<T>
- Parameters:
ctx
- the toolkit for creating the input NDArrayinput
- the input object- Returns:
- the
NDList
after pre-processing - Throws:
java.lang.Exception
- if an error occurs during processing input
-
-