Performs a crop with a randomly selected area and aspect ratio and resizes it to the specified size.
Expects a three-dimensional input with samples in height, width, channels (HWC) layout.
This operator allows sequence inputs.
- Supported backends
input (TensorList ('HWC', 'CHW', 'FHWC', 'FCHW', 'CFHW')) – Input to the operator.
- Keyword Arguments
size (int or list of int) – Size of the resized image.
antialias (bool, optional, default = True) –
If enabled, it applies an antialiasing filter when scaling down.
Nearest neighbor interpolation does not support antialiasing.
bytes_per_sample_hint (int or list of int, optional, default = ) –
Output size hint, in bytes per sample.
If specified, the operator’s outputs residing in GPU or page-locked host memory will be preallocated to accommodate a batch of samples of this size.
nvidia.dali.types.DALIDataType, optional) –
Output data type.
Must be same as input type or
float. If not set, input type is used.
Type of interpolation to be used.
mag_filterto specify different filtering for downscaling and upscaling.
Usage of INTERP_TRIANGULAR is now deprecated and it should be replaced by a combination of
minibatch_size (int, optional, default = 32) – Maximum number of images that are processed in a kernel call.
num_attempts (int, optional, default = 10) – Maximum number of attempts used to choose random area and aspect ratio.
preserve (bool, optional, default = False) – Prevents the operator from being removed from the graph even if its outputs are not used.
random_area (float or list of float, optional, default = [0.08, 1.0]) –
Range from which to choose random area fraction
The cropped image’s area will be equal to
A* original image’s area.
random_aspect_ratio (float or list of float, optional, default = [0.75, 1.333333]) – Range from which to choose random aspect ratio (width/height).
seed (int, optional, default = -1) –
If not provided, it will be populated based on the global seed of the pipeline.
temp_buffer_hint (int, optional, default = 0) –
Initial size in bytes, of a temporary buffer for resampling.
This argument is ignored for the CPU variant.