Function: set_aipp_padding_params

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 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)
    

Parameter Description

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: Edge padding is not performed. The default value is 0. In this case, setting padding_size_top, padding_size_bottom, padding_size_left, and padding_size_right is invalid.
  • 1: 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.

Return Value Description

Return Value

Description

ret

Int, error code.

Restrictions

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