Function: dvpp_set_resize_config_interpolation

Applicability

Product

Supported

Atlas 350 Accelerator Card

x

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas training product

Atlas inference product

Atlas 200I/500 A2 inference product

Description

Sets the image resizing algorithm.

Prototype

  • C Prototype
    1
    aclError acldvppSetResizeConfigInterpolation(acldvppResizeConfig *resizeConfig, uint32_t interpolation)
    
  • Python Function
    1
    ret = acl.media.dvpp_set_resize_config_interpolation(dvpp_resize_config,  interpolation)
    

Parameters

Parameter

Description

dvpp_resize_config

Int, pointer address of the resizing configuration data to be set. Call acl.media.dvpp_create_resize_config to create data of the acldvppResizeConfig type in advance.

interpolation

Int, resizing algorithm. You are advised to use the same resizing algorithm as in model training.

The Atlas training product supports the following resizing algorithms:
  • 0 (default): high-order filtering algorithm developed by Huawei.
  • 1: conventional bilinear algorithm, whose compute process is close to that of OpenCV.
  • 2: conventional nearest neighbor algorithm, whose compute process is close to that of OpenCV.
  • 3: conventional bilinear algorithm, whose compute process is close to that of TensorFlow.
  • 4: conventional nearest neighbor algorithm, whose compute process is close to that of TensorFlow.
Atlas inference product: The following resizing algorithms are supported:
  • 0: The system automatically uses the value 1 (even if 0 is set).
  • 1: conventional bilinear algorithm, whose compute process is close to that of OpenCV.

    When this algorithm is set and the input and output images are in RGB format, the maximum difference between the pixel value of the algorithm and that of OpenCV is ±1 within the resizing range of [1/32, 512].

  • 2: conventional nearest neighbor algorithm, whose compute process is close to that of OpenCV.
The Atlas 200I/500 A2 inference product supports the following resizing algorithms:
  • 0 (default): high-order filtering algorithm developed by Huawei.
  • 1: conventional bilinear algorithm, whose compute result is close to that of OpenCV-3.4.2.
  • 2: conventional nearest neighbor algorithm, whose compute result is close to that of OpenCV-3.4.2.
  • 3: conventional bilinear algorithm (same as 1).
  • 4: conventional nearest neighbor algorithm (same as 2).
  • 5: high-order filtering algorithm developed by Huawei.

    The resizing algorithm supports only the input image resolution ranging from 10 x 6 to 8192 x 8192 and the output image resolution ranging from 10 x 6 to 4096 x 8192.

    The input image format must be YUV (excluding Planar, YUV400, and YUV440). The output image format must be YUV420SP (NV12) 8-bit or YUV420SP (NV21) 8-bit.

    Width and height resizing range: [1/32, 16]

The Atlas A2 training product/Atlas A2 inference product supports the following resizing algorithms:
  • 0 (default): high-order filtering algorithm developed by Huawei.
  • 1: conventional bilinear algorithm, whose compute result is close to that of OpenCV-3.4.2.
  • 2: conventional nearest neighbor algorithm, whose compute result is close to that of OpenCV-3.4.2.
  • 3: conventional bilinear algorithm (same as 1).
  • 4: conventional nearest neighbor algorithm (same as 2).
  • 5: high-order filtering algorithm developed by Huawei.

    The resizing algorithm supports only the input image resolution ranging from 10 x 6 to 8192 x 8192 and the output image resolution ranging from 10 x 6 to 4096 x 8192.

    The input image format must be YUV (excluding Planar, YUV400, and YUV440). The output image format must be YUV420SP (NV12) 8-bit or YUV420SP (NV21) 8-bit.

    Width and height resizing range: [1/32, 16]

The Atlas A3 training product/Atlas A3 inference product supports the following resizing algorithms:
  • 0: The system automatically uses the value 1 (even if 0 is set).
  • 1: conventional bilinear algorithm, whose compute result is close to that of OpenCV-3.4.2.
  • 2: conventional nearest neighbor algorithm, whose compute result is close to that of OpenCV-3.4.2.
  • 3: conventional bilinear algorithm (same as 1).
  • 4: conventional nearest neighbor algorithm (same as 2).
  • 5: high-order filtering algorithm developed by Huawei.

    The resizing algorithm supports only the input image resolution ranging from 10 x 6 to 8192 x 8192 and the output image resolution ranging from 10 x 6 to 4096 x 8192.

    The input image format must be YUV (excluding Planar, YUV400, and YUV440). The output image format must be YUV420SP (NV12) 8-bit or YUV420SP (NV21) 8-bit.

    Width and height resizing range: [1/32, 16]

Return Value

Return Value

Description

ret

Int, error code. 0 on success; else, failure.