Concepts and Restrictions
What Is AIPP?
AIPP (Artificial Intelligence Pre-Processing) is used to preprocess images on AI Core, including color space conversion (CSC), image normalization (by subtracting the mean value or multiplying a factor), and image cropping (by specifying the crop start and cropping the image size required by the neural network).
Static AIPP and dynamic AIPP modes are supported. However, these two modes are mutually exclusive.
- Static AIPP: During model conversion, set the AIPP mode to static and set the AIPP parameters. After the model is generated, the AIPP parameter values are saved in the offline model (*.om file). The same AIPP parameter configurations are used in each model inference phase and cannot be modified.
In static AIPP mode, batches share the same set of AIPP parameters.
- Dynamic AIPP: If you use this mode when converting a model, you can set dynamic AIPP parameters each time before running the model for inference.
In dynamic AIPP mode, batches can use different sets of AIPP parameters.
Restrictions
- If dynamic AIPP and dynamic batch size are both enabled:
- When aclmdlCreateAIPP is called to set batchSize, batchSize must be set to the maximum batch size.
- For data nodes that require dynamic AIPP, the corresponding input buffer must be allocated based on the maximum batch size.
- If dynamic AIPP and dynamic image size are both enabled:
- If the image cropping, resizing, or padding function is enabled in setting the dynamic AIPP attributes, dynamic image size becomes unavailable.
- If the image cropping, resizing, or padding function is not enabled when the dynamic AIPP parameters are set and the dynamic image size is used at the same time, ensure that the width and height configured by calling aclmdlSetAIPPSrcImageSize are the same as those configured by calling aclmdlSetDynamicHWSize. Both of them must be set to the width and height of the maximum dynamic image size during model conversion.
- For data nodes that require dynamic AIPP, the corresponding input buffer must be allocated based on the allowed maximum image size.
- When dynamic AIPP and dynamic shape input (setting the shape range) are used at the same time, the width and height of the output image of dynamic AIPP must be within the configured shape range.
- For a single model, AIPP (static or dynamic) and dynamic dimensions (ND format) are mutually exclusive.
- Digital Vision Pre-Processing (DVPP) is also supported, which introduces hardware-based media data processing techniques, such as resizing, cropping, format conversion, image encoding and decoding, and video encoding and decoding. Compared with AIPP, DVPP offers a wider set of processing operations, but it has particular restrictions on the image input/output and memory allocation.
For details about the DVPP-based media data processing APIs, see DVPP Media Acceleration Library.
Parent topic: Dynamic AIPP Model Inference