Function: set_aipp_padding_params

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

Function Usage

Sets padding parameters in the dynamic AIPP scenario.

Prototype

  • C Prototype
    1
    aclError aclmdlSetAIPPPaddingParams(aclmdlAIPP *aippParmsSet, int8_t paddingSwitch,int32_t paddingSizeTop, int32_t paddingSizeBottom,int32_t paddingSizeLeft, int32_t paddingSizeRight,uint64_t batchIndex)
    
  • Python Function
    1
    ret = acl.mdl.set_aipp_padding_params(aipp_parms_set, padding_switch, padding_size_top, padding_size_bottom, padding_size_left, padding_size_right, batch_index)
    

Parameters

Parameter

Description

aipp_parms_set

Int, pointer address of the dynamic AIPP configuration object. The aclmdlAIPP data must be created by the acl.mdl.create_aipp call in advance.

padding_switch

Int, whether to enable image padding.

Value range:

  • 0 (default): padding disabled. In this case, padding_size_top, padding_size_bottom, padding_size_left, and padding_size_right are invalid.
  • 1: padding enabled.

padding_size_top

Int, top padding size. Value range: [0, 32].

padding_size_bottom

Int, bottom padding size. Value range: [0, 32].

padding_size_left

Int, left padding size. Value range: [0, 32].

padding_size_right

Int, right padding size. Value range: [0, 32].

batch_index

Int, index of the batch for image padding. The default value is 0. The value range is [0, batch_size). batch_size is set when acl.mdl.create_aipp is called to create data of the aclmdlAIPP type.

Returns

Return Value

Description

ret

Int, error code.

Restrictions

The padded width must be less than or equal to 1080 pixels.