Class 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-in PreProcessor that provides image pre-processing from URL.
    • Constructor Detail

      • UrlImagePreProcessor

        public UrlImagePreProcessor​(PreProcessor<Image> preProcessor)
        Creates a UrlImagePreProcessor instance.
        Parameters:
        preProcessor - a PreProcessor 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 interface PreProcessor<T>
        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