Class FileImagePreProcesor

  • All Implemented Interfaces:
    PreProcessor<java.nio.file.Path>

    public class FileImagePreProcesor
    extends java.lang.Object
    implements PreProcessor<java.nio.file.Path>
    Built-in PreProcessor that provides image pre-processing from file path.
    • Constructor Detail

      • FileImagePreProcesor

        public FileImagePreProcesor​(PreProcessor<Image> preProcessor)
        Creates a FileImagePreProcesor instance.
        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:
        processInput in interface PreProcessor<java.nio.file.Path>
        Parameters:
        ctx - the toolkit for creating the input NDArray
        input - the input object
        Returns:
        the NDList after pre-processing
        Throws:
        java.lang.Exception - if an error occurs during processing input