File size: 3,901 Bytes
4e210f4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6ee1234
4e210f4
 
 
 
 
 
 
 
 
 
 
 
 
186e6a8
4e210f4
6ee1234
 
 
4e210f4
 
 
6ee1234
 
 
 
 
 
d0a249b
 
 
 
 
063c037
4e210f4
 
 
 
 
248c766
4e210f4
 
 
 
 
 
 
 
d0a249b
6ee1234
4e210f4
 
 
 
 
 
d0a249b
 
 
 
 
 
 
 
 
 
 
 
 
 
4e210f4
 
cd74360
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
---
license: mit
language:
- en
base_model:
- tianweiy/CenterPoint
pipeline_tag: object-detection
tags:
- Axera
- NPU
- Pulsar2
- CenterPoint
- 3D-Object-Detection
- LiDAR
---

# CenterPoint on Axera NPU

This repository contains the [CenterPoint](https://arxiv.org/abs/2006.11275) model converted for high-performance inference on the Axera NPU. CenterPoint is a center-based framework for 3D object detection and tracking that represents objects as points, significantly simplifying the detection pipeline on LiDAR point clouds.

This version is optimized with **w8a16** quantization and is compatible with **Pulsar2 version 4.2**.

## Convert Tools Links

For model conversion and deployment guidance:
- [AXera Platform GitHub Repo](https://github.com/AXERA-TECH/centerpoint.axera): Sample code and optimization guides for Axera NPU.
- [Pulsar2 Documentation](https://pulsar2-docs.readthedocs.io/en/latest/pulsar2/introduction.html): Guide for converting ONNX models to `.axmodel`.

## Support Platforms

- **AX650**
  - [M4N-Dock (爱芯派Pro)](https://wiki.sipeed.com/hardware/zh/maixIV/m4ndock/m4ndock.html)
  - [M.2 Accelerator card](https://docs.m5stack.com/zh_CN/ai_hardware/LLM-8850_Card)

| Chips | Model Variant  | NPU3 Latency (ms) |
|---|---|---|
| AX650 | CenterPoint-Pillar |  88.334 |

## How to Use

Download the repository and ensure the directory structure is organized as follows:

```text
.
β”œβ”€β”€ centerpoint.axmodel       # The compiled Axera model
β”œβ”€β”€ inference_axmodel.py      # Main inference script
└── extracted_data/           # Input directory
    β”œβ”€β”€ config.json           # Configuration files (e.g., inference_config.json)
    β”œβ”€β”€ sample_index.json
    β”œβ”€β”€ gt_annotations/
    └── points/                 
```

### Prerequisites

1.  **Environment:** Ensure you have the required Python environment activated with the following core packages installed:
    * **NPU Runtime:** `axengine` (PyAXEngine)
    * **Core Libraries:** `numba` , `opencv-python` and `tqdm`.

2.  **Model/Data:** Ensure the compiled `.axmodel`, `inference_config.json`, and input data (`inference_data/`) are available on the host.

### Inference Command

Run the inference script by providing the compiled model, configuration, and data directory.

```bash
python inference_axmodel.py ./centerpoint.axmodel ./extracted_data/config.json ./extracted_data --output-dir ./inference_results --visualize --num-samples 50 --score-thr 0.5

```

### Inference with AX650 Host

### Results
The model generates a 3D detection map with bounding boxes oriented in 3D space. Results are saved as images and videos which visualize the ego-vehicle, point cloud data, and detected objects.
```
(ax_env) root@ax650:~/data# python inference_axmodel.py ./centerpoint.axmodel ./extracted_data/config.json ./extracted_data --output-dir ./inference_results --visualize --num-samples 50 --score-thr 0.5
[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: 5.1-patch1 ed388aa0
Processing 50 samples...
Inference: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 50/50 [00:47<00:00,  1.06it/s]
Creating video: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 50/50 [00:02<00:00, 23.32it/s]
Done! 50 frames, 12836 detections, saved to ./inference_results
```

### Example Visualization
![CenterPoint Detection Result GIF](output.gif)