Resize

class dragon.vm.dali.ops.Resize(
  resize_x=None,
  resize_y=None,
  resize_shorter=None,
  resize_longer=None,
  max_size=None,
  interp_type=None,
  mag_filter=None,
  min_filter=None,
  **kwargs
)[source]

Resize the image.

Examples:

# Resize to a fixed area
resize1 = dali.ops.Resize(resize_x=300, resize_y=300)

# Resize along the shorter side
resize2 = dali.ops.Resize(resize_shorter=600, max_size=1000)

# Resize along the longer side
resize3 = dali.ops.Resize(resize_longer=512)

__new__

static Resize.__new__(
  cls,
  resize_x=None,
  resize_y=None,
  resize_shorter=None,
  resize_longer=None,
  max_size=None,
  interp_type=None,
  mag_filter=None,
  min_filter=None,
  **kwargs
)[source]

Create a Resize operator.

Parameters:
  • resize_x (int, optional) – The output image width.
  • resize_y (int, optional) – The output image height.
  • resize_shorter (int, optional) – Resize along the shorter side and limited by max_size.
  • resize_longer (int, optional) – Resize along the longer side.
  • max_size (int, optional, default=0) – The limited size for resize_shorter.
  • interp_type (str, optional) – The interpolation for both up and down sampling.
  • mag_filter (str, optional, default='LINEAR') – The interpolation for up sampling.
  • min_filter (str, optional, default='TRIANGULAR') – The interpolation for down sampling.