-
Notifications
You must be signed in to change notification settings - Fork 3
Optimization
OpenVINO Runtime supports inference in either synchronous or asynchronous mode. The key advantage of the Async API is that when a device is busy with inference, the application can perform other tasks in parallel (for example, populating inputs or scheduling other requests) rather than wait for the current inference to complete first.
Asynchronous mode pipelines can be supported with the AsyncInferQueue wrapper class. This class automatically spawns the pool of InferRequest objects (also called “jobs”) and provides synchronization mechanisms to control the flow of the pipeline. It is a simpler way to manage the infer request queue in Asynchronous mode.
Since our solution is devided into two steps and these steps have to be executed multiple times, we can use AsyncInferQueue which will create a stream of Infer-Requests, and one Infer-Request need not to wait until the previous one is completed.

We achived this by creating a pipeline which follow :
- The
main_loopwill capture/read frame and pre-process it for detector, hence creating a detection InferRequest. - Once this detection InferRequest will complete it will call the
detector_callbackfunction which will further process the detection result and start a segmentation InferRequst. - And at last once the segmentation InferRequest will complete it will call the
segmentor_callbackfunction which will calculate reading and plot results.