nvidia.dali.fn.decoders.image_random_crop — NVIDIA DALI (original) (raw)

nvidia.dali.fn.decoders.image_random_crop(__input, /, *, affine=True, bytes_per_sample_hint=[0], device_memory_padding=16777216, device_memory_padding_jpeg2k=0, host_memory_padding=8388608, host_memory_padding_jpeg2k=0, hw_decoder_load=0.65, hybrid_huffman_threshold=1000000, jpeg_fancy_upsampling=False, memory_stats=False, num_attempts=10, output_type=DALIImageType.RGB, preallocate_height_hint=0, preallocate_width_hint=0, preserve=False, random_area=[0.08, 1.0], random_aspect_ratio=[0.75, 1.333333], seed=-1, use_fast_idct=False, device=None, name=None)#

Decodes images and randomly crops them.

The cropping window’s area (relative to the entire image) and aspect ratio can be restricted to a range of values specified by area and aspect_ratio arguments. respectively.

When possible, the operator uses the ROI decoding APIs (for example, libjpeg-turbo and nvJPEG) to reduce the decoding time and memory usage. When the ROI decoding is not supported for a given image format, it will decode the entire image and crop the selected ROI.

The output of the decoder is in HWC layout.

Supported formats: JPG, BMP, PNG, TIFF, PNM, PPM, PGM, PBM, JPEG 2000, WebP.

Note

JPEG 2000 region-of-interest (ROI) decoding is not accelerated on the GPU, and will use a CPU implementation regardless of the selected backend. For a GPU accelerated implementation, consider using separate decoders.image and random_crop operators.

Note

EXIF orientation metadata is disregarded.

Supported backends

Parameters:

__input (TensorList) – Input to the operator.

Keyword Arguments: