RAFT-Stereo: Multilevel Recurrent Field Transforms for Stereo Matching
Paper
β’
2109.07547
β’
Published
This repository contains the RAFT-Stereo model converted for high-performance inference on the Axera NPU.
This version is optimized with w8a16 quantization and is compatible with Pulsar2 version 4.2.
For model conversion and deployment guidance:
.axmodel.| Chips | Model Variant | Latency (ms) |
|---|---|---|
| AX650 | raft_steoro256x640_r1.axmodel | 20.9 |
| AX650 | raft_steoro256x640_r4.axmodel | 111.8 |
| Chips | Model Variant | Latency (ms) |
|---|---|---|
| AX630C | raft_steoro256x640_r1_npu2.axmodel | 317.765 |
| AX630C | raft_steoro256x640_r4_npu2.axmodel | 825.793 |
| Chips | Model Variant | Latency (ms) |
|---|---|---|
| AX637 | raft_steoro256x640_r1_npu1.axmodel | 61.033 |
| AX637 | raft_steoro256x640_r4_npu1.axmodel | 99.094 |
Download the repository and ensure the directory structure is organized as follows:
βββ ax630c
β βββ raft_steoro256x640_r1.onnx
β βββ raft_steoro256x640_r1_npu2.axmodel
β βββ raft_steoro256x640_r4.onnx
β βββ raft_steoro256x640_r4_npu2.axmodel
βββ ax650
β βββ raft_steoro256x640_r1.axmodel
β βββ raft_steoro256x640_r1.onnx
β βββ raft_steoro384x1280_r4.axmodel
β βββ raft_steoro384x1280_r4.onnx
βββ ax637
β βββ raft_steoro256x640_r1_npu1.axmodel
β βββ raft_steoro256x640_r4_npu1.axmodel
βββ examples
β βββ left
β β βββ 000051_11.png
β β βββ 000058_11.png
β β βββ 000059_10.png
β β βββ 000121_10.png
β β βββ 000164_10.png
β β βββ 000167_11.png
β β βββ 000172_11.png
β β βββ 000179_10.png
β β βββ 000193_10.png
β β βββ 000195_10.png
β βββ right
β βββ 000051_11.png
β βββ 000058_11.png
β βββ 000059_10.png
β βββ 000121_10.png
β βββ 000164_10.png
β βββ 000167_11.png
β βββ 000172_11.png
β βββ 000179_10.png
β βββ 000193_10.png
β βββ 000195_10.png
βββ infer.py
βββ infer_onnx.py
axengine (PyAXEngine)numpy, opencv-python, and matplotlib..axmodel, and input stereo pairs are available on the host.Run the inference script by providing the compiled model, and input data.
python3 infer.py --left examples/left/000051_11.png --right examples/right/000051_11.png --model raft_steoro256x640_r1_npu2.axmodel --width 640 --height 256
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