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+
This version of MixFormerV2 has been converted to run on the Axera NPU using **w8a16** quantization.
|
| 14 |
+
|
| 15 |
+
This model has been optimized with the following LoRA:
|
| 16 |
+
|
| 17 |
+
Compatible with Pulsar2 version: 3.4
|
| 18 |
+
|
| 19 |
+
## Convert tools links:
|
| 20 |
+
|
| 21 |
+
For those who are interested in model conversion, you can try to export axmodel through
|
| 22 |
+
|
| 23 |
+
- [The repo of original](https://github.com/MCG-NJU/MixFormerV2)
|
| 24 |
+
|
| 25 |
+
- [The repo of AXera Platform](https://github.com/Jordan-5i/ax650_mixformer2_demo), which you can get the detial of guide
|
| 26 |
+
|
| 27 |
+
- [Pulsar2 Link, How to Convert ONNX to axmodel](https://pulsar2-docs.readthedocs.io/en/latest/pulsar2/introduction.html)
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
## Support Platform
|
| 31 |
+
|
| 32 |
+
- AX650
|
| 33 |
+
- [M4N-Dock(爱芯派Pro)](https://wiki.sipeed.com/hardware/zh/maixIV/m4ndock/m4ndock.html)
|
| 34 |
+
- [M.2 Accelerator card](https://axcl-docs.readthedocs.io/zh-cn/latest/doc_guide_hardware.html)
|
| 35 |
+
- AX630C(todo, convert model failed, try to fix......)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
|Chips|npu1(6TOPs)|npu3(18TOPs)|
|
| 39 |
+
|--|--|--|
|
| 40 |
+
|AX650| 11 ms | TBD |
|
| 41 |
+
|
| 42 |
+
## How to use
|
| 43 |
+
|
| 44 |
+
Download all files from this repository to the device
|
| 45 |
+
|
| 46 |
+
```
|
| 47 |
+
root@ax650:/mnt/qtang/ax650_mixformer2_demo# tree -L 1
|
| 48 |
+
.
|
| 49 |
+
├── README.md
|
| 50 |
+
├── ax650
|
| 51 |
+
├── car.avi
|
| 52 |
+
├── config.json
|
| 53 |
+
├── onnx
|
| 54 |
+
├── run_mixformer2_axmodel.py
|
| 55 |
+
└── run_mixformer2_onnx.py
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
### python env requirement
|
| 59 |
+
|
| 60 |
+
#### pyaxengine
|
| 61 |
+
|
| 62 |
+
https://github.com/AXERA-TECH/pyaxengine
|
| 63 |
+
|
| 64 |
+
```
|
| 65 |
+
wget https://github.com/AXERA-TECH/pyaxengine/releases/download/0.1.1rc0/axengine-0.1.1-py3-none-any.whl
|
| 66 |
+
pip install axengine-0.1.1-py3-none-any.whl
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
#### others
|
| 70 |
+
|
| 71 |
+
```
|
| 72 |
+
pip install argparse numpy opencv-python glob2
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
#### Inference with AX650 Host, such as M4N-Dock(爱芯派Pro)
|
| 76 |
+
|
| 77 |
+
```
|
| 78 |
+
root@ax650:/mnt/qtang/ax650_mixformer2_demo# python3 run_mixformer2_axmodel.py --model-path ax650/mixformer_v2.axmodel --frame-path car.avi -r 10
|
| 79 |
+
[INFO] Available providers: ['AxEngineExecutionProvider']
|
| 80 |
+
[INFO] Using provider: AxEngineExecutionProvider
|
| 81 |
+
[INFO] Chip type: ChipType.MC50
|
| 82 |
+
[INFO] VNPU type: VNPUType.DISABLED
|
| 83 |
+
[INFO] Engine version: 2.7.2a
|
| 84 |
+
[INFO] Model type: 0 (single core)
|
| 85 |
+
[INFO] Compiler version: 3.4-dirty 4ff37520-dirty
|
| 86 |
+
====================type================= [1079, 482] <class 'list'> <class 'list'>
|
| 87 |
+
第一帧初始化完毕!
|
| 88 |
+
Video: tracking 246.0fps
|
| 89 |
+
Video: tracking 4.0fps
|
| 90 |
+
Video: tracking 4.0fps
|
| 91 |
+
Video: tracking 4.0fps
|
| 92 |
+
Video: tracking 4.0fps
|
| 93 |
+
Video: tracking 4.0fps
|
| 94 |
+
Video: tracking 4.0fps
|
| 95 |
+
Video: tracking 4.0fps
|
| 96 |
+
Video: tracking 4.0fps
|
| 97 |
+
Video: tracking 4.0fps
|
| 98 |
+
Video: tracking 4.0fps
|
| 99 |
+
Reached the maximum number of frames (10). Exiting loop.
|
| 100 |
+
video: average finale average tracking fps 31.8 fps
|
| 101 |
+
root@ax650:/mnt/qtang/ax650_mixformer2_demo#
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
#### Inference with M.2 Accelerator card
|
| 105 |
+
|
| 106 |
+
[What is M.2 Accelerator card?](https://axcl-docs.readthedocs.io/zh-cn/latest/doc_guide_hardware.html), Show this DEMO based on Raspberry PI 5.
|
| 107 |
+
|
| 108 |
+
```
|
| 109 |
+
(axcl) axera@raspberrypi:~/samples/MixFormerV2 $ python3 run_mixformer2_axmodel.py --model-path ax650/mixformer_v2.axmodel --frame-path car.avi -r 10
|
| 110 |
+
[INFO] Available providers: ['AXCLRTExecutionProvider']
|
| 111 |
+
[INFO] Using provider: AXCLRTExecutionProvider
|
| 112 |
+
[INFO] SOC Name: AX650N
|
| 113 |
+
[INFO] VNPU type: VNPUType.DISABLED
|
| 114 |
+
[INFO] Compiler version: 3.4-dirty 4ff37520-dirty
|
| 115 |
+
====================type================= [1079, 482] <class 'list'> <class 'list'>
|
| 116 |
+
第一帧初始化完毕!
|
| 117 |
+
Video: tracking 925.0fps
|
| 118 |
+
Video: tracking 12.0fps
|
| 119 |
+
Video: tracking 12.0fps
|
| 120 |
+
Video: tracking 11.0fps
|
| 121 |
+
Video: tracking 11.0fps
|
| 122 |
+
Video: tracking 11.0fps
|
| 123 |
+
Video: tracking 11.0fps
|
| 124 |
+
Video: tracking 11.0fps
|
| 125 |
+
Video: tracking 10.0fps
|
| 126 |
+
Video: tracking 10.0fps
|
| 127 |
+
Video: tracking 10.0fps
|
| 128 |
+
Reached the maximum number of frames (10). Exiting loop.
|
| 129 |
+
video: average finale average tracking fps 114.9 fps
|
| 130 |
+
(axcl) axera@raspberrypi:~/samples/MixFormerV2 $
|
| 131 |
+
```
|