Sets the dynamic AIPP attributes for model inference based on the index of the dynamic AIPP input. This API is synchronous.
Dynamic AIPP provides the following functions and they are executed in the exact sequence: Cropping -> CSC -> Resizing (not supported currently) -> Mean subtraction/Normalization -> Padding
Cropping |
Resizing |
Padding |
Output Width and Height |
|---|---|---|---|
× |
× |
× |
aippOutputW = srcImageSizeW, aippOutputH = srcImageSizeH |
√ |
× |
× |
aippOutputW = cropSizeW, aippOutputH = cropSizeH |
√ |
√ |
× |
aippOutputW = scfOutputSizeW, aippOutputH = scfOutputSizeH |
√ |
× |
√ |
aippOutputW = cropSizeW + paddingSizeLeft + paddingSizeRight, aippOutputH = cropSizeH + paddingSizeTop + paddingSizeBottom |
× |
× |
√ |
aippOutputW = srcImageSizeW + paddingSizeLeft + paddingSizeRight, aippOutputH = srcImageSizeH + paddingSizeTop + paddingSizeBottom |
× |
√ |
√ |
aippOutputW = scfOutputSizeW + paddingSizeLeft + paddingSizeRight, aippOutputH = scfOutputSizeH + paddingSizeTop + paddingSizeBottom |
× |
√ |
× |
aippOutputW = scfOutputSizeW, aippOutputH = scfOutputSizeH |
√ |
√ |
√ |
aippOutputW = scfOutputSizeW + paddingSizeLeft + paddingSizeRight, aippOutputH = scfOutputSizeH + paddingSizeTop + paddingSizeBottom |
aclError aclmdlSetInputAIPP(uint32_t modelId, aclmdlDataset *dataset, size_t index, const aclmdlAIPP *aippParmsSet)
Parameter |
Input/Output |
Description |
|---|---|---|
modelId |
Input |
Model ID. A successful aclmdlLoadFromFile, aclmdlLoadFromMem, aclmdlLoadFromFileWithMem, or aclmdlLoadFromMemWithMem call returns a model ID. |
dataset |
Input |
Pointer to the input data for model inference. Data of type aclmdlDataset describes the input data for model inference, while data of type aclDataBuffer describes the input buffer size and address. |
index |
Input |
Input index of the dynamic AIPP input. When the model has more than one dynamic AIPP input, you can call aclmdlGetAippType to obtain the specified input index. To ensure forward compatibility, if there is only one dynamic AIPP input, you can call aclmdlGetInputIndexByName to obtain the input index. The input name is fixed to ACL_DYNAMIC_AIPP_NAME. |
aippParmsSet |
Input |
Pointer to the dynamic AIPP parameter object. Call aclmdlCreateAIPP in advance to create data of the aclmdlAIPP type. |
0 on success; else, failure.
For details about the API call sequence and example, see Dynamic AIPP Model Inference.