Class ImageToNDArrayStep

  • All Implemented Interfaces:
    ai.konduit.serving.pipeline.api.step.PipelineStep, ai.konduit.serving.pipeline.api.TextConfig, java.io.Serializable

    public class ImageToNDArrayStep
    extends java.lang.Object
    implements ai.konduit.serving.pipeline.api.step.PipelineStep
    A PipelineStep for converting Images to NDArrays. The exact way that images are converted is highly configurable (formats, channels, output sizes, normalization, etc) - see ImageToNDArrayConfig for more details

    The following configuration is available:
    • config: the ImageToNDArrayConfig configuration for how conversion should be performed
    • keys: may be null. If non-null: These are the names of images in the Data instance to convert
    • outputNames: may be null. If non-null: the input images are renamed to this in the output Data instance after conversion to NDArray
    • keepOtherValues: True by default. If true: copy all the other (non-converted/non-image) entries in the input Data to the output Data
    • metadata: False by default. If true: include metadata about the images in the output Data - for example if/how it was cropped, and the original input size.
    • metadataKey: Sets the key that the metadata will be stored under. Default: DEFAULT_METADATA_KEY. Not relevant if metadata == false

    Note that metadata will have the following format:
    If a single image is converted, the metadata Data instance will have a nested Data instance i.e.:

     
     Data meta = myData.get( "@ImageToNDArrayStepMetadata");
     }
    Author:
    Alex Black
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ImageToNDArrayStep​(ImageToNDArrayConfig config, java.util.List<java.lang.String> keys, java.util.List<java.lang.String> outputNames, boolean keepOtherValues, boolean metadata, java.lang.String metadataKey)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ImageToNDArrayStep keys​(java.lang.String... keys)  
      ImageToNDArrayStep outputNames​(java.lang.String... outputNames)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface ai.konduit.serving.pipeline.api.step.PipelineStep

        name
      • Methods inherited from interface ai.konduit.serving.pipeline.api.TextConfig

        toJson, toYaml
    • Constructor Detail

      • ImageToNDArrayStep

        public ImageToNDArrayStep​(ImageToNDArrayConfig config,
                                  java.util.List<java.lang.String> keys,
                                  java.util.List<java.lang.String> outputNames,
                                  boolean keepOtherValues,
                                  boolean metadata,
                                  java.lang.String metadataKey)