| --- |
| license: mit |
| language: |
| - en |
| pipeline_tag: object-detection |
| tags: |
| - Ultralytics |
| - YOLOv5 |
| - YOLOv5-Seg |
| --- |
| |
| # YOLOv5 |
|
|
| This version of YOLOv5 has been converted to run on the Axera NPU using **w8a16** quantization. |
|
|
| This model has been optimized with the following LoRA: |
|
|
| Compatible with Pulsar2 version: 3.4 |
|
|
| ## Convert tools links: |
|
|
| For those who are interested in model conversion, you can try to export axmodel through |
|
|
| - [The repo of ax-samples](https://github.com/AXERA-TECH/ax-samples), which you can get the how to build the `ax_yolov5s_seg` |
|
|
| - [The repo of axcl-samples](https://github.com/AXERA-TECH/axcl-samples), which you can get the how to build the `axcl_yolov5s_seg` |
|
|
| - [Pulsar2 Link, How to Convert ONNX to axmodel](https://pulsar2-docs.readthedocs.io/en/latest/pulsar2/introduction.html) |
|
|
|
|
| ## Support Platform |
|
|
| - AX650 |
| - [M4N-Dock(η±θ―ζ΄ΎPro)](https://wiki.sipeed.com/hardware/zh/maixIV/m4ndock/m4ndock.html) |
| - [M.2 Accelerator card](https://axcl-docs.readthedocs.io/zh-cn/latest/doc_guide_hardware.html) |
| - AX630C |
| - [η±θ―ζ΄Ύ2](https://axera-pi-2-docs-cn.readthedocs.io/zh-cn/latest/index.html) |
| - [Module-LLM](https://docs.m5stack.com/zh_CN/module/Module-LLM) |
| - [LLM630 Compute Kit](https://docs.m5stack.com/zh_CN/core/LLM630%20Compute%20Kit) |
| |
| |Chips|cost| |
| |--|--| |
| |AX650| 9.55 ms | |
| |AX630C| TBD ms | |
|
|
| ## How to use |
|
|
| Download all files from this repository to the device |
|
|
| ``` |
| root@ax650 ~/yolov5-seg # tree -L 2 |
| . |
| βββ ax650 |
| βΒ Β βββ yolov5s-seg.axmodel |
| βββ ax_aarch64 |
| βΒ Β βββ ax_yolov5s_seg |
| βββ config.json |
| βββ football.jpg |
| βββ README.md |
| βββ yolov5_seg_config.json |
| βββ yolov5s-seg-cut.onnx |
| βββ yolov5s-seg.onnx |
| βββ yolov5s_seg_out.jpg |
| |
| 3 directories, 10 files |
| ``` |
|
|
| ### Inference |
|
|
| Input image: |
|  |
|
|
| #### Inference with AX650 Host, such as M4N-Dock(η±θ―ζ΄ΎPro) |
|
|
| ``` |
| root@ax650 ~/yolov5-seg # ./ax_yolov5s_seg -m yolov5s-seg.axmodel -i football.jpg |
| -------------------------------------- |
| model file : yolov5s-seg.axmodel |
| image file : football.jpg |
| img_h, img_w : 640 640 |
| -------------------------------------- |
| Engine creating handle is done. |
| Engine creating context is done. |
| Engine get io info is done. |
| Engine alloc io is done. |
| Engine push input is done. |
| -------------------------------------- |
| post process cost time:9.19 ms |
| -------------------------------------- |
| Repeat 1 times, avg time 9.55 ms, max_time 9.55 ms, min_time 9.55 ms |
| -------------------------------------- |
| detection num: 6 |
| 0: 90%, [ 747, 224, 1140, 1147], person |
| 0: 89%, [1356, 337, 1622, 1035], person |
| 0: 88%, [ 3, 364, 308, 1094], person |
| 0: 81%, [ 491, 479, 668, 1015], person |
| 32: 78%, [ 777, 887, 827, 942], sports ball |
| 0: 59%, [1840, 690, 1905, 812], person |
| -------------------------------------- |
| ``` |
|
|
| Output image: |
|  |
|
|