File size: 4,921 Bytes
b5aeeeb
 
cd17ce9
b5aeeeb
 
344d4a5
b5aeeeb
cd17ce9
b5aeeeb
 
 
45b2cae
b5aeeeb
 
 
 
 
344d4a5
b5aeeeb
 
 
45b2cae
b5aeeeb
 
 
 
 
 
344d4a5
 
 
 
45b2cae
344d4a5
b5aeeeb
 
45b2cae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b5aeeeb
 
 
 
 
 
 
 
45b2cae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b5aeeeb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
344d4a5
 
b5aeeeb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
344d4a5
 
 
 
45b2cae
344d4a5
 
 
 
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
pipeline_tag: object-detection
---

# QRCode_det

This version of QRCode detetion model 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: 5.1

## Convert tools links:

For those who are interested in model conversion, you can try to export axmodel through 

- [The original repo](https://github.com/wzf19947/QRCode_det), which you can get the detail of guide

- [Pulsar2 Link, How to Convert ONNX to axmodel](https://pulsar2-docs.readthedocs.io/en/latest/pulsar2/introduction.html) 

- [The repo of AXera Platform](https://github.com/AXERA-TECH/ax-samples),which you can learn how to compile the C++ demo

## 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)
- AX637

|Chips|model|cost|
|--|--|--|
||yolov5n|1.73 ms|
||yolov8n|3.64 ms|
||yolov9t|4.75 ms|
|AX650|yolov10n|3.67 ms|
||yolo11n|3.42 ms|
||yolo12n|6.87 ms|
||NanodetPlus|2.16 ms|
||DEIMv2_femto(u16)|3.76 ms|
|||
||yolov5n|5.79 ms|
||yolov8n|9.26 ms|
||yolov9t|11.6 ms|
|AX630C|yolov10n|9.71 ms|
||yolo11n|9.65 ms|
||yolo12n|20.24 ms|
||NanodetPlus|5.93 ms|
|||
||yolov5n|2.11 ms|
||yolov8n|4.04 ms|
||yolov9t|4.91 ms|
|AX637|yolov10n|4.05 ms|
||yolo11n|3.84 ms|
||yolo12n|6.40 ms|
||NanodetPlus|2.38 ms|

## How to use

Download all files from this repository to the device

```

.
β”œβ”€β”€ config.json
β”œβ”€β”€ CPP
β”‚Β Β  β”œβ”€β”€ ax_deimv2_qrcode_batch
β”‚Β Β  β”œβ”€β”€ ax_nanodetplus_qrcode_batch
β”‚Β Β  β”œβ”€β”€ ax_yolov5_qrcode_batch
β”‚Β Β  └── ax_yolov8_qrcode_batch
β”œβ”€β”€ cpp_result.png
β”œβ”€β”€ images
β”‚Β Β  β”œβ”€β”€ qrcode_01.jpg
β”‚Β Β  β”œβ”€β”€ qrcode_02.jpg
β”‚Β Β  β”œβ”€β”€ qrcode_03.jpg
|   β”œβ”€β”€ ...
β”‚Β Β  └── qrcode_55.jpg
β”œβ”€β”€ model
β”‚Β Β  β”œβ”€β”€ AX620E
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ nanodet-plus-m_630_npu1.axmodel
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ yolo11n_630_npu1.axmodel
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ yolo12n_630_npu1.axmodel
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ yolov10n_630_npu1.axmodel
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ yolov5n_630_npu1.axmodel
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ yolov8n_630_npu1.axmodel
β”‚Β Β  β”‚Β Β  └── yolov9t_630_npu1.axmodel
β”‚Β Β  β”œβ”€β”€ AX637
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ nanodet-plus-m_637_npu1.axmodel
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ yolo11n_637_npu1.axmodel
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ yolo12n_637_npu1.axmodel
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ yolov10n_637_npu1.axmodel
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ yolov5n_637_npu1.axmodel
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ yolov8n_637_npu1.axmodel
β”‚Β Β  β”‚Β Β  └── yolov9t_637_npu1.axmodel
β”‚Β Β  └── AX650
β”‚Β Β      β”œβ”€β”€ deimv2_femto_650_npu1_u16.axmodel
β”‚Β Β      β”œβ”€β”€ nanodet-plus-m_650_npu1.axmodel
β”‚Β Β      β”œβ”€β”€ yolo11n_650_npu1.axmodel
β”‚Β Β      β”œβ”€β”€ yolo12n_650_npu1.axmodel
β”‚Β Β      β”œβ”€β”€ yolov10n_650_npu1.axmodel
β”‚Β Β      β”œβ”€β”€ yolov5n_650_npu1.axmodel
β”‚Β Β      β”œβ”€β”€ yolov8n_650_npu1.axmodel
β”‚Β Β      └── yolov9t_650_npu1.axmodel
β”œβ”€β”€ py_result.png
β”œβ”€β”€ python
β”‚Β Β  β”œβ”€β”€ QRCode_axmodel_infer_DEIMv2.py
β”‚Β Β  β”œβ”€β”€ QRCode_axmodel_infer_Nanodet.py
β”‚Β Β  β”œβ”€β”€ QRCode_axmodel_infer_v5.py
β”‚Β Β  β”œβ”€β”€ QRCode_axmodel_infer_v8.py
β”‚Β Β  β”œβ”€β”€ QRCode_onnx_infer_DEIMv2.py
β”‚Β Β  β”œβ”€β”€ QRCode_onnx_infer_Nanodet.py
β”‚Β Β  β”œβ”€β”€ QRCode_onnx_infer_v5.py
β”‚Β Β  β”œβ”€β”€ QRCode_onnx_infer_v8.py
β”‚Β Β  └── requirements.txt
└── README.md


```

### Inference

Input Data:

```
|-- images
|   `-- qrcode_01.jpg
|   `-- qrcode_02.jpg
|   `-- qrcode_03.jpg
|   `-- qrcode_04.jpg...
```


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

##### Python
run with python3 QRCode_axmodel_infer_xxx.py
```
root@ax650:~/QRCode# python3 QRCode_axmodel_infer_DEIMv2.py
[INFO] Available providers:  ['AxEngineExecutionProvider']
[INFO] Using provider: AxEngineExecutionProvider
[INFO] Chip type: ChipType.MC50
[INFO] VNPU type: VNPUType.DISABLED
[INFO] Engine version: 2.12.0s
[INFO] Model type: 2 (triple core)
[INFO] Compiler version: 4.2 b98901c3
θ―†εˆ«ζˆεŠŸοΌ
图片 ./qrcode_test/qrcode_01.jpg 倄理耗既: 0.2165 η§’
θ―†εˆ«ζˆεŠŸοΌ
图片 ./qrcode_test/qrcode_02.jpg 倄理耗既: 0.1540 η§’
θ―†εˆ«ζˆεŠŸοΌ
图片 ./qrcode_test/qrcode_03.jpg 倄理耗既: 0.1456 η§’
θ―†εˆ«ζˆεŠŸοΌ
图片 ./qrcode_test/qrcode_05.jpg 倄理耗既: 0.1449 η§’

```

Output:
![alt text](py_result.png)

##### C++
```
./ax_xxx_qrcode_batch -m xxx_npu1.axmodel -i images/
```

Output:
![alt text](cpp_result.png)