<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=1332818711964721&amp;ev=PageView&amp;noscript=1">

Silex Knowledge Pool

AI inference with Yolo OBB model on EP-200Q

OBB (Oriented Bounding Boxes) model for more accurate object detection

OBB model provides you with angle information of detected objects, resulting in more accurate detection of tilted objects on an image. One of the famous OBB model is Yolo OBB model, though there are other two-stage OBB detectors.

The example in this article uses Yolov8m-obb model. Before using the model on the EP-200Q, the model has to go through model conversion or quantization process, The process is described in another article.

Here is what we found with the OBB model on the EP-200Q.

INT8 quantization affects confidence scores, but minimally.

With the score more than 80%, all airplanes in the input picture are properly detected with the rotation information.  

 

We also run the FP32 model, which is not quantized, on the CPU. All 29 airplanes are also detected as expected.

The average confidence scores of 29 airplanes in these two exercise are as below.

INT8 quantized model: 0.88

FP32 model: 0.885

As long as the confidence score is compared, there is the impact, but it is not significant.

However, if the application uses the confidence score as the threshold to recognize them as airplanes, careful review of the threshold value is necessary. When 0.9 is used for the threshold, only 1 airplane is recognized with INT8 model whereas 9 airplanes are recognized with FP32 model.

AI inference with INT8 quantized model on the EP-200Q NPU is superb.

We used a different image as below (100 planes in total) to check how fast AI inference process is.

The image is captured by a camera with 30fps frame rate. The captured image is fed into the AI inference process. Once the AI inference returns the value, the process proceeds with the next captured image. The program monitors how many images can be processed in one second.

  640 x 640 input image size 1024 x 1024 input image size
Processor FP32 INT8 INT8 FP32 INT8 INT8
Model CPU CPU NPU CPU CPU NPU
FPS (Frame Per Second) 0.79 3.04 29.8 0.31 1.19 28.96
 

The OBB model with either FP32 or INT8 can be run on CPU, but it takes time handle one image. The NPU can handle INT8 quantized model much faster. With the camera sensor with 30fps input, it can manage every single frame. When even slight improved confidence score is matter for the application, using FP32 model on the CPU could be still the solution, but please remind that running AI model in CPU can affect other tasks handed by the CPU.

 

Summary

It is demonstrated that the Yolov8n-obb model can be quantized and run on the EP-200Q NPU with decent accuracy and AI inference latency. When your application needs to detect several types of objects for the next processing on the CPU such as alerting, logging, controlling something in real time matter, the EP-200Q could be the solution for your system.