Class FileImagePreProcesor
- java.lang.Object
-
- ai.djl.modality.cv.translator.wrapper.FileImagePreProcesor
-
- All Implemented Interfaces:
PreProcessor<java.nio.file.Path>
public class FileImagePreProcesor extends java.lang.Object implements PreProcessor<java.nio.file.Path>
Built-inPreProcessorthat provides image pre-processing from file path.
-
-
Constructor Summary
Constructors Constructor Description FileImagePreProcesor(PreProcessor<Image> preProcessor)Creates aFileImagePreProcesorinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NDListprocessInput(TranslatorContext ctx, java.nio.file.Path input)Processes the input and converts it to NDList.
-
-
-
Constructor Detail
-
FileImagePreProcesor
public FileImagePreProcesor(PreProcessor<Image> preProcessor)
Creates aFileImagePreProcesorinstance.- Parameters:
preProcessor- a{@link PreProcessor}that can process image
-
-
Method Detail
-
processInput
public NDList processInput(TranslatorContext ctx, java.nio.file.Path input) throws java.lang.Exception
Processes the input and converts it to NDList.- Specified by:
processInputin interfacePreProcessor<java.nio.file.Path>- 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
-
-