Commit
·
aff6a3d
1
Parent(s):
529786c
add yolov5-seg and ax650 example
Browse files- README.md +103 -0
- ax650/yolov5s-seg.axmodel +3 -0
- ax_aarch64/ax_yolov5s_seg +3 -0
- config.json +0 -0
- football.jpg +3 -0
- yolov5_seg_config.json +45 -0
- yolov5s-seg-cut.onnx +3 -0
- yolov5s-seg.onnx +3 -0
- yolov5s_seg_out.jpg +3 -0
README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
pipeline_tag: object-detection
|
| 6 |
+
tags:
|
| 7 |
+
- Ultralytics
|
| 8 |
+
- YOLOv5
|
| 9 |
+
- YOLOv5-Seg
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# YOLOv5
|
| 13 |
+
|
| 14 |
+
This version of YOLOv5 has been converted to run on the Axera NPU using **w8a16** quantization.
|
| 15 |
+
|
| 16 |
+
This model has been optimized with the following LoRA:
|
| 17 |
+
|
| 18 |
+
Compatible with Pulsar2 version: 3.4
|
| 19 |
+
|
| 20 |
+
## Convert tools links:
|
| 21 |
+
|
| 22 |
+
For those who are interested in model conversion, you can try to export axmodel through
|
| 23 |
+
|
| 24 |
+
- [The repo of ax-samples](https://github.com/AXERA-TECH/ax-samples), which you can get the how to build the `ax_yolov5s_seg`
|
| 25 |
+
|
| 26 |
+
- [The repo of axcl-samples](https://github.com/AXERA-TECH/axcl-samples), which you can get the how to build the `axcl_yolov5s_seg`
|
| 27 |
+
|
| 28 |
+
- [Pulsar2 Link, How to Convert ONNX to axmodel](https://pulsar2-docs.readthedocs.io/en/latest/pulsar2/introduction.html)
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
## Support Platform
|
| 32 |
+
|
| 33 |
+
- AX650
|
| 34 |
+
- [M4N-Dock(爱芯派Pro)](https://wiki.sipeed.com/hardware/zh/maixIV/m4ndock/m4ndock.html)
|
| 35 |
+
- [M.2 Accelerator card](https://axcl-docs.readthedocs.io/zh-cn/latest/doc_guide_hardware.html)
|
| 36 |
+
- AX630C
|
| 37 |
+
- [爱芯派2](https://axera-pi-2-docs-cn.readthedocs.io/zh-cn/latest/index.html)
|
| 38 |
+
- [Module-LLM](https://docs.m5stack.com/zh_CN/module/Module-LLM)
|
| 39 |
+
- [LLM630 Compute Kit](https://docs.m5stack.com/zh_CN/core/LLM630%20Compute%20Kit)
|
| 40 |
+
|
| 41 |
+
|Chips|cost|
|
| 42 |
+
|--|--|
|
| 43 |
+
|AX650| 9.55 ms |
|
| 44 |
+
|AX630C| TBD ms |
|
| 45 |
+
|
| 46 |
+
## How to use
|
| 47 |
+
|
| 48 |
+
Download all files from this repository to the device
|
| 49 |
+
|
| 50 |
+
```
|
| 51 |
+
root@ax650 ~/yolov5-seg # tree -L 2
|
| 52 |
+
.
|
| 53 |
+
├── ax650
|
| 54 |
+
│ └── yolov5s-seg.axmodel
|
| 55 |
+
├── ax_aarch64
|
| 56 |
+
│ └── ax_yolov5s_seg
|
| 57 |
+
├── config.json
|
| 58 |
+
├── football.jpg
|
| 59 |
+
├── README.md
|
| 60 |
+
├── yolov5_seg_config.json
|
| 61 |
+
├── yolov5s-seg-cut.onnx
|
| 62 |
+
├── yolov5s-seg.onnx
|
| 63 |
+
└── yolov5s_seg_out.jpg
|
| 64 |
+
|
| 65 |
+
3 directories, 10 files
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
### Inference
|
| 69 |
+
|
| 70 |
+
Input image:
|
| 71 |
+

|
| 72 |
+
|
| 73 |
+
#### Inference with AX650 Host, such as M4N-Dock(爱芯派Pro)
|
| 74 |
+
|
| 75 |
+
```
|
| 76 |
+
root@ax650 ~/yolov5-seg # ./ax_yolov5s_seg -m yolov5s-seg.axmodel -i football.jpg
|
| 77 |
+
--------------------------------------
|
| 78 |
+
model file : yolov5s-seg.axmodel
|
| 79 |
+
image file : football.jpg
|
| 80 |
+
img_h, img_w : 640 640
|
| 81 |
+
--------------------------------------
|
| 82 |
+
Engine creating handle is done.
|
| 83 |
+
Engine creating context is done.
|
| 84 |
+
Engine get io info is done.
|
| 85 |
+
Engine alloc io is done.
|
| 86 |
+
Engine push input is done.
|
| 87 |
+
--------------------------------------
|
| 88 |
+
post process cost time:9.19 ms
|
| 89 |
+
--------------------------------------
|
| 90 |
+
Repeat 1 times, avg time 9.55 ms, max_time 9.55 ms, min_time 9.55 ms
|
| 91 |
+
--------------------------------------
|
| 92 |
+
detection num: 6
|
| 93 |
+
0: 90%, [ 747, 224, 1140, 1147], person
|
| 94 |
+
0: 89%, [1356, 337, 1622, 1035], person
|
| 95 |
+
0: 88%, [ 3, 364, 308, 1094], person
|
| 96 |
+
0: 81%, [ 491, 479, 668, 1015], person
|
| 97 |
+
32: 78%, [ 777, 887, 827, 942], sports ball
|
| 98 |
+
0: 59%, [1840, 690, 1905, 812], person
|
| 99 |
+
--------------------------------------
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
Output image:
|
| 103 |
+

|
ax650/yolov5s-seg.axmodel
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c76e0b975b20532d27ab001701d6048d99879b2770ee5833337cf49760668ed0
|
| 3 |
+
size 8153338
|
ax_aarch64/ax_yolov5s_seg
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ad56305f3b6481dccba9f788775357b9917c3870798891c0cd5d20e628016207
|
| 3 |
+
size 5470728
|
config.json
ADDED
|
File without changes
|
football.jpg
ADDED
|
Git LFS Details
|
yolov5_seg_config.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "ONNX",
|
| 3 |
+
"npu_mode": "NPU1",
|
| 4 |
+
"quant": {
|
| 5 |
+
"input_configs": [
|
| 6 |
+
{
|
| 7 |
+
"tensor_name": "images",
|
| 8 |
+
"calibration_dataset": "coco_1000.tar",
|
| 9 |
+
"calibration_size": 64,
|
| 10 |
+
"calibration_mean": [0, 0, 0],
|
| 11 |
+
"calibration_std": [255.0, 255.0, 255.0]
|
| 12 |
+
}
|
| 13 |
+
],
|
| 14 |
+
"calibration_method": "MinMax",
|
| 15 |
+
"precision_analysis": true,
|
| 16 |
+
"precision_analysis_method":"EndToEnd"
|
| 17 |
+
},
|
| 18 |
+
"input_processors": [
|
| 19 |
+
{
|
| 20 |
+
"tensor_name": "images",
|
| 21 |
+
"tensor_format": "RGB",
|
| 22 |
+
"src_format": "BGR",
|
| 23 |
+
"src_dtype": "U8",
|
| 24 |
+
"src_layout": "NHWC"
|
| 25 |
+
}
|
| 26 |
+
],
|
| 27 |
+
"output_processors": [
|
| 28 |
+
{
|
| 29 |
+
"tensor_name": "output1",
|
| 30 |
+
"dst_perm": [0, 1, 2, 3]
|
| 31 |
+
}, {
|
| 32 |
+
"tensor_name": "/model.24/m.0/Conv_output_0",
|
| 33 |
+
"dst_perm": [0, 2, 3, 1]
|
| 34 |
+
}, {
|
| 35 |
+
"tensor_name": "/model.24/m.1/Conv_output_0",
|
| 36 |
+
"dst_perm": [0, 2, 3, 1]
|
| 37 |
+
}, {
|
| 38 |
+
"tensor_name": "/model.24/m.2/Conv_output_0",
|
| 39 |
+
"dst_perm": [0, 2, 3, 1]
|
| 40 |
+
}
|
| 41 |
+
],
|
| 42 |
+
"compiler": {
|
| 43 |
+
"check": 2
|
| 44 |
+
}
|
| 45 |
+
}
|
yolov5s-seg-cut.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:67388c825901ea1152c7d3c0f6e58ee98d669affd6915ed672e7746bea190cc7
|
| 3 |
+
size 30498589
|
yolov5s-seg.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:461550a45b98bf92217159da517dc5e6960a8f7e4cb48af78882dc0947f54931
|
| 3 |
+
size 30927614
|
yolov5s_seg_out.jpg
ADDED
|
Git LFS Details
|