Function: dvpp_set_resize_config_interpolation

Applicability

Product

Supported (√/x)

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas training products

Atlas inference products

Atlas 200I/500 A2 inference products

Function Usage

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)
    

Parameter Description

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 that in model training.

For the Atlas training products, the following resizing algorithms are supported:
  • 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.
For the Atlas inference products: 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.
For the Atlas 200I/500 A2 inference products, the following resizing algorithms are supported:
  • 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 8-bit YUV420SP (NV12) or 8-bit YUV420SP (NV21).

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

For the Atlas A2 training products/Atlas A2 inference products, the following resizing algorithms are supported:
  • 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 8-bit YUV420SP (NV12) or 8-bit YUV420SP (NV21).

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

For the Atlas A3 training products/Atlas A3 inference products, 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 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 8-bit YUV420SP (NV12) or 8-bit YUV420SP (NV21).

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

Return Value Description

Return Value

Description

ret

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