habana_frameworks.mediapipe.fn.ImageDecoder
habana_frameworks.mediapipe.fn.ImageDecoder¶
- Class:
habana_frameworks.mediapipe.fn.ImageDecoder(**kwargs)
- Define graph call:
__call__(input, random_crop_tensor)
- Parameter:
input - Input to decoder (image file list or buffer list).
(optional) random_crop_tensor - Tensor containing crop coordinates of each image in a batch, size=[4, batch_size]. Supported dimensions: minimum = 2, maximum = 2. Supported data types: FLOAT32.
Description:
Decodes and resizes batch of images. Supported formats: JPEG.
Random crop of decoded images can be done by providing random crop input tensor or by providing random_crop_type
along with scale_min
, scale_max
, ratio_max
, ratio_min
arguments.
- Supported backend:
HPU
Keyword Arguments:
kwargs |
Description |
---|---|
output_format |
Output image format produced by decoder.
|
resize |
Image resizing dimension after decoding in width, height.
|
resampling_mode |
Resampling mode selection.
|
random_crop_type |
Random crop mode selection.
|
seed |
Seed value used for calculation of random crop window for RANDOMIZED_AREA_AND_ASPECT_RATIO_CROP.
|
scale_min |
Specifies the lower bounds for the random area of the crop before resizing. The scale is defined with respect to the area of the original image.
|
scale_max |
Specifies the upper bounds for the random area of the crop before resizing. The scale is defined with respect to the area of the original image.
|
ratio_min |
Specifies ratio lower bounds for the random aspect ratio of the crop before resizing.
|
ratio_max |
Specifies ratio upper bounds for the random aspect ratio of the crop before resizing.
|
Note
Performance considerations:
Maximal performance is achieved when image scale factor is up to 9x.
Cropping to less than 48x48 pixels results in performance degradation.
RANDOMIZED_AREA_AND_ASPECT_RATIO_CROP algorithm needs
scale_min
,scale_max
,ratio_min
andratio_max
for calculating target area and aspect ratio to decide crop window.
RANDOMIZED_AREA_AND_ASPECT_RATIO_CROP Details:
Go to the following link and then Class RandomResizedCrop -> get_params() https://pytorch.org/vision/stable/_modules/torchvision/transforms/transforms.html#RandomCrop.forward
See also