qaihm-bot commited on
Commit
83cd5c6
·
verified ·
1 Parent(s): 6b13b47

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

Files changed (4) hide show
  1. CVT_float.dlc +0 -3
  2. CVT_float.tflite +0 -3
  3. README.md +73 -223
  4. tool-versions.yaml +0 -3
CVT_float.dlc DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:317f70afee9be85c3ebf66f3aced8da0d1587b661db71f8212a9ad668424e27d
3
- size 5724988
 
 
 
 
CVT_float.tflite DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:8371b3b3b7e8edf24785d8ec8dddd1dc94672ecb9854ca8668296f157118dea3
3
- size 5431872
 
 
 
 
README.md CHANGED
@@ -9,241 +9,91 @@ pipeline_tag: other
9
 
10
  ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/cvt/web-assets/model_demo.png)
11
 
12
- # CVT: Optimized for Mobile Deployment
13
- ## Construct a map view from sensors mounted on a vehicle
14
-
15
 
16
  Cross-View Transformer generates real-time bird's-eye view maps from multiple vehicle cameras for autonomous driving.
17
 
18
- This model is an implementation of CVT found [here](https://github.com/bradyz/cross_view_transformers).
19
-
20
-
21
- This repository provides scripts to run CVT on Qualcomm® devices.
22
- More details on model performance across various devices, can be found
23
- [here](https://aihub.qualcomm.com/models/cvt).
24
-
25
-
26
-
27
- ### Model Details
28
-
29
- - **Model Type:** Model_use_case.driver_assistance
30
- - **Model Stats:**
31
- - Model checkpoint: vehicles_50k.pt
32
- - Inference latency: RealTime
33
- - Input resolution: 1x6x3x224x480
34
- - Number of parameters: 1.33M
35
- - Model size (float): 5.18 MB
36
-
37
- | Model | Precision | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit | Target Model
38
- |---|---|---|---|---|---|---|---|---|
39
- | CVT | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | TFLITE | 438.532 ms | 0 - 2052 MB | NPU | [CVT.tflite](https://huggingface.co/qualcomm/CVT/blob/main/CVT.tflite) |
40
- | CVT | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | QNN_DLC | 428.856 ms | 0 - 2047 MB | NPU | [CVT.dlc](https://huggingface.co/qualcomm/CVT/blob/main/CVT.dlc) |
41
- | CVT | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | TFLITE | 492.978 ms | 0 - 2582 MB | NPU | [CVT.tflite](https://huggingface.co/qualcomm/CVT/blob/main/CVT.tflite) |
42
- | CVT | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | QNN_DLC | 483.659 ms | 7 - 2510 MB | NPU | [CVT.dlc](https://huggingface.co/qualcomm/CVT/blob/main/CVT.dlc) |
43
- | CVT | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | TFLITE | 343.008 ms | 0 - 4 MB | NPU | [CVT.tflite](https://huggingface.co/qualcomm/CVT/blob/main/CVT.tflite) |
44
- | CVT | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | QNN_DLC | 337.257 ms | 8 - 11 MB | NPU | [CVT.dlc](https://huggingface.co/qualcomm/CVT/blob/main/CVT.dlc) |
45
- | CVT | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | TFLITE | 319.202 ms | 0 - 2051 MB | NPU | [CVT.tflite](https://huggingface.co/qualcomm/CVT/blob/main/CVT.tflite) |
46
- | CVT | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | QNN_DLC | 311.571 ms | 2 - 2048 MB | NPU | [CVT.dlc](https://huggingface.co/qualcomm/CVT/blob/main/CVT.dlc) |
47
- | CVT | float | SA7255P ADP | Qualcomm® SA7255P | TFLITE | 438.532 ms | 0 - 2052 MB | NPU | [CVT.tflite](https://huggingface.co/qualcomm/CVT/blob/main/CVT.tflite) |
48
- | CVT | float | SA7255P ADP | Qualcomm® SA7255P | QNN_DLC | 428.856 ms | 0 - 2047 MB | NPU | [CVT.dlc](https://huggingface.co/qualcomm/CVT/blob/main/CVT.dlc) |
49
- | CVT | float | SA8295P ADP | Qualcomm® SA8295P | TFLITE | 364.408 ms | 1 - 2156 MB | NPU | [CVT.tflite](https://huggingface.co/qualcomm/CVT/blob/main/CVT.tflite) |
50
- | CVT | float | SA8295P ADP | Qualcomm® SA8295P | QNN_DLC | 362.017 ms | 0 - 2108 MB | NPU | [CVT.dlc](https://huggingface.co/qualcomm/CVT/blob/main/CVT.dlc) |
51
- | CVT | float | SA8775P ADP | Qualcomm® SA8775P | TFLITE | 319.202 ms | 0 - 2051 MB | NPU | [CVT.tflite](https://huggingface.co/qualcomm/CVT/blob/main/CVT.tflite) |
52
- | CVT | float | SA8775P ADP | Qualcomm® SA8775P | QNN_DLC | 311.571 ms | 2 - 2048 MB | NPU | [CVT.dlc](https://huggingface.co/qualcomm/CVT/blob/main/CVT.dlc) |
53
- | CVT | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | TFLITE | 251.664 ms | 2 - 2426 MB | NPU | [CVT.tflite](https://huggingface.co/qualcomm/CVT/blob/main/CVT.tflite) |
54
- | CVT | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | TFLITE | 197.937 ms | 0 - 2068 MB | NPU | [CVT.tflite](https://huggingface.co/qualcomm/CVT/blob/main/CVT.tflite) |
55
- | CVT | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | QNN_DLC | 201.332 ms | 7 - 2001 MB | NPU | [CVT.dlc](https://huggingface.co/qualcomm/CVT/blob/main/CVT.dlc) |
56
- | CVT | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | TFLITE | 182.132 ms | 0 - 2057 MB | NPU | [CVT.tflite](https://huggingface.co/qualcomm/CVT/blob/main/CVT.tflite) |
57
- | CVT | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | QNN_DLC | 178.735 ms | 7 - 2095 MB | NPU | [CVT.dlc](https://huggingface.co/qualcomm/CVT/blob/main/CVT.dlc) |
58
- | CVT | float | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN_DLC | 290.792 ms | 7 - 7 MB | NPU | [CVT.dlc](https://huggingface.co/qualcomm/CVT/blob/main/CVT.dlc) |
59
-
60
-
61
-
62
-
63
- ## Installation
64
-
65
-
66
- Install the package via pip:
67
- ```bash
68
- # NOTE: 3.10 <= PYTHON_VERSION < 3.14 is supported.
69
- pip install nuscenes-devkit==1.2.0 --no-deps
70
- pip install "qai-hub-models[cvt]"
71
- ```
72
-
73
-
74
- ## Configure Qualcomm® AI Hub Workbench to run this model on a cloud-hosted device
75
-
76
- Sign-in to [Qualcomm® AI Hub Workbench](https://workbench.aihub.qualcomm.com/) with your
77
- Qualcomm® ID. Once signed in navigate to `Account -> Settings -> API Token`.
78
-
79
- With this API token, you can configure your client to run models on the cloud
80
- hosted devices.
81
- ```bash
82
- qai-hub configure --api_token API_TOKEN
83
- ```
84
- Navigate to [docs](https://workbench.aihub.qualcomm.com/docs/) for more information.
85
-
86
-
87
-
88
- ## Demo off target
89
-
90
- The package contains a simple end-to-end demo that downloads pre-trained
91
- weights and runs this model on a sample input.
92
-
93
- ```bash
94
- python -m qai_hub_models.models.cvt.demo
95
- ```
96
-
97
- The above demo runs a reference implementation of pre-processing, model
98
- inference, and post processing.
99
-
100
- **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
101
- environment, please add the following to your cell (instead of the above).
102
- ```
103
- %run -m qai_hub_models.models.cvt.demo
104
- ```
105
-
106
-
107
- ### Run model on a cloud-hosted device
108
-
109
- In addition to the demo, you can also run the model on a cloud-hosted Qualcomm®
110
- device. This script does the following:
111
- * Performance check on-device on a cloud-hosted device
112
- * Downloads compiled assets that can be deployed on-device for Android.
113
- * Accuracy check between PyTorch and on-device outputs.
114
-
115
- ```bash
116
- python -m qai_hub_models.models.cvt.export
117
- ```
118
-
119
-
120
-
121
- ## How does this work?
122
-
123
- This [export script](https://aihub.qualcomm.com/models/cvt/qai_hub_models/models/CVT/export.py)
124
- leverages [Qualcomm® AI Hub](https://aihub.qualcomm.com/) to optimize, validate, and deploy this model
125
- on-device. Lets go through each step below in detail:
126
-
127
- Step 1: **Compile model for on-device deployment**
128
-
129
- To compile a PyTorch model for on-device deployment, we first trace the model
130
- in memory using the `jit.trace` and then call the `submit_compile_job` API.
131
-
132
- ```python
133
- import torch
134
-
135
- import qai_hub as hub
136
- from qai_hub_models.models.cvt import Model
137
-
138
- # Load the model
139
- torch_model = Model.from_pretrained()
140
-
141
- # Device
142
- device = hub.Device("Samsung Galaxy S25")
143
-
144
- # Trace model
145
- input_shape = torch_model.get_input_spec()
146
- sample_inputs = torch_model.sample_inputs()
147
-
148
- pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
149
-
150
- # Compile model on a specific device
151
- compile_job = hub.submit_compile_job(
152
- model=pt_model,
153
- device=device,
154
- input_specs=torch_model.get_input_spec(),
155
- )
156
-
157
- # Get target model to run on-device
158
- target_model = compile_job.get_target_model()
159
-
160
- ```
161
-
162
-
163
- Step 2: **Performance profiling on cloud-hosted device**
164
-
165
- After compiling models from step 1. Models can be profiled model on-device using the
166
- `target_model`. Note that this scripts runs the model on a device automatically
167
- provisioned in the cloud. Once the job is submitted, you can navigate to a
168
- provided job URL to view a variety of on-device performance metrics.
169
- ```python
170
- profile_job = hub.submit_profile_job(
171
- model=target_model,
172
- device=device,
173
- )
174
-
175
- ```
176
-
177
- Step 3: **Verify on-device accuracy**
178
-
179
- To verify the accuracy of the model on-device, you can run on-device inference
180
- on sample input data on the same cloud hosted device.
181
- ```python
182
- input_data = torch_model.sample_inputs()
183
- inference_job = hub.submit_inference_job(
184
- model=target_model,
185
- device=device,
186
- inputs=input_data,
187
- )
188
- on_device_output = inference_job.download_output_data()
189
-
190
- ```
191
- With the output of the model, you can compute like PSNR, relative errors or
192
- spot check the output with expected output.
193
-
194
- **Note**: This on-device profiling and inference requires access to Qualcomm®
195
- AI Hub Workbench. [Sign up for access](https://myaccount.qualcomm.com/signup).
196
-
197
-
198
-
199
- ## Run demo on a cloud-hosted device
200
-
201
- You can also run the demo on-device.
202
-
203
- ```bash
204
- python -m qai_hub_models.models.cvt.demo --eval-mode on-device
205
- ```
206
-
207
- **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
208
- environment, please add the following to your cell (instead of the above).
209
- ```
210
- %run -m qai_hub_models.models.cvt.demo -- --eval-mode on-device
211
- ```
212
-
213
-
214
- ## Deploying compiled model to Android
215
-
216
-
217
- The models can be deployed using multiple runtimes:
218
- - TensorFlow Lite (`.tflite` export): [This
219
- tutorial](https://www.tensorflow.org/lite/android/quickstart) provides a
220
- guide to deploy the .tflite model in an Android application.
221
-
222
-
223
- - QNN (`.so` export ): This [sample
224
- app](https://docs.qualcomm.com/bundle/publicresource/topics/80-63442-50/sample_app.html)
225
- provides instructions on how to use the `.so` shared library in an Android application.
226
-
227
-
228
- ## View on Qualcomm® AI Hub
229
- Get more details on CVT's performance across various devices [here](https://aihub.qualcomm.com/models/cvt).
230
- Explore all available models on [Qualcomm® AI Hub](https://aihub.qualcomm.com/)
231
-
232
 
233
  ## License
234
  * The license for the original implementation of CVT can be found
235
  [here](https://github.com/bradyz/cross_view_transformers/blob/master/LICENSE).
236
 
237
-
238
-
239
  ## References
240
  * [Cross-view Transformers for real-time Map-view Semantic Segmentation](https://arxiv.org/abs/2205.02833)
241
  * [Source Model Implementation](https://github.com/bradyz/cross_view_transformers)
242
 
243
-
244
-
245
  ## Community
246
  * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
247
  * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).
248
-
249
-
 
9
 
10
  ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/cvt/web-assets/model_demo.png)
11
 
12
+ # CVT: Optimized for Qualcomm Devices
 
 
13
 
14
  Cross-View Transformer generates real-time bird's-eye view maps from multiple vehicle cameras for autonomous driving.
15
 
16
+ This is based on the implementation of CVT found [here](https://github.com/bradyz/cross_view_transformers).
17
+ This repository contains pre-exported model files optimized for Qualcomm® devices. You can use the [Qualcomm® AI Hub Models](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/cvt) library to export with custom configurations. More details on model performance across various devices, can be found [here](#performance-summary).
18
+
19
+ Qualcomm AI Hub Models uses [Qualcomm AI Hub Workbench](https://workbench.aihub.qualcomm.com) to compile, profile, and evaluate this model. [Sign up](https://myaccount.qualcomm.com/signup) to run these models on a hosted Qualcomm® device.
20
+
21
+ ## Getting Started
22
+ There are two ways to deploy this model on your device:
23
+
24
+ ### Option 1: Download Pre-Exported Models
25
+
26
+ Below are pre-exported model assets ready for deployment.
27
+
28
+ | Runtime | Precision | Chipset | SDK Versions | Download |
29
+ |---|---|---|---|---|
30
+ | ONNX | float | Universal | QAIRT 2.37, ONNX Runtime 1.23.0 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/cvt/releases/v0.46.1/cvt-onnx-float.zip)
31
+ | QNN_DLC | float | Universal | QAIRT 2.42 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/cvt/releases/v0.46.1/cvt-qnn_dlc-float.zip)
32
+ | TFLITE | float | Universal | QAIRT 2.42, TFLite 2.17.0 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/cvt/releases/v0.46.1/cvt-tflite-float.zip)
33
+
34
+ For more device-specific assets and performance metrics, visit **[CVT on Qualcomm® AI Hub](https://aihub.qualcomm.com/models/cvt)**.
35
+
36
+
37
+ ### Option 2: Export with Custom Configurations
38
+
39
+ Use the [Qualcomm® AI Hub Models](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/cvt) Python library to compile and export the model with your own:
40
+ - Custom weights (e.g., fine-tuned checkpoints)
41
+ - Custom input shapes
42
+ - Target device and runtime configurations
43
+
44
+ This option is ideal if you need to customize the model beyond the default configuration provided here.
45
+
46
+ See our repository for [CVT on GitHub](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/cvt) for usage instructions.
47
+
48
+ ## Model Details
49
+
50
+ **Model Type:** Model_use_case.driver_assistance
51
+
52
+ **Model Stats:**
53
+ - Model checkpoint: vehicles_50k.pt
54
+ - Inference latency: RealTime
55
+ - Input resolution: 1x6x3x224x480
56
+ - Number of parameters: 1.33M
57
+ - Model size (float): 5.18 MB
58
+
59
+ ## Performance Summary
60
+ | Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit
61
+ |---|---|---|---|---|---|---
62
+ | CVT | ONNX | float | Snapdragon® X Elite | 337.851 ms | 20 - 20 MB | NPU
63
+ | CVT | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 307.125 ms | 8 - 2453 MB | NPU
64
+ | CVT | ONNX | float | Qualcomm® QCS8550 (Proxy) | 407.302 ms | 0 - 24 MB | NPU
65
+ | CVT | ONNX | float | Qualcomm® QCS9075 | 331.746 ms | 7 - 10 MB | NPU
66
+ | CVT | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 259.644 ms | 4 - 2088 MB | NPU
67
+ | CVT | QNN_DLC | float | Snapdragon® X Elite | 281.503 ms | 7 - 7 MB | NPU
68
+ | CVT | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 221.782 ms | 8 - 2556 MB | NPU
69
+ | CVT | QNN_DLC | float | Qualcomm® QCS8275 (Proxy) | 423.067 ms | 0 - 2186 MB | NPU
70
+ | CVT | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 329.044 ms | 8 - 578 MB | NPU
71
+ | CVT | QNN_DLC | float | Qualcomm® SA8775P | 292.094 ms | 0 - 2186 MB | NPU
72
+ | CVT | QNN_DLC | float | Qualcomm® QCS9075 | 323.368 ms | 7 - 17 MB | NPU
73
+ | CVT | QNN_DLC | float | Qualcomm® QCS8450 (Proxy) | 439.183 ms | 7 - 2650 MB | NPU
74
+ | CVT | QNN_DLC | float | Qualcomm® SA7255P | 423.067 ms | 0 - 2186 MB | NPU
75
+ | CVT | QNN_DLC | float | Qualcomm® SA8295P | 332.938 ms | 0 - 2240 MB | NPU
76
+ | CVT | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 184.599 ms | 7 - 2173 MB | NPU
77
+ | CVT | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 169.256 ms | 7 - 2259 MB | NPU
78
+ | CVT | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 224.811 ms | 0 - 2562 MB | NPU
79
+ | CVT | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 426.207 ms | 0 - 2193 MB | NPU
80
+ | CVT | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 339.717 ms | 0 - 4 MB | NPU
81
+ | CVT | TFLITE | float | Qualcomm® SA8775P | 297.388 ms | 0 - 2193 MB | NPU
82
+ | CVT | TFLITE | float | Qualcomm® QCS9075 | 325.057 ms | 0 - 35 MB | NPU
83
+ | CVT | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 451.485 ms | 0 - 2731 MB | NPU
84
+ | CVT | TFLITE | float | Qualcomm® SA7255P | 426.207 ms | 0 - 2193 MB | NPU
85
+ | CVT | TFLITE | float | Qualcomm® SA8295P | 342.185 ms | 0 - 2289 MB | NPU
86
+ | CVT | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 188.96 ms | 0 - 2243 MB | NPU
87
+ | CVT | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 172.317 ms | 0 - 2287 MB | NPU
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
 
89
  ## License
90
  * The license for the original implementation of CVT can be found
91
  [here](https://github.com/bradyz/cross_view_transformers/blob/master/LICENSE).
92
 
 
 
93
  ## References
94
  * [Cross-view Transformers for real-time Map-view Semantic Segmentation](https://arxiv.org/abs/2205.02833)
95
  * [Source Model Implementation](https://github.com/bradyz/cross_view_transformers)
96
 
 
 
97
  ## Community
98
  * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
99
  * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).
 
 
tool-versions.yaml DELETED
@@ -1,3 +0,0 @@
1
- tool_versions:
2
- qnn_dlc:
3
- qairt: 2.41.0.251128145156_191518