qaihm-bot commited on
Commit
8c067c7
·
verified ·
1 Parent(s): 843782d

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

README.md CHANGED
@@ -10,280 +10,131 @@ pipeline_tag: image-classification
10
 
11
  ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/regnet/web-assets/model_demo.png)
12
 
13
- # RegNet: Optimized for Mobile Deployment
14
- ## Imagenet classifier and general purpose backbone
15
-
16
 
17
  RegNet is a machine learning model that can classify images from the Imagenet dataset. It can also be used as a backbone in building more complex models for specific use cases.
18
 
19
- This model is an implementation of RegNet found [here](https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py).
20
-
21
-
22
- This repository provides scripts to run RegNet on Qualcomm® devices.
23
- More details on model performance across various devices, can be found
24
- [here](https://aihub.qualcomm.com/models/regnet).
25
-
26
-
27
-
28
- ### Model Details
29
-
30
- - **Model Type:** Model_use_case.image_classification
31
- - **Model Stats:**
32
- - Model checkpoint: Imagenet
33
- - Input resolution: 224x224
34
- - Number of parameters: 15.3M
35
- - Model size (float): 58.3 MB
36
- - Model size (w8a8): 15.4 MB
37
-
38
- | Model | Precision | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit | Target Model
39
- |---|---|---|---|---|---|---|---|---|
40
- | RegNet | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | TFLITE | 9.896 ms | 0 - 181 MB | NPU | [RegNet.tflite](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.tflite) |
41
- | RegNet | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | QNN_DLC | 9.938 ms | 1 - 162 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.dlc) |
42
- | RegNet | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | TFLITE | 3.267 ms | 0 - 232 MB | NPU | [RegNet.tflite](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.tflite) |
43
- | RegNet | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | QNN_DLC | 3.29 ms | 1 - 209 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.dlc) |
44
- | RegNet | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | TFLITE | 1.983 ms | 0 - 2 MB | NPU | [RegNet.tflite](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.tflite) |
45
- | RegNet | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | QNN_DLC | 2.001 ms | 1 - 3 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.dlc) |
46
- | RegNet | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | ONNX | 1.988 ms | 0 - 42 MB | NPU | [RegNet.onnx.zip](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.onnx.zip) |
47
- | RegNet | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | TFLITE | 13.853 ms | 0 - 181 MB | NPU | [RegNet.tflite](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.tflite) |
48
- | RegNet | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | QNN_DLC | 3.311 ms | 1 - 162 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.dlc) |
49
- | RegNet | float | SA7255P ADP | Qualcomm® SA7255P | TFLITE | 9.896 ms | 0 - 181 MB | NPU | [RegNet.tflite](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.tflite) |
50
- | RegNet | float | SA7255P ADP | Qualcomm® SA7255P | QNN_DLC | 9.938 ms | 1 - 162 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.dlc) |
51
- | RegNet | float | SA8295P ADP | Qualcomm® SA8295P | TFLITE | 3.452 ms | 0 - 177 MB | NPU | [RegNet.tflite](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.tflite) |
52
- | RegNet | float | SA8295P ADP | Qualcomm® SA8295P | QNN_DLC | 3.444 ms | 1 - 161 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.dlc) |
53
- | RegNet | float | SA8775P ADP | Qualcomm® SA8775P | TFLITE | 13.853 ms | 0 - 181 MB | NPU | [RegNet.tflite](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.tflite) |
54
- | RegNet | float | SA8775P ADP | Qualcomm® SA8775P | QNN_DLC | 3.311 ms | 1 - 162 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.dlc) |
55
- | RegNet | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | TFLITE | 1.368 ms | 0 - 242 MB | NPU | [RegNet.tflite](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.tflite) |
56
- | RegNet | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | QNN_DLC | 1.386 ms | 1 - 214 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.dlc) |
57
- | RegNet | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 1.432 ms | 0 - 189 MB | NPU | [RegNet.onnx.zip](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.onnx.zip) |
58
- | RegNet | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | TFLITE | 1.084 ms | 0 - 184 MB | NPU | [RegNet.tflite](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.tflite) |
59
- | RegNet | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | QNN_DLC | 1.086 ms | 1 - 169 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.dlc) |
60
- | RegNet | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | ONNX | 1.169 ms | 0 - 138 MB | NPU | [RegNet.onnx.zip](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.onnx.zip) |
61
- | RegNet | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | TFLITE | 0.89 ms | 0 - 185 MB | NPU | [RegNet.tflite](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.tflite) |
62
- | RegNet | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | QNN_DLC | 0.9 ms | 1 - 168 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.dlc) |
63
- | RegNet | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | ONNX | 1.013 ms | 0 - 140 MB | NPU | [RegNet.onnx.zip](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.onnx.zip) |
64
- | RegNet | float | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN_DLC | 2.235 ms | 1 - 1 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.dlc) |
65
- | RegNet | float | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 1.969 ms | 39 - 39 MB | NPU | [RegNet.onnx.zip](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet.onnx.zip) |
66
- | RegNet | w8a8 | Dragonwing Q-6690 MTP | Qualcomm® QCM6690 | TFLITE | 6.662 ms | 0 - 169 MB | NPU | [RegNet.tflite](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.tflite) |
67
- | RegNet | w8a8 | Dragonwing Q-6690 MTP | Qualcomm® QCM6690 | QNN_DLC | 7.165 ms | 0 - 175 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.dlc) |
68
- | RegNet | w8a8 | Dragonwing Q-6690 MTP | Qualcomm® QCM6690 | ONNX | 17.928 ms | 8 - 24 MB | CPU | [RegNet.onnx.zip](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.onnx.zip) |
69
- | RegNet | w8a8 | Dragonwing RB3 Gen 2 Vision Kit | Qualcomm® QCS6490 | TFLITE | 2.228 ms | 0 - 21 MB | NPU | [RegNet.tflite](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.tflite) |
70
- | RegNet | w8a8 | Dragonwing RB3 Gen 2 Vision Kit | Qualcomm® QCS6490 | QNN_DLC | 2.697 ms | 0 - 2 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.dlc) |
71
- | RegNet | w8a8 | Dragonwing RB3 Gen 2 Vision Kit | Qualcomm® QCS6490 | ONNX | 28.317 ms | 7 - 19 MB | CPU | [RegNet.onnx.zip](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.onnx.zip) |
72
- | RegNet | w8a8 | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | TFLITE | 2.002 ms | 0 - 167 MB | NPU | [RegNet.tflite](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.tflite) |
73
- | RegNet | w8a8 | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | QNN_DLC | 2.269 ms | 0 - 168 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.dlc) |
74
- | RegNet | w8a8 | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | TFLITE | 1.152 ms | 0 - 208 MB | NPU | [RegNet.tflite](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.tflite) |
75
- | RegNet | w8a8 | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | QNN_DLC | 1.303 ms | 0 - 204 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.dlc) |
76
- | RegNet | w8a8 | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | TFLITE | 0.728 ms | 0 - 2 MB | NPU | [RegNet.tflite](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.tflite) |
77
- | RegNet | w8a8 | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | QNN_DLC | 0.905 ms | 0 - 2 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.dlc) |
78
- | RegNet | w8a8 | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | ONNX | 1.168 ms | 0 - 26 MB | NPU | [RegNet.onnx.zip](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.onnx.zip) |
79
- | RegNet | w8a8 | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | TFLITE | 1.065 ms | 0 - 167 MB | NPU | [RegNet.tflite](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.tflite) |
80
- | RegNet | w8a8 | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | QNN_DLC | 1.267 ms | 0 - 169 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.dlc) |
81
- | RegNet | w8a8 | SA7255P ADP | Qualcomm® SA7255P | TFLITE | 2.002 ms | 0 - 167 MB | NPU | [RegNet.tflite](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.tflite) |
82
- | RegNet | w8a8 | SA7255P ADP | Qualcomm® SA7255P | QNN_DLC | 2.269 ms | 0 - 168 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.dlc) |
83
- | RegNet | w8a8 | SA8295P ADP | Qualcomm® SA8295P | TFLITE | 1.418 ms | 0 - 176 MB | NPU | [RegNet.tflite](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.tflite) |
84
- | RegNet | w8a8 | SA8295P ADP | Qualcomm® SA8295P | QNN_DLC | 1.604 ms | 0 - 176 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.dlc) |
85
- | RegNet | w8a8 | SA8775P ADP | Qualcomm® SA8775P | TFLITE | 1.065 ms | 0 - 167 MB | NPU | [RegNet.tflite](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.tflite) |
86
- | RegNet | w8a8 | SA8775P ADP | Qualcomm® SA8775P | QNN_DLC | 1.267 ms | 0 - 169 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.dlc) |
87
- | RegNet | w8a8 | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | TFLITE | 0.53 ms | 0 - 213 MB | NPU | [RegNet.tflite](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.tflite) |
88
- | RegNet | w8a8 | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | QNN_DLC | 0.66 ms | 0 - 206 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.dlc) |
89
- | RegNet | w8a8 | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 0.794 ms | 0 - 200 MB | NPU | [RegNet.onnx.zip](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.onnx.zip) |
90
- | RegNet | w8a8 | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | TFLITE | 0.45 ms | 0 - 165 MB | NPU | [RegNet.tflite](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.tflite) |
91
- | RegNet | w8a8 | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | QNN_DLC | 0.491 ms | 0 - 169 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.dlc) |
92
- | RegNet | w8a8 | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | ONNX | 0.701 ms | 0 - 150 MB | NPU | [RegNet.onnx.zip](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.onnx.zip) |
93
- | RegNet | w8a8 | Snapdragon 7 Gen 4 QRD | Snapdragon® 7 Gen 4 Mobile | TFLITE | 0.984 ms | 0 - 169 MB | NPU | [RegNet.tflite](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.tflite) |
94
- | RegNet | w8a8 | Snapdragon 7 Gen 4 QRD | Snapdragon® 7 Gen 4 Mobile | QNN_DLC | 1.174 ms | 0 - 174 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.dlc) |
95
- | RegNet | w8a8 | Snapdragon 7 Gen 4 QRD | Snapdragon® 7 Gen 4 Mobile | ONNX | 16.999 ms | 8 - 26 MB | CPU | [RegNet.onnx.zip](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.onnx.zip) |
96
- | RegNet | w8a8 | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | TFLITE | 0.395 ms | 0 - 169 MB | NPU | [RegNet.tflite](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.tflite) |
97
- | RegNet | w8a8 | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | QNN_DLC | 0.446 ms | 0 - 170 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.dlc) |
98
- | RegNet | w8a8 | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | ONNX | 0.667 ms | 0 - 154 MB | NPU | [RegNet.onnx.zip](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.onnx.zip) |
99
- | RegNet | w8a8 | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN_DLC | 1.089 ms | 0 - 0 MB | NPU | [RegNet.dlc](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.dlc) |
100
- | RegNet | w8a8 | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 1.14 ms | 21 - 21 MB | NPU | [RegNet.onnx.zip](https://huggingface.co/qualcomm/RegNet/blob/main/RegNet_w8a8.onnx.zip) |
101
-
102
-
103
-
104
-
105
- ## Installation
106
-
107
-
108
- Install the package via pip:
109
- ```bash
110
- pip install qai-hub-models
111
- ```
112
-
113
-
114
- ## Configure Qualcomm® AI Hub Workbench to run this model on a cloud-hosted device
115
-
116
- Sign-in to [Qualcomm® AI Hub Workbench](https://workbench.aihub.qualcomm.com/) with your
117
- Qualcomm® ID. Once signed in navigate to `Account -> Settings -> API Token`.
118
-
119
- With this API token, you can configure your client to run models on the cloud
120
- hosted devices.
121
- ```bash
122
- qai-hub configure --api_token API_TOKEN
123
- ```
124
- Navigate to [docs](https://workbench.aihub.qualcomm.com/docs/) for more information.
125
-
126
-
127
-
128
- ## Demo off target
129
-
130
- The package contains a simple end-to-end demo that downloads pre-trained
131
- weights and runs this model on a sample input.
132
-
133
- ```bash
134
- python -m qai_hub_models.models.regnet.demo
135
- ```
136
-
137
- The above demo runs a reference implementation of pre-processing, model
138
- inference, and post processing.
139
-
140
- **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
141
- environment, please add the following to your cell (instead of the above).
142
- ```
143
- %run -m qai_hub_models.models.regnet.demo
144
- ```
145
-
146
-
147
- ### Run model on a cloud-hosted device
148
-
149
- In addition to the demo, you can also run the model on a cloud-hosted Qualcomm®
150
- device. This script does the following:
151
- * Performance check on-device on a cloud-hosted device
152
- * Downloads compiled assets that can be deployed on-device for Android.
153
- * Accuracy check between PyTorch and on-device outputs.
154
-
155
- ```bash
156
- python -m qai_hub_models.models.regnet.export
157
- ```
158
-
159
-
160
-
161
- ## How does this work?
162
-
163
- This [export script](https://aihub.qualcomm.com/models/regnet/qai_hub_models/models/RegNet/export.py)
164
- leverages [Qualcomm® AI Hub](https://aihub.qualcomm.com/) to optimize, validate, and deploy this model
165
- on-device. Lets go through each step below in detail:
166
-
167
- Step 1: **Compile model for on-device deployment**
168
-
169
- To compile a PyTorch model for on-device deployment, we first trace the model
170
- in memory using the `jit.trace` and then call the `submit_compile_job` API.
171
-
172
- ```python
173
- import torch
174
-
175
- import qai_hub as hub
176
- from qai_hub_models.models.regnet import Model
177
-
178
- # Load the model
179
- torch_model = Model.from_pretrained()
180
-
181
- # Device
182
- device = hub.Device("Samsung Galaxy S25")
183
-
184
- # Trace model
185
- input_shape = torch_model.get_input_spec()
186
- sample_inputs = torch_model.sample_inputs()
187
-
188
- pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
189
-
190
- # Compile model on a specific device
191
- compile_job = hub.submit_compile_job(
192
- model=pt_model,
193
- device=device,
194
- input_specs=torch_model.get_input_spec(),
195
- )
196
-
197
- # Get target model to run on-device
198
- target_model = compile_job.get_target_model()
199
-
200
- ```
201
-
202
-
203
- Step 2: **Performance profiling on cloud-hosted device**
204
-
205
- After compiling models from step 1. Models can be profiled model on-device using the
206
- `target_model`. Note that this scripts runs the model on a device automatically
207
- provisioned in the cloud. Once the job is submitted, you can navigate to a
208
- provided job URL to view a variety of on-device performance metrics.
209
- ```python
210
- profile_job = hub.submit_profile_job(
211
- model=target_model,
212
- device=device,
213
- )
214
-
215
- ```
216
-
217
- Step 3: **Verify on-device accuracy**
218
-
219
- To verify the accuracy of the model on-device, you can run on-device inference
220
- on sample input data on the same cloud hosted device.
221
- ```python
222
- input_data = torch_model.sample_inputs()
223
- inference_job = hub.submit_inference_job(
224
- model=target_model,
225
- device=device,
226
- inputs=input_data,
227
- )
228
- on_device_output = inference_job.download_output_data()
229
-
230
- ```
231
- With the output of the model, you can compute like PSNR, relative errors or
232
- spot check the output with expected output.
233
-
234
- **Note**: This on-device profiling and inference requires access to Qualcomm®
235
- AI Hub Workbench. [Sign up for access](https://myaccount.qualcomm.com/signup).
236
-
237
-
238
-
239
- ## Run demo on a cloud-hosted device
240
-
241
- You can also run the demo on-device.
242
-
243
- ```bash
244
- python -m qai_hub_models.models.regnet.demo --eval-mode on-device
245
- ```
246
-
247
- **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
248
- environment, please add the following to your cell (instead of the above).
249
- ```
250
- %run -m qai_hub_models.models.regnet.demo -- --eval-mode on-device
251
- ```
252
-
253
-
254
- ## Deploying compiled model to Android
255
-
256
-
257
- The models can be deployed using multiple runtimes:
258
- - TensorFlow Lite (`.tflite` export): [This
259
- tutorial](https://www.tensorflow.org/lite/android/quickstart) provides a
260
- guide to deploy the .tflite model in an Android application.
261
-
262
-
263
- - QNN (`.so` export ): This [sample
264
- app](https://docs.qualcomm.com/bundle/publicresource/topics/80-63442-50/sample_app.html)
265
- provides instructions on how to use the `.so` shared library in an Android application.
266
-
267
-
268
- ## View on Qualcomm® AI Hub
269
- Get more details on RegNet's performance across various devices [here](https://aihub.qualcomm.com/models/regnet).
270
- Explore all available models on [Qualcomm® AI Hub](https://aihub.qualcomm.com/)
271
-
272
 
273
  ## License
274
  * The license for the original implementation of RegNet can be found
275
  [here](https://github.com/pytorch/vision/blob/main/LICENSE).
276
 
277
-
278
-
279
  ## References
280
  * [Designing Network Design Spaces](https://arxiv.org/abs/2003.13678)
281
  * [Source Model Implementation](https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py)
282
 
283
-
284
-
285
  ## Community
286
  * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
287
  * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).
288
-
289
-
 
10
 
11
  ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/regnet/web-assets/model_demo.png)
12
 
13
+ # RegNet: Optimized for Qualcomm Devices
 
 
14
 
15
  RegNet is a machine learning model that can classify images from the Imagenet dataset. It can also be used as a backbone in building more complex models for specific use cases.
16
 
17
+ This is based on the implementation of RegNet found [here](https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py).
18
+ 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/regnet) library to export with custom configurations. More details on model performance across various devices, can be found [here](#performance-summary).
19
+
20
+ 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.
21
+
22
+ ## Getting Started
23
+ There are two ways to deploy this model on your device:
24
+
25
+ ### Option 1: Download Pre-Exported Models
26
+
27
+ Below are pre-exported model assets ready for deployment.
28
+
29
+ | Runtime | Precision | Chipset | SDK Versions | Download |
30
+ |---|---|---|---|---|
31
+ | 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/regnet/releases/v0.46.1/regnet-onnx-float.zip)
32
+ | ONNX | w8a8 | Universal | QAIRT 2.37, ONNX Runtime 1.23.0 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/regnet/releases/v0.46.1/regnet-onnx-w8a8.zip)
33
+ | QNN_DLC | float | Universal | QAIRT 2.42 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/regnet/releases/v0.46.1/regnet-qnn_dlc-float.zip)
34
+ | QNN_DLC | w8a8 | Universal | QAIRT 2.42 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/regnet/releases/v0.46.1/regnet-qnn_dlc-w8a8.zip)
35
+ | 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/regnet/releases/v0.46.1/regnet-tflite-float.zip)
36
+ | TFLITE | w8a8 | Universal | QAIRT 2.42, TFLite 2.17.0 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/regnet/releases/v0.46.1/regnet-tflite-w8a8.zip)
37
+
38
+ For more device-specific assets and performance metrics, visit **[RegNet on Qualcomm® AI Hub](https://aihub.qualcomm.com/models/regnet)**.
39
+
40
+
41
+ ### Option 2: Export with Custom Configurations
42
+
43
+ Use the [Qualcomm® AI Hub Models](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/regnet) Python library to compile and export the model with your own:
44
+ - Custom weights (e.g., fine-tuned checkpoints)
45
+ - Custom input shapes
46
+ - Target device and runtime configurations
47
+
48
+ This option is ideal if you need to customize the model beyond the default configuration provided here.
49
+
50
+ See our repository for [RegNet on GitHub](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/regnet) for usage instructions.
51
+
52
+ ## Model Details
53
+
54
+ **Model Type:** Model_use_case.image_classification
55
+
56
+ **Model Stats:**
57
+ - Model checkpoint: Imagenet
58
+ - Input resolution: 224x224
59
+ - Number of parameters: 15.3M
60
+ - Model size (float): 58.3 MB
61
+ - Model size (w8a8): 15.4 MB
62
+
63
+ ## Performance Summary
64
+ | Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit
65
+ |---|---|---|---|---|---|---
66
+ | RegNet | ONNX | float | Snapdragon® X Elite | 1.933 ms | 39 - 39 MB | NPU
67
+ | RegNet | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 1.509 ms | 0 - 186 MB | NPU
68
+ | RegNet | ONNX | float | Qualcomm® QCS8550 (Proxy) | 2.038 ms | 0 - 44 MB | NPU
69
+ | RegNet | ONNX | float | Qualcomm® QCS9075 | 3.075 ms | 0 - 4 MB | NPU
70
+ | RegNet | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 1.239 ms | 0 - 140 MB | NPU
71
+ | RegNet | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 1.021 ms | 0 - 140 MB | NPU
72
+ | RegNet | ONNX | w8a8 | Snapdragon® X Elite | 1.137 ms | 20 - 20 MB | NPU
73
+ | RegNet | ONNX | w8a8 | Snapdragon® 8 Gen 3 Mobile | 0.87 ms | 0 - 197 MB | NPU
74
+ | RegNet | ONNX | w8a8 | Qualcomm® QCS6490 | 27.939 ms | 7 - 18 MB | CPU
75
+ | RegNet | ONNX | w8a8 | Qualcomm® QCS8550 (Proxy) | 1.184 ms | 0 - 107 MB | NPU
76
+ | RegNet | ONNX | w8a8 | Qualcomm® QCS9075 | 1.324 ms | 0 - 3 MB | NPU
77
+ | RegNet | ONNX | w8a8 | Qualcomm® QCM6690 | 18.049 ms | 8 - 17 MB | CPU
78
+ | RegNet | ONNX | w8a8 | Snapdragon® 8 Elite For Galaxy Mobile | 0.722 ms | 0 - 152 MB | NPU
79
+ | RegNet | ONNX | w8a8 | Snapdragon® 7 Gen 4 Mobile | 13.384 ms | 9 - 18 MB | CPU
80
+ | RegNet | ONNX | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 0.674 ms | 0 - 153 MB | NPU
81
+ | RegNet | QNN_DLC | float | Snapdragon® X Elite | 2.287 ms | 1 - 1 MB | NPU
82
+ | RegNet | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 1.413 ms | 0 - 128 MB | NPU
83
+ | RegNet | QNN_DLC | float | Qualcomm® QCS8275 (Proxy) | 9.987 ms | 1 - 76 MB | NPU
84
+ | RegNet | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 2.051 ms | 1 - 135 MB | NPU
85
+ | RegNet | QNN_DLC | float | Qualcomm® SA8775P | 3.263 ms | 0 - 79 MB | NPU
86
+ | RegNet | QNN_DLC | float | Qualcomm® QCS9075 | 3.058 ms | 1 - 3 MB | NPU
87
+ | RegNet | QNN_DLC | float | Qualcomm® QCS8450 (Proxy) | 3.482 ms | 0 - 115 MB | NPU
88
+ | RegNet | QNN_DLC | float | Qualcomm® SA7255P | 9.987 ms | 1 - 76 MB | NPU
89
+ | RegNet | QNN_DLC | float | Qualcomm® SA8295P | 3.5 ms | 1 - 66 MB | NPU
90
+ | RegNet | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 1.106 ms | 0 - 80 MB | NPU
91
+ | RegNet | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 0.889 ms | 1 - 81 MB | NPU
92
+ | RegNet | QNN_DLC | w8a8 | Snapdragon® X Elite | 1.071 ms | 0 - 0 MB | NPU
93
+ | RegNet | QNN_DLC | w8a8 | Snapdragon® 8 Gen 3 Mobile | 0.638 ms | 0 - 109 MB | NPU
94
+ | RegNet | QNN_DLC | w8a8 | Qualcomm® QCS6490 | 2.712 ms | 0 - 2 MB | NPU
95
+ | RegNet | QNN_DLC | w8a8 | Qualcomm® QCS8275 (Proxy) | 2.3 ms | 0 - 76 MB | NPU
96
+ | RegNet | QNN_DLC | w8a8 | Qualcomm® QCS8550 (Proxy) | 0.886 ms | 0 - 2 MB | NPU
97
+ | RegNet | QNN_DLC | w8a8 | Qualcomm® SA8775P | 1.199 ms | 0 - 78 MB | NPU
98
+ | RegNet | QNN_DLC | w8a8 | Qualcomm® QCS9075 | 1.068 ms | 0 - 2 MB | NPU
99
+ | RegNet | QNN_DLC | w8a8 | Qualcomm® QCM6690 | 7.075 ms | 0 - 196 MB | NPU
100
+ | RegNet | QNN_DLC | w8a8 | Qualcomm® QCS8450 (Proxy) | 1.295 ms | 0 - 110 MB | NPU
101
+ | RegNet | QNN_DLC | w8a8 | Qualcomm® SA7255P | 2.3 ms | 0 - 76 MB | NPU
102
+ | RegNet | QNN_DLC | w8a8 | Qualcomm® SA8295P | 1.606 ms | 0 - 76 MB | NPU
103
+ | RegNet | QNN_DLC | w8a8 | Snapdragon® 8 Elite For Galaxy Mobile | 0.493 ms | 0 - 76 MB | NPU
104
+ | RegNet | QNN_DLC | w8a8 | Snapdragon® 7 Gen 4 Mobile | 1.153 ms | 0 - 76 MB | NPU
105
+ | RegNet | QNN_DLC | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 0.428 ms | 0 - 80 MB | NPU
106
+ | RegNet | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 1.417 ms | 0 - 160 MB | NPU
107
+ | RegNet | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 9.908 ms | 0 - 104 MB | NPU
108
+ | RegNet | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 2.031 ms | 0 - 3 MB | NPU
109
+ | RegNet | TFLITE | float | Qualcomm® SA8775P | 13.985 ms | 0 - 104 MB | NPU
110
+ | RegNet | TFLITE | float | Qualcomm® QCS9075 | 3.046 ms | 0 - 42 MB | NPU
111
+ | RegNet | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 3.455 ms | 0 - 144 MB | NPU
112
+ | RegNet | TFLITE | float | Qualcomm® SA7255P | 9.908 ms | 0 - 104 MB | NPU
113
+ | RegNet | TFLITE | float | Qualcomm® SA8295P | 3.52 ms | 0 - 83 MB | NPU
114
+ | RegNet | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 1.095 ms | 0 - 106 MB | NPU
115
+ | RegNet | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 0.887 ms | 0 - 106 MB | NPU
116
+ | RegNet | TFLITE | w8a8 | Snapdragon® 8 Gen 3 Mobile | 0.536 ms | 0 - 119 MB | NPU
117
+ | RegNet | TFLITE | w8a8 | Qualcomm® QCS6490 | 2.321 ms | 0 - 22 MB | NPU
118
+ | RegNet | TFLITE | w8a8 | Qualcomm® QCS8275 (Proxy) | 1.992 ms | 0 - 76 MB | NPU
119
+ | RegNet | TFLITE | w8a8 | Qualcomm® QCS8550 (Proxy) | 0.722 ms | 0 - 2 MB | NPU
120
+ | RegNet | TFLITE | w8a8 | Qualcomm® SA8775P | 1.047 ms | 0 - 77 MB | NPU
121
+ | RegNet | TFLITE | w8a8 | Qualcomm® QCS9075 | 0.888 ms | 0 - 22 MB | NPU
122
+ | RegNet | TFLITE | w8a8 | Qualcomm® QCM6690 | 6.625 ms | 0 - 190 MB | NPU
123
+ | RegNet | TFLITE | w8a8 | Qualcomm® QCS8450 (Proxy) | 1.134 ms | 0 - 119 MB | NPU
124
+ | RegNet | TFLITE | w8a8 | Qualcomm® SA7255P | 1.992 ms | 0 - 76 MB | NPU
125
+ | RegNet | TFLITE | w8a8 | Qualcomm® SA8295P | 1.45 ms | 0 - 71 MB | NPU
126
+ | RegNet | TFLITE | w8a8 | Snapdragon® 8 Elite For Galaxy Mobile | 0.428 ms | 0 - 81 MB | NPU
127
+ | RegNet | TFLITE | w8a8 | Snapdragon® 7 Gen 4 Mobile | 0.993 ms | 0 - 72 MB | NPU
128
+ | RegNet | TFLITE | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 0.393 ms | 0 - 80 MB | NPU
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
 
130
  ## License
131
  * The license for the original implementation of RegNet can be found
132
  [here](https://github.com/pytorch/vision/blob/main/LICENSE).
133
 
 
 
134
  ## References
135
  * [Designing Network Design Spaces](https://arxiv.org/abs/2003.13678)
136
  * [Source Model Implementation](https://github.com/pytorch/vision/blob/main/torchvision/models/regnet.py)
137
 
 
 
138
  ## Community
139
  * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
140
  * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).
 
 
RegNet_float.dlc DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:92d402bbba05d07cc28489f9fcb063617603b3e30b4f0db05df9071113c26478
3
- size 61287084
 
 
 
 
RegNet_float.onnx.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:cb518d8decef2ce51d22eea24413e5eb5e5484a2c24c6e13b4902a20657223de
3
- size 57036144
 
 
 
 
RegNet_float.tflite DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:d80d1e9ae732c556626806a682fd679d53f40492e6c3a516d6b4f3c21ccb39b8
3
- size 61097956
 
 
 
 
RegNet_w8a8.dlc DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:118f8bd505d0b70c311d07f2660b435f7a0b47881470a81ecf78a09b167c530a
3
- size 17350076
 
 
 
 
RegNet_w8a8.onnx.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:67eb3ce769cfdea96712cdad9541c735785d3b778d7d202e353436b553e61d32
3
- size 28830855
 
 
 
 
RegNet_w8a8.tflite DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:daa61f13615eb207aafec0dfb448c8bb5cb6764fde9caa0e3d552ff6285948be
3
- size 16166792
 
 
 
 
tool-versions.yaml DELETED
@@ -1,4 +0,0 @@
1
- tool_versions:
2
- onnx:
3
- qairt: 2.37.1.250807093845_124904
4
- onnx_runtime: 1.23.0