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<URL>

public class UrlImagePreProcessor<T> extends Object implements PreProcessor<URL>
Built-in PreProcessor that provides image pre-processing from URL.
  • Constructor Details

    • UrlImagePreProcessor

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

    • processInput

      public NDList processInput(TranslatorContext ctx, URL input) throws Exception
      Processes the input and converts it to NDList.
      Specified by:
      processInput in interface PreProcessor<T>
      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