Fangming Guo commited on
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,105 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
|
| 7 |
+
base_model:
|
| 8 |
+
- princeton-vl/RAFT-Stereo
|
| 9 |
+
|
| 10 |
+
pipeline_tag: depth-estimation
|
| 11 |
+
|
| 12 |
+
tags:
|
| 13 |
+
- RAFT-Stereo
|
| 14 |
+
- Stereo-Matching
|
| 15 |
+
- Disparity-Estimation
|
| 16 |
+
- Depth-Estimation
|
| 17 |
+
- Computer-Vision
|
| 18 |
+
- 3DV-2021
|
| 19 |
+
- PyTorch
|
| 20 |
+
- Convolutional-GRU
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+
# RAFT-Stereo on Axera NPU
|
| 24 |
+
|
| 25 |
+
This repository contains the [RAFT-Stereo](https://arxiv.org/abs/2109.07547) model converted for high-performance inference on the Axera NPU.
|
| 26 |
+
|
| 27 |
+
This version is optimized with **w8a16** quantization and is compatible with **Pulsar2 version 4.2**.
|
| 28 |
+
|
| 29 |
+
## Convert Tools Links
|
| 30 |
+
|
| 31 |
+
For model conversion and deployment guidance:
|
| 32 |
+
|
| 33 |
+
* [AXera Platform GitHub Repo](https://github.com/AXERA-TECH/RAFT-Stereo.axera): Sample code and optimization guides for Axera NPU.
|
| 34 |
+
* [Pulsar2 Documentation](https://pulsar2-docs.readthedocs.io/en/latest/pulsar2/introduction.html): Guide for converting ONNX models to `.axmodel`.
|
| 35 |
+
|
| 36 |
+
## Support Platforms
|
| 37 |
+
|
| 38 |
+
- **AX650N/AX8850**
|
| 39 |
+
- [M4N-Dock(爱芯派Pro)](https://wiki.sipeed.com/hardware/zh/maixIV/m4ndock/m4ndock.html)
|
| 40 |
+
- [M.2 Accelerator card](https://docs.m5stack.com/en/ai_hardware/LLM-8850_Card)
|
| 41 |
+
- **AX630C**
|
| 42 |
+
- [爱芯派2](https://axera-pi-2-docs-cn.readthedocs.io/zh-cn/latest/index.html)
|
| 43 |
+
- [Module-LLM](https://docs.m5stack.com/zh_CN/module/Module-LLM)
|
| 44 |
+
- [LLM630 Compute Kit](https://docs.m5stack.com/zh_CN/core/LLM630%20Compute%20Kit)
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
| Chips | Model Variant | NPU3 Latency (ms) |
|
| 48 |
+
| --- | --- | --- |
|
| 49 |
+
| AX650 | RAFT-Stereo-Small | TBD |
|
| 50 |
+
|
| 51 |
+
| Chips | Model Variant | NPU2 Latency (ms) |
|
| 52 |
+
| --- | --- | --- |
|
| 53 |
+
| AX630C| RAFT-Stereo-Small | TBD |
|
| 54 |
+
|
| 55 |
+
## How to Use
|
| 56 |
+
|
| 57 |
+
Download the repository and ensure the directory structure is organized as follows:
|
| 58 |
+
|
| 59 |
+
```text
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
### Prerequisites
|
| 65 |
+
|
| 66 |
+
1. **Environment:** Ensure you have the required Python environment activated with the following core packages installed:
|
| 67 |
+
* **NPU Runtime:** [`axengine` (PyAXEngine)](https://github.com/AXERA-TECH/pyaxengine)
|
| 68 |
+
* **Core Libraries:** `numpy`, `opencv-python`, and `matplotlib`.
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
2. **Model/Data:** Ensure the compiled `.axmodel`, and input stereo pairs are available on the host.
|
| 72 |
+
|
| 73 |
+
### Inference Command
|
| 74 |
+
|
| 75 |
+
Run the inference script by providing the compiled model, and input data.
|
| 76 |
+
|
| 77 |
+
```bash
|
| 78 |
+
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
|
| 79 |
+
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
### Inference with AX630C Host
|
| 83 |
+
|
| 84 |
+
### Results
|
| 85 |
+
|
| 86 |
+
The model generates a dense disparity map representing the depth of the scene. Results are saved as colorized depth maps and point cloud projections where applicable.
|
| 87 |
+
|
| 88 |
+
```
|
| 89 |
+
(base) root@ax630c:~/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
|
| 90 |
+
[INFO] Available providers: ['AxEngineExecutionProvider']
|
| 91 |
+
[INFO] Using provider: AxEngineExecutionProvider
|
| 92 |
+
[INFO] Chip type: ChipType.MC20E
|
| 93 |
+
[INFO] VNPU type: VNPUType.DISABLED
|
| 94 |
+
[INFO] Engine version: 2.7.2a
|
| 95 |
+
[INFO] Model type: 1 (full core)
|
| 96 |
+
[INFO] Compiler version: 5.1-patch1-dirty e0fdc66b-dirty
|
| 97 |
+
Saved: output-ax.png
|
| 98 |
+
|
| 99 |
+
```
|
| 100 |
+
|
| 101 |
+
### Example Visualization
|
| 102 |
+
|
| 103 |
+

|
| 104 |
+
|
| 105 |
+
|