qaihm-bot commited on
Commit
09a3443
·
verified ·
1 Parent(s): 442b90c

See https://github.com/quic/ai-hub-models/releases/v0.45.0 for changelog.

.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ CenterPoint_float.dlc filter=lfs diff=lfs merge=lfs -text
CenterPoint_float.dlc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6ec0e2b5a5e7e24c9b83552dcb8cf6d406411d6d7751307de4842cb6226436bb
3
+ size 556091396
CenterPoint_float.tflite ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ad980ff470015d96fa0cff95e2ae1ae7001a0a85a1e45e22fdcb4879bf0b3b18
3
+ size 555160184
LICENSE ADDED
@@ -0,0 +1 @@
 
 
1
+ The license of the original trained model can be found at https://github.com/tianweiy/CenterPoint/blob/master/LICENSE.
README.md ADDED
@@ -0,0 +1,233 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: pytorch
3
+ license: other
4
+ tags:
5
+ - android
6
+ pipeline_tag: other
7
+
8
+ ---
9
+
10
+ ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/centerpoint/web-assets/model_demo.png)
11
+
12
+ # CenterPoint: Optimized for Mobile Deployment
13
+ ## 3D object detection model optimized for LiDAR-based autonomous driving scenarios
14
+
15
+ CenterPoint is a LiDAR-based 3D object detection model that detects objects by predicting their centers and regressing other attributes. It is designed for high accuracy and real-time performance in autonomous driving applications.
16
+
17
+ This repository provides scripts to run CenterPoint on Qualcomm® devices.
18
+ More details on model performance across various devices, can be found
19
+ [here](https://aihub.qualcomm.com/models/centerpoint).
20
+
21
+
22
+
23
+ ### Model Details
24
+
25
+ - **Model Type:** Model_use_case.driver_assistance
26
+ - **Model Stats:**
27
+ - Model checkpoint: PointPillars
28
+ - Input resolution: 5x20x5, 5x4, 5
29
+ - Number of parameters: 21.8M
30
+ - Model size: 83.3 MB
31
+
32
+ | Model | Precision | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit | Target Model
33
+ |---|---|---|---|---|---|---|---|---|
34
+ | CenterPoint | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | TFLITE | 6306.256 ms | 2606 - 2614 MB | CPU | [CenterPoint.tflite](https://huggingface.co/qualcomm/CenterPoint/blob/main/CenterPoint.tflite) |
35
+ | CenterPoint | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | QNN_DLC | 903.929 ms | 1 - 477 MB | NPU | [CenterPoint.dlc](https://huggingface.co/qualcomm/CenterPoint/blob/main/CenterPoint.dlc) |
36
+ | CenterPoint | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | TFLITE | 5789.615 ms | 2624 - 2634 MB | CPU | [CenterPoint.tflite](https://huggingface.co/qualcomm/CenterPoint/blob/main/CenterPoint.tflite) |
37
+ | CenterPoint | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | QNN_DLC | 506.619 ms | 2 - 1017 MB | NPU | [CenterPoint.dlc](https://huggingface.co/qualcomm/CenterPoint/blob/main/CenterPoint.dlc) |
38
+ | CenterPoint | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | TFLITE | 5637.13 ms | 2590 - 2592 MB | CPU | [CenterPoint.tflite](https://huggingface.co/qualcomm/CenterPoint/blob/main/CenterPoint.tflite) |
39
+ | CenterPoint | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | QNN_DLC | 316.182 ms | 2 - 651 MB | NPU | [CenterPoint.dlc](https://huggingface.co/qualcomm/CenterPoint/blob/main/CenterPoint.dlc) |
40
+ | CenterPoint | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | TFLITE | 5477.555 ms | 2605 - 2613 MB | CPU | [CenterPoint.tflite](https://huggingface.co/qualcomm/CenterPoint/blob/main/CenterPoint.tflite) |
41
+ | CenterPoint | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | QNN_DLC | 380.61 ms | 1 - 711 MB | NPU | [CenterPoint.dlc](https://huggingface.co/qualcomm/CenterPoint/blob/main/CenterPoint.dlc) |
42
+ | CenterPoint | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | TFLITE | 3950.172 ms | 2619 - 2628 MB | CPU | [CenterPoint.tflite](https://huggingface.co/qualcomm/CenterPoint/blob/main/CenterPoint.tflite) |
43
+ | CenterPoint | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | QNN_DLC | 240.189 ms | 2 - 827 MB | NPU | [CenterPoint.dlc](https://huggingface.co/qualcomm/CenterPoint/blob/main/CenterPoint.dlc) |
44
+ | CenterPoint | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | TFLITE | 3094.501 ms | 2611 - 2620 MB | CPU | [CenterPoint.tflite](https://huggingface.co/qualcomm/CenterPoint/blob/main/CenterPoint.tflite) |
45
+ | CenterPoint | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | QNN_DLC | 202.993 ms | 0 - 447 MB | NPU | [CenterPoint.dlc](https://huggingface.co/qualcomm/CenterPoint/blob/main/CenterPoint.dlc) |
46
+ | CenterPoint | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | TFLITE | 2584.068 ms | 2583 - 2593 MB | CPU | [CenterPoint.tflite](https://huggingface.co/qualcomm/CenterPoint/blob/main/CenterPoint.tflite) |
47
+ | CenterPoint | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | QNN_DLC | 165.811 ms | 2 - 670 MB | NPU | [CenterPoint.dlc](https://huggingface.co/qualcomm/CenterPoint/blob/main/CenterPoint.dlc) |
48
+ | CenterPoint | float | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN_DLC | 309.805 ms | 2 - 2 MB | NPU | [CenterPoint.dlc](https://huggingface.co/qualcomm/CenterPoint/blob/main/CenterPoint.dlc) |
49
+
50
+
51
+
52
+
53
+ ## Installation
54
+
55
+
56
+ Install the package via pip:
57
+ ```bash
58
+ # NOTE: 3.10 <= PYTHON_VERSION < 3.14 is supported.
59
+ pip install "qai-hub-models[centerpoint]"
60
+ ```
61
+
62
+
63
+ ## Configure Qualcomm® AI Hub Workbench to run this model on a cloud-hosted device
64
+
65
+ Sign-in to [Qualcomm® AI Hub Workbench](https://workbench.aihub.qualcomm.com/) with your
66
+ Qualcomm® ID. Once signed in navigate to `Account -> Settings -> API Token`.
67
+
68
+ With this API token, you can configure your client to run models on the cloud
69
+ hosted devices.
70
+ ```bash
71
+ qai-hub configure --api_token API_TOKEN
72
+ ```
73
+ Navigate to [docs](https://workbench.aihub.qualcomm.com/docs/) for more information.
74
+
75
+
76
+
77
+ ## Demo off target
78
+
79
+ The package contains a simple end-to-end demo that downloads pre-trained
80
+ weights and runs this model on a sample input.
81
+
82
+ ```bash
83
+ python -m qai_hub_models.models.centerpoint.demo
84
+ ```
85
+
86
+ The above demo runs a reference implementation of pre-processing, model
87
+ inference, and post processing.
88
+
89
+ **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
90
+ environment, please add the following to your cell (instead of the above).
91
+ ```
92
+ %run -m qai_hub_models.models.centerpoint.demo
93
+ ```
94
+
95
+
96
+ ### Run model on a cloud-hosted device
97
+
98
+ In addition to the demo, you can also run the model on a cloud-hosted Qualcomm®
99
+ device. This script does the following:
100
+ * Performance check on-device on a cloud-hosted device
101
+ * Downloads compiled assets that can be deployed on-device for Android.
102
+ * Accuracy check between PyTorch and on-device outputs.
103
+
104
+ ```bash
105
+ python -m qai_hub_models.models.centerpoint.export
106
+ ```
107
+
108
+
109
+
110
+ ## How does this work?
111
+
112
+ This [export script](https://aihub.qualcomm.com/models/centerpoint/qai_hub_models/models/CenterPoint/export.py)
113
+ leverages [Qualcomm® AI Hub](https://aihub.qualcomm.com/) to optimize, validate, and deploy this model
114
+ on-device. Lets go through each step below in detail:
115
+
116
+ Step 1: **Compile model for on-device deployment**
117
+
118
+ To compile a PyTorch model for on-device deployment, we first trace the model
119
+ in memory using the `jit.trace` and then call the `submit_compile_job` API.
120
+
121
+ ```python
122
+ import torch
123
+
124
+ import qai_hub as hub
125
+ from qai_hub_models.models.centerpoint import Model
126
+
127
+ # Load the model
128
+ torch_model = Model.from_pretrained()
129
+
130
+ # Device
131
+ device = hub.Device("Samsung Galaxy S25")
132
+
133
+ # Trace model
134
+ input_shape = torch_model.get_input_spec()
135
+ sample_inputs = torch_model.sample_inputs()
136
+
137
+ pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
138
+
139
+ # Compile model on a specific device
140
+ compile_job = hub.submit_compile_job(
141
+ model=pt_model,
142
+ device=device,
143
+ input_specs=torch_model.get_input_spec(),
144
+ )
145
+
146
+ # Get target model to run on-device
147
+ target_model = compile_job.get_target_model()
148
+
149
+ ```
150
+
151
+
152
+ Step 2: **Performance profiling on cloud-hosted device**
153
+
154
+ After compiling models from step 1. Models can be profiled model on-device using the
155
+ `target_model`. Note that this scripts runs the model on a device automatically
156
+ provisioned in the cloud. Once the job is submitted, you can navigate to a
157
+ provided job URL to view a variety of on-device performance metrics.
158
+ ```python
159
+ profile_job = hub.submit_profile_job(
160
+ model=target_model,
161
+ device=device,
162
+ )
163
+
164
+ ```
165
+
166
+ Step 3: **Verify on-device accuracy**
167
+
168
+ To verify the accuracy of the model on-device, you can run on-device inference
169
+ on sample input data on the same cloud hosted device.
170
+ ```python
171
+ input_data = torch_model.sample_inputs()
172
+ inference_job = hub.submit_inference_job(
173
+ model=target_model,
174
+ device=device,
175
+ inputs=input_data,
176
+ )
177
+ on_device_output = inference_job.download_output_data()
178
+
179
+ ```
180
+ With the output of the model, you can compute like PSNR, relative errors or
181
+ spot check the output with expected output.
182
+
183
+ **Note**: This on-device profiling and inference requires access to Qualcomm®
184
+ AI Hub Workbench. [Sign up for access](https://myaccount.qualcomm.com/signup).
185
+
186
+
187
+
188
+ ## Run demo on a cloud-hosted device
189
+
190
+ You can also run the demo on-device.
191
+
192
+ ```bash
193
+ python -m qai_hub_models.models.centerpoint.demo --eval-mode on-device
194
+ ```
195
+
196
+ **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
197
+ environment, please add the following to your cell (instead of the above).
198
+ ```
199
+ %run -m qai_hub_models.models.centerpoint.demo -- --eval-mode on-device
200
+ ```
201
+
202
+
203
+ ## Deploying compiled model to Android
204
+
205
+
206
+ The models can be deployed using multiple runtimes:
207
+ - TensorFlow Lite (`.tflite` export): [This
208
+ tutorial](https://www.tensorflow.org/lite/android/quickstart) provides a
209
+ guide to deploy the .tflite model in an Android application.
210
+
211
+
212
+ - QNN (`.so` export ): This [sample
213
+ app](https://docs.qualcomm.com/bundle/publicresource/topics/80-63442-50/sample_app.html)
214
+ provides instructions on how to use the `.so` shared library in an Android application.
215
+
216
+
217
+ ## View on Qualcomm® AI Hub
218
+ Get more details on CenterPoint's performance across various devices [here](https://aihub.qualcomm.com/models/centerpoint).
219
+ Explore all available models on [Qualcomm® AI Hub](https://aihub.qualcomm.com/)
220
+
221
+
222
+ ## License
223
+ * The license for the original implementation of CenterPoint can be found
224
+ [here](https://github.com/tianweiy/CenterPoint/blob/master/LICENSE).
225
+
226
+
227
+
228
+
229
+ ## Community
230
+ * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
231
+ * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).
232
+
233
+
tool-versions.yaml ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ tool_versions:
2
+ qnn_dlc:
3
+ qairt: 2.41.0.251128145156_191518