The model inference workflow in the dynamic AIPP scenario is similar to that in the scenario described in Developing a Basic Inference App. Both workflows include AscendCL initialization and deinitialization, runtime resource allocation and deallocation, model building, model loading, model execution, and model unloading.
This section focuses on the differences between the two scenarios.
After model building, the AIPP inputs are added to the generated OM model. During model inference, the AIPP input values are provided.
Assume that the AIPP configuration of input a is dynamic. In the generated .om model, input b is added to describe the AIPP configuration of input a. For details about how to prepare the data structure of input a for model execution, see Preparing Input/Output Data Structure for Model Execution. For details about how to prepare the data structure of input b and set the data of input b, see the following description.
#define ACL_DYNAMIC_AIPP_NAME "ascend_dynamic_aipp_data"
Do not initialize the buffer manually; otherwise, the service will be unavailable. After the API calls described in 2, the system automatically initializes the buffer.
AscendCL also supports Digital Vision Pre-Processing (DVPP), which introduces hardware-based media data processing techniques, including 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 APIs, see Image/Video Data Processing.