Class FileImagePreProcessor

java.lang.Object
ai.djl.modality.cv.translator.wrapper.FileImagePreProcessor
All Implemented Interfaces:
PreProcessor<Path>

public class FileImagePreProcessor extends Object implements PreProcessor<Path>
Built-in PreProcessor that provides image pre-processing from file path.
  • Constructor Details

    • FileImagePreProcessor

      public FileImagePreProcessor(PreProcessor<Image> preProcessor)
      Creates a FileImagePreProcessor instance.
      Parameters:
      preProcessor - a PreProcessor that can process image
  • Method Details

    • processInput

      public NDList processInput(TranslatorContext ctx, Path input) throws Exception
      Processes the input and converts it to NDList.
      Specified by:
      processInput in interface PreProcessor<Path>
      Parameters:
      ctx - the toolkit for creating the input NDArray
      input - the input object
      Returns:
      the NDList after pre-processing
      Throws:
      Exception - if an error occurs during processing input