STMicroelectronics / stm32ai-modelzoo

AI Model Zoo for STM32 devices
Other
279 stars 69 forks source link

Does STM32MP2 support YOLOv5 (or newer) object detection? #50

Open yoppy-tjhin opened 2 days ago

yoppy-tjhin commented 2 days ago

Hi,

Previously we have been successfully running our custom YOLOv5 model on the NPU of Rockchip 3588 platform. Now we want to porting our platform to STM32MP2. From the wiki guide, object detection with YOLOv5 or newer version is not mentioned.

We wish that our custom YOLOv5 model can be run the NPU of STM32MP2. If now is not supported yet, are there any plan to move to that direction?

We have trained the ssd_mobilenet_v2_fpn model using our same dataset as for YOLOv5. (yet, still trying to run the model #49) And the mAP (as stated in the training logs) of ssd_mobilenet_v2_fpn is much lower than YOLOv5.

Thank you.

abrSTM commented 2 days ago

Hello,

We have already successfully run YOLO models on our NPU, including v4, v5, v8, and Tiny YOLO v2.

To run it on the NPU, you need to convert it to NBG format, you will find more information in these wiki:

Then the generated model will be able to run on the NPU. However, you need to develop your own application for your specific use case based on our demo application as an example. If your use case is object detection, you will probably need to change the post-processing file.

Regards, ABR

yoppy-tjhin commented 1 day ago

Hello,

Thank you for your prompt response. Do you have an example working python script for running YOLOv5 on the NPU of STM32MP257?

Thank you.

abrSTM commented 1 day ago

Hello,

We have the Semantic Segmentation demo application that is based on YoloV8-pose model.

Currently, we do not have an example of Yolo model for Object Detection. But, you can look at the Semantic Segmentation post-processing file to reproduce the NMS function in a Object Detection use case. You can also use resources from Ultralytics github to reproduce the YoloV5 post-processing in your application.

Regards, ABR