This repository contains the
RAFT-Stereo model converted for high-performance inference on the Axera NPU.
Download the repository and ensure the directory structure is organized as follows:
1├── ax630c
2│ ├── raft_steoro256x640_r1.onnx
3│ ├── raft_steoro256x640_r1_npu2.axmodel
4│ ├── raft_steoro256x640_r4.onnx
5│ └── raft_steoro256x640_r4_npu2.axmodel
6├── ax650
7│ ├── raft_steoro256x640_r1.axmodel
8│ ├── raft_steoro256x640_r1.onnx
9│ ├── raft_steoro384x1280_r4.axmodel
10│ └── raft_steoro384x1280_r4.onnx
11├── ax637
12│ ├── raft_steoro256x640_r1_npu1.axmodel
13│ └── raft_steoro256x640_r4_npu1.axmodel
14├── examples
15│ ├── left
16│ │ ├── 000051_11.png
17│ │ ├── 000058_11.png
18│ │ ├── 000059_10.png
19│ │ ├── 000121_10.png
20│ │ ├── 000164_10.png
21│ │ ├── 000167_11.png
22│ │ ├── 000172_11.png
23│ │ ├── 000179_10.png
24│ │ ├── 000193_10.png
25│ │ └── 000195_10.png
26│ └── right
27│ ├── 000051_11.png
28│ ├── 000058_11.png
29│ ├── 000059_10.png
30│ ├── 000121_10.png
31│ ├── 000164_10.png
32│ ├── 000167_11.png
33│ ├── 000172_11.png
34│ ├── 000179_10.png
35│ ├── 000193_10.png
36│ └── 000195_10.png
37├── infer.py
38└── infer_onnx.py
Run the inference script by providing the compiled model, and input data.
1python3 infer.py --left examples/left/000051_11.png --right examples/right/000051_11.png --model raft_steoro256x640_r1_npu2.axmodel --width 640 --height 256
2
The model generates a dense disparity map representing the depth of the scene.
(base) root@ax630c:~/data# /python3 infer.py --left examples/left/000051_11.png --right examples/right/000051_11.png --model raft_steoro256x640_r4_npu2.axmodel --width 640 --height 256
[INFO] Available providers: ['AxEngineExecutionProvider']
[INFO] Using provider: AxEngineExecutionProvider
[INFO] Chip type: ChipType.MC20E
[INFO] VNPU type: VNPUType.DISABLED
[INFO] Engine version: 2.7.2a
[INFO] Model type: 1 (full core)
[INFO] Compiler version: 5.1-patch1-dirty e0fdc66b-dirty
Saved: output-ax.png