ImageDecoderRandomCrop

class dragon.vm.dali.ops.ImageDecoderRandomCrop(
  output_type='BGR',
  host_memory_padding=8388608,
  device_memory_padding=16777216,
  random_area=0.08, 1.0,
  random_aspect_ratio=0.75, 1.33,
  num_attempts=10,
  **kwargs
)[source]

Decode image and return a random crop.

Examples:

decode = dali.ops.ImageDecoderRandomCrop(
    out_type='BGR',
    # Inception sampling policy for image classification
    random_area=(0.08, 1.00),
    random_aspect_ratio=(0.75, 1.33),
)
y = decode(inputs['x'])

__new__

static ImageDecoderRandomCrop.__new__(
  cls,
  output_type='BGR',
  host_memory_padding=8388608,
  device_memory_padding=16777216,
  random_area=0.08, 1.0,
  random_aspect_ratio=0.75, 1.33,
  num_attempts=10,
  **kwargs
)[source]

Create a ImageDecoderRandomCrop operator.

Parameters:
  • output_type ({'BGR', 'RGB'}, optional) – The output color space.
  • host_memory_padding (int, optional, default=8388608) – The number of bytes for host buffer.
  • device_memory_padding (int, optional, default=16777216) – The number of bytes for device buffer.
  • random_area (Sequence[float], optional, default=(0.08, 1.)) – The range of scale for sampling.
  • random_aspect_ratio (Sequence[float], optional, default=(0.75, 1.33)) – The range of aspect ratio for sampling.
  • num_attempts (int, optional, default=10) – The max number of sampling trails.
Returns:

nvidia.dali.ops.ImageDecoderRandomCrop – The operator.