The figure briefs the API calls in typical scenarios. If the size of the input image does not meet the model requirements, media data processing is required. To implement model inference, the model needs to be loaded first. On the completion of model inference, the model needs to be unloaded. After model inference, the inference result needs to be postprocessed for displaying the class indexes corresponding to the top confidence values.
Call aclInit to initialize AscendCL.
Allocate devices, contexts, and streams in sequence.
For details, see API Call Sequence.
For the API call sequence, see API Call Sequence.
For the API call sequence, see Image/Video Data Processing.
For the API call sequence, see Running a Model.
After all data is processed, destroy runtime allocations including the streams, contexts, and devices in sequence.
For the API call sequence, see API Call Sequence.
Call aclFinalize to deinitialize AscendCL.
Memory allocation and deallocation, data transfer via memory copy, and data type creation and destruction are the most frequent calls across the app development workflow, and therefore are not thoroughly illustrated in the flowchart. For details about memory allocation and deallocation, and memory copy APIs, see Memory Management. For details about data type creation and destruction APIs, see Data Types and Operations.