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

nvidia.dali.fn.experimental.decoders.image_crop(__input, /, *, adjust_orientation=True, affine=True, bytes_per_sample_hint=[0], crop=None, crop_d=0.0, crop_h=0.0, crop_pos_x=0.5, crop_pos_y=0.5, crop_pos_z=0.5, crop_w=0.0, device_memory_padding=16777216, device_memory_padding_jpeg2k=0, dtype=DALIDataType.UINT8, host_memory_padding=8388608, host_memory_padding_jpeg2k=0, hw_decoder_load=0.9, hybrid_huffman_threshold=1000000, jpeg_fancy_upsampling=False, output_type=DALIImageType.RGB, preallocate_height_hint=0, preallocate_width_hint=0, preserve=False, rounding='round', use_fast_idct=False, device=None, name=None)#

Decodes images and extracts regions-of-interest (ROI) that are specified by fixed window dimensions and variable anchors.

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

The output of the decoder is in HWC layout.

The implementation uses NVIDIA nvImageCodec to decode images.

When possible, the operator uses the ROI decoding, reducing the decoding time and memory consumption.

Note

GPU accelerated decoding is only available for a subset of the image formats (JPEG, and JPEG2000). For other formats, a CPU based decoder is used. For JPEG, a dedicated HW decoder will be used when available.

Supported backends

Parameters:

__input (TensorList) – Input to the operator.

Keyword Arguments:

output_typenvidia.dali.types.DALIImageType, optional, default = DALIImageType.RGB

The color space of the output image.

Note: When decoding to YCbCr, the image will be decoded to RGB and then converted to YCbCr, following the YCbCr definition from ITU-R BT.601.

preallocate_height_hintint, optional, default = 0

Image width hint.

Applies only to the mixed backend type in NVIDIA Ampere GPU architecture.

The hint is used to preallocate memory for the HW JPEG decoder.

preallocate_width_hintint, optional, default = 0

Image width hint.

Applies only to the mixed backend type in NVIDIA Ampere GPU architecture.

The hint is used to preallocate memory for the HW JPEG decoder.

preservebool, optional, default = False

Prevents the operator from being removed from the graph even if its outputs are not used.

roundingstr, optional, default = ‘round’

Determines the rounding function used to convert the starting coordinate of the window to an integral value (see crop_pos_x, crop_pos_y, crop_pos_z).

Possible values are:

split_stages : bool, optional, default = False

Warning

The argument split_stages is now deprecated and its usage is discouraged.

use_chunk_allocator : bool, optional, default = False

Warning

The argument use_chunk_allocator is now deprecated and its usage is discouraged.

use_fast_idctbool, optional, default = False

Enables fast IDCT in the libjpeg-turbo based CPU decoder, used when device is set to “cpu” or when the it is set to “mixed” but the particular image can not be handled by the GPU implementation.

According to the libjpeg-turbo documentation, decompression performance is improved by up to 14% with little reduction in quality.