Class Resize

java.lang.Object
ai.djl.modality.cv.transform.Resize
All Implemented Interfaces:
Transform

public class Resize extends Object implements Transform
A Transform that resizes the image.
  • Constructor Details

    • Resize

      public Resize(int size)
      Creates a Resize Transform that resizes to the given size.
      Parameters:
      size - the new size to use for both height and width
    • Resize

      public Resize(int width, int height)
      Creates a Resize Transform that resizes to the given width and height.
      Parameters:
      width - the desired width
      height - the desired height
    • Resize

      public Resize(int width, int height, Image.Interpolation interpolation)
      Creates a Resize Transform that resizes to the given width and height with given interpolation.
      Parameters:
      width - the desired width
      height - the desired height
      interpolation - the desired interpolation
  • Method Details

    • getWidth

      public int getWidth()
      Returns the width.
      Returns:
      the width
    • getHeight

      public int getHeight()
      Returns the height.
      Returns:
      the height
    • transform

      public NDArray transform(NDArray array)
      Applies the Transform to the given NDArray.
      Specified by:
      transform in interface Transform
      Parameters:
      array - the NDArray on which the Transform is applied
      Returns:
      the output of the Transform