File size: 4,719 Bytes
1e74882
9333830
 
 
 
 
 
 
 
 
1e74882
 
9333830
1e74882
9333830
 
 
 
 
 
 
 
 
 
300f7e8
 
 
9333830
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
300f7e8
9333830
300f7e8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9333830
 
 
 
 
 
 
 
 
 
300f7e8
9333830
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
300f7e8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
---
license: mit
language:
- en
base_model:
- Ultralytics/YOLO11
pipeline_tag: object-detection
tags:
- Ultralytics
- YOLO11
---

# YOLO11

This version of YOLO11 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_yolo11`

- [The repo of axcl-samples](https://github.com/AXERA-TECH/axcl-samples), which you can get the how to build the `axcl_yolo11`

- [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| 25 ms |
|AX630C| TBD ms |

## How to use

Download all files from this repository to the device

```
(axcl) axera@raspberrypi:~/samples/AXERA-TECH/YOLO11 $ tree -L 2
.
β”œβ”€β”€ ax620e
β”‚Β Β  └── yolo11s.axmodel.onnx
β”œβ”€β”€ ax650
β”‚Β Β  β”œβ”€β”€ yolo11s.axmodel
β”‚Β Β  └── yolo11x.axmodel
β”œβ”€β”€ ax_aarch64
β”‚Β Β  └── ax_yolo11
β”œβ”€β”€ axcl_aarch64
β”‚Β Β  └── axcl_yolo11
β”œβ”€β”€ axcl_x86_64
β”‚Β Β  └── axcl_yolo11
β”œβ”€β”€ config.json
β”œβ”€β”€ cut-onnx.py
β”œβ”€β”€ football.jpg
β”œβ”€β”€ README.md
β”œβ”€β”€ ssd_horse.jpg
β”œβ”€β”€ yolo11_config.json
β”œβ”€β”€ yolo11_out.jpg
β”œβ”€β”€ yolo11s-cut.onnx
└── yolo11-test.py

6 directories, 15 files

```

### Inference

Input image:
![](./football.jpg)

#### Inference with AX650 Host, such as M4N-Dock(爱芯派Pro)

```
root@ax650:~/samples/AXERA-TECH/YOLO11# ./ax_aarch64/ax_yolo11 -m ax650/yolo11x.axmodel -i football.jpg
--------------------------------------
model file : ax650/yolo11x.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:4.20 ms
--------------------------------------
Repeat 1 times, avg time 24.56 ms, max_time 24.56 ms, min_time 24.56 ms
--------------------------------------
detection num: 9
 0:  94%, [ 757,  220, 1127, 1154], person
 0:  94%, [   0,  357,  314, 1112], person
 0:  93%, [1353,  339, 1629, 1037], person
 0:  91%, [ 494,  476,  659, 1001], person
32:  86%, [1231,  877, 1281,  922], sports ball
32:  73%, [ 774,  887,  828,  938], sports ball
32:  66%, [1012,  882, 1051,  927], sports ball
 0:  54%, [   0,  543,   83, 1000], person
 0:  46%, [1837,  696, 1877,  814], person
--------------------------------------
```

Output image:
![](./yolo11_out.jpg)


#### Inference with M.2 Accelerator card

```
(axcl) axera@raspberrypi:~/samples/AXERA-TECH/YOLO11 $ ./axcl_aarch64/axcl_yolo11 -m ax650/yolo11x.axmodel -i football.jpg
--------------------------------------
model file : ax650/yolo11x.axmodel
image file : football.jpg
img_h, img_w : 640 640
--------------------------------------
axclrtEngineCreateContextt is done.
axclrtEngineGetIOInfo is done.

grpid: 0

input size: 1
    name:   images
        1 x 640 x 640 x 3


output size: 3
    name: /model.23/Concat_output_0
        1 x 80 x 80 x 144

    name: /model.23/Concat_1_output_0
        1 x 40 x 40 x 144

    name: /model.23/Concat_2_output_0
        1 x 20 x 20 x 144

==================================================

Engine push input is done.
--------------------------------------
post process cost time:1.38 ms
--------------------------------------
Repeat 1 times, avg time 24.73 ms, max_time 24.73 ms, min_time 24.73 ms
--------------------------------------
detection num: 9
 0:  94%, [ 757,  220, 1127, 1154], person
 0:  94%, [   0,  357,  314, 1112], person
 0:  93%, [1353,  339, 1629, 1037], person
 0:  91%, [ 494,  476,  659, 1001], person
32:  86%, [1231,  877, 1281,  922], sports ball
32:  73%, [ 774,  887,  828,  938], sports ball
32:  66%, [1012,  882, 1051,  927], sports ball
 0:  54%, [   0,  543,   83, 1000], person
 0:  46%, [1837,  696, 1877,  814], person
--------------------------------------

```