qaihm-bot commited on
Commit
b232769
·
verified ·
1 Parent(s): 46c6050

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

README.md CHANGED
@@ -11,280 +11,131 @@ pipeline_tag: image-classification
11
 
12
  ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/resnet101/web-assets/model_demo.png)
13
 
14
- # ResNet101: Optimized for Mobile Deployment
15
- ## Imagenet classifier and general purpose backbone
16
-
17
 
18
  ResNet101 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.
19
 
20
- This model is an implementation of ResNet101 found [here](https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py).
21
-
22
-
23
- This repository provides scripts to run ResNet101 on Qualcomm® devices.
24
- More details on model performance across various devices, can be found
25
- [here](https://aihub.qualcomm.com/models/resnet101).
26
-
27
-
28
-
29
- ### Model Details
30
-
31
- - **Model Type:** Model_use_case.image_classification
32
- - **Model Stats:**
33
- - Model checkpoint: Imagenet
34
- - Input resolution: 224x224
35
- - Number of parameters: 44.5M
36
- - Model size (float): 170 MB
37
- - Model size (w8a8): 43.9 MB
38
-
39
- | Model | Precision | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit | Target Model
40
- |---|---|---|---|---|---|---|---|---|
41
- | ResNet101 | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | TFLITE | 18.336 ms | 0 - 202 MB | NPU | [ResNet101.tflite](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.tflite) |
42
- | ResNet101 | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | QNN_DLC | 18.266 ms | 1 - 150 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.dlc) |
43
- | ResNet101 | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | TFLITE | 5.808 ms | 0 - 247 MB | NPU | [ResNet101.tflite](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.tflite) |
44
- | ResNet101 | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | QNN_DLC | 5.833 ms | 1 - 186 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.dlc) |
45
- | ResNet101 | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | TFLITE | 3.277 ms | 0 - 3 MB | NPU | [ResNet101.tflite](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.tflite) |
46
- | ResNet101 | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | QNN_DLC | 3.277 ms | 1 - 3 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.dlc) |
47
- | ResNet101 | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | ONNX | 3.337 ms | 0 - 98 MB | NPU | [ResNet101.onnx.zip](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.onnx.zip) |
48
- | ResNet101 | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | TFLITE | 5.424 ms | 0 - 201 MB | NPU | [ResNet101.tflite](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.tflite) |
49
- | ResNet101 | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | QNN_DLC | 23.494 ms | 1 - 150 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.dlc) |
50
- | ResNet101 | float | SA7255P ADP | Qualcomm® SA7255P | TFLITE | 18.336 ms | 0 - 202 MB | NPU | [ResNet101.tflite](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.tflite) |
51
- | ResNet101 | float | SA7255P ADP | Qualcomm® SA7255P | QNN_DLC | 18.266 ms | 1 - 150 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.dlc) |
52
- | ResNet101 | float | SA8295P ADP | Qualcomm® SA8295P | TFLITE | 5.503 ms | 0 - 185 MB | NPU | [ResNet101.tflite](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.tflite) |
53
- | ResNet101 | float | SA8295P ADP | Qualcomm® SA8295P | QNN_DLC | 5.53 ms | 1 - 135 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.dlc) |
54
- | ResNet101 | float | SA8775P ADP | Qualcomm® SA8775P | TFLITE | 5.424 ms | 0 - 201 MB | NPU | [ResNet101.tflite](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.tflite) |
55
- | ResNet101 | float | SA8775P ADP | Qualcomm® SA8775P | QNN_DLC | 23.494 ms | 1 - 150 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.dlc) |
56
- | ResNet101 | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | TFLITE | 2.351 ms | 0 - 264 MB | NPU | [ResNet101.tflite](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.tflite) |
57
- | ResNet101 | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | QNN_DLC | 2.377 ms | 1 - 208 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.dlc) |
58
- | ResNet101 | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 2.391 ms | 0 - 166 MB | NPU | [ResNet101.onnx.zip](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.onnx.zip) |
59
- | ResNet101 | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | TFLITE | 1.937 ms | 0 - 204 MB | NPU | [ResNet101.tflite](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.tflite) |
60
- | ResNet101 | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | QNN_DLC | 1.94 ms | 1 - 154 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.dlc) |
61
- | ResNet101 | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | ONNX | 2.022 ms | 0 - 123 MB | NPU | [ResNet101.onnx.zip](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.onnx.zip) |
62
- | ResNet101 | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | TFLITE | 1.636 ms | 0 - 204 MB | NPU | [ResNet101.tflite](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.tflite) |
63
- | ResNet101 | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | QNN_DLC | 1.653 ms | 1 - 155 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.dlc) |
64
- | ResNet101 | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | ONNX | 1.768 ms | 0 - 125 MB | NPU | [ResNet101.onnx.zip](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.onnx.zip) |
65
- | ResNet101 | float | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN_DLC | 3.506 ms | 1 - 1 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.dlc) |
66
- | ResNet101 | float | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 3.247 ms | 86 - 86 MB | NPU | [ResNet101.onnx.zip](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101.onnx.zip) |
67
- | ResNet101 | w8a8 | Dragonwing Q-6690 MTP | Qualcomm® QCM6690 | TFLITE | 11.87 ms | 0 - 175 MB | NPU | [ResNet101.tflite](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.tflite) |
68
- | ResNet101 | w8a8 | Dragonwing Q-6690 MTP | Qualcomm® QCM6690 | QNN_DLC | 13.632 ms | 0 - 177 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.dlc) |
69
- | ResNet101 | w8a8 | Dragonwing Q-6690 MTP | Qualcomm® QCM6690 | ONNX | 41.665 ms | 8 - 24 MB | CPU | [ResNet101.onnx.zip](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.onnx.zip) |
70
- | ResNet101 | w8a8 | Dragonwing RB3 Gen 2 Vision Kit | Qualcomm® QCS6490 | TFLITE | 4.306 ms | 0 - 45 MB | NPU | [ResNet101.tflite](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.tflite) |
71
- | ResNet101 | w8a8 | Dragonwing RB3 Gen 2 Vision Kit | Qualcomm® QCS6490 | QNN_DLC | 4.565 ms | 0 - 2 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.dlc) |
72
- | ResNet101 | w8a8 | Dragonwing RB3 Gen 2 Vision Kit | Qualcomm® QCS6490 | ONNX | 56.379 ms | 8 - 58 MB | CPU | [ResNet101.onnx.zip](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.onnx.zip) |
73
- | ResNet101 | w8a8 | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | TFLITE | 2.762 ms | 0 - 162 MB | NPU | [ResNet101.tflite](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.tflite) |
74
- | ResNet101 | w8a8 | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | QNN_DLC | 2.953 ms | 0 - 163 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.dlc) |
75
- | ResNet101 | w8a8 | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | TFLITE | 1.65 ms | 0 - 228 MB | NPU | [ResNet101.tflite](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.tflite) |
76
- | ResNet101 | w8a8 | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | QNN_DLC | 1.798 ms | 0 - 216 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.dlc) |
77
- | ResNet101 | w8a8 | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | TFLITE | 1.129 ms | 0 - 3 MB | NPU | [ResNet101.tflite](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.tflite) |
78
- | ResNet101 | w8a8 | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | QNN_DLC | 1.282 ms | 0 - 2 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.dlc) |
79
- | ResNet101 | w8a8 | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | ONNX | 1.5 ms | 0 - 51 MB | NPU | [ResNet101.onnx.zip](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.onnx.zip) |
80
- | ResNet101 | w8a8 | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | TFLITE | 1.333 ms | 0 - 161 MB | NPU | [ResNet101.tflite](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.tflite) |
81
- | ResNet101 | w8a8 | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | QNN_DLC | 5.233 ms | 0 - 163 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.dlc) |
82
- | ResNet101 | w8a8 | SA7255P ADP | Qualcomm® SA7255P | TFLITE | 2.762 ms | 0 - 162 MB | NPU | [ResNet101.tflite](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.tflite) |
83
- | ResNet101 | w8a8 | SA7255P ADP | Qualcomm® SA7255P | QNN_DLC | 2.953 ms | 0 - 163 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.dlc) |
84
- | ResNet101 | w8a8 | SA8295P ADP | Qualcomm® SA8295P | TFLITE | 1.76 ms | 0 - 169 MB | NPU | [ResNet101.tflite](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.tflite) |
85
- | ResNet101 | w8a8 | SA8295P ADP | Qualcomm® SA8295P | QNN_DLC | 1.909 ms | 0 - 169 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.dlc) |
86
- | ResNet101 | w8a8 | SA8775P ADP | Qualcomm® SA8775P | TFLITE | 1.333 ms | 0 - 161 MB | NPU | [ResNet101.tflite](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.tflite) |
87
- | ResNet101 | w8a8 | SA8775P ADP | Qualcomm® SA8775P | QNN_DLC | 5.233 ms | 0 - 163 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.dlc) |
88
- | ResNet101 | w8a8 | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | TFLITE | 0.868 ms | 0 - 226 MB | NPU | [ResNet101.tflite](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.tflite) |
89
- | ResNet101 | w8a8 | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | QNN_DLC | 0.969 ms | 0 - 219 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.dlc) |
90
- | ResNet101 | w8a8 | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 1.11 ms | 0 - 209 MB | NPU | [ResNet101.onnx.zip](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.onnx.zip) |
91
- | ResNet101 | w8a8 | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | TFLITE | 0.742 ms | 0 - 163 MB | NPU | [ResNet101.tflite](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.tflite) |
92
- | ResNet101 | w8a8 | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | QNN_DLC | 0.784 ms | 0 - 166 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.dlc) |
93
- | ResNet101 | w8a8 | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | ONNX | 0.948 ms | 0 - 146 MB | NPU | [ResNet101.onnx.zip](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.onnx.zip) |
94
- | ResNet101 | w8a8 | Snapdragon 7 Gen 4 QRD | Snapdragon® 7 Gen 4 Mobile | TFLITE | 1.67 ms | 0 - 173 MB | NPU | [ResNet101.tflite](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.tflite) |
95
- | ResNet101 | w8a8 | Snapdragon 7 Gen 4 QRD | Snapdragon® 7 Gen 4 Mobile | QNN_DLC | 1.806 ms | 0 - 178 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.dlc) |
96
- | ResNet101 | w8a8 | Snapdragon 7 Gen 4 QRD | Snapdragon® 7 Gen 4 Mobile | ONNX | 39.586 ms | 8 - 25 MB | CPU | [ResNet101.onnx.zip](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.onnx.zip) |
97
- | ResNet101 | w8a8 | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | TFLITE | 0.702 ms | 0 - 165 MB | NPU | [ResNet101.tflite](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.tflite) |
98
- | ResNet101 | w8a8 | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | QNN_DLC | 0.743 ms | 0 - 166 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.dlc) |
99
- | ResNet101 | w8a8 | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | ONNX | 0.926 ms | 0 - 144 MB | NPU | [ResNet101.onnx.zip](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.onnx.zip) |
100
- | ResNet101 | w8a8 | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN_DLC | 1.276 ms | 0 - 0 MB | NPU | [ResNet101.dlc](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.dlc) |
101
- | ResNet101 | w8a8 | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 1.268 ms | 44 - 44 MB | NPU | [ResNet101.onnx.zip](https://huggingface.co/qualcomm/ResNet101/blob/main/ResNet101_w8a8.onnx.zip) |
102
-
103
-
104
-
105
-
106
- ## Installation
107
-
108
-
109
- Install the package via pip:
110
- ```bash
111
- pip install qai-hub-models
112
- ```
113
-
114
-
115
- ## Configure Qualcomm® AI Hub Workbench to run this model on a cloud-hosted device
116
-
117
- Sign-in to [Qualcomm® AI Hub Workbench](https://workbench.aihub.qualcomm.com/) with your
118
- Qualcomm® ID. Once signed in navigate to `Account -> Settings -> API Token`.
119
-
120
- With this API token, you can configure your client to run models on the cloud
121
- hosted devices.
122
- ```bash
123
- qai-hub configure --api_token API_TOKEN
124
- ```
125
- Navigate to [docs](https://workbench.aihub.qualcomm.com/docs/) for more information.
126
-
127
-
128
-
129
- ## Demo off target
130
-
131
- The package contains a simple end-to-end demo that downloads pre-trained
132
- weights and runs this model on a sample input.
133
-
134
- ```bash
135
- python -m qai_hub_models.models.resnet101.demo
136
- ```
137
-
138
- The above demo runs a reference implementation of pre-processing, model
139
- inference, and post processing.
140
-
141
- **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
142
- environment, please add the following to your cell (instead of the above).
143
- ```
144
- %run -m qai_hub_models.models.resnet101.demo
145
- ```
146
-
147
-
148
- ### Run model on a cloud-hosted device
149
-
150
- In addition to the demo, you can also run the model on a cloud-hosted Qualcomm®
151
- device. This script does the following:
152
- * Performance check on-device on a cloud-hosted device
153
- * Downloads compiled assets that can be deployed on-device for Android.
154
- * Accuracy check between PyTorch and on-device outputs.
155
-
156
- ```bash
157
- python -m qai_hub_models.models.resnet101.export
158
- ```
159
-
160
-
161
-
162
- ## How does this work?
163
-
164
- This [export script](https://aihub.qualcomm.com/models/resnet101/qai_hub_models/models/ResNet101/export.py)
165
- leverages [Qualcomm® AI Hub](https://aihub.qualcomm.com/) to optimize, validate, and deploy this model
166
- on-device. Lets go through each step below in detail:
167
-
168
- Step 1: **Compile model for on-device deployment**
169
-
170
- To compile a PyTorch model for on-device deployment, we first trace the model
171
- in memory using the `jit.trace` and then call the `submit_compile_job` API.
172
-
173
- ```python
174
- import torch
175
-
176
- import qai_hub as hub
177
- from qai_hub_models.models.resnet101 import Model
178
-
179
- # Load the model
180
- torch_model = Model.from_pretrained()
181
-
182
- # Device
183
- device = hub.Device("Samsung Galaxy S25")
184
-
185
- # Trace model
186
- input_shape = torch_model.get_input_spec()
187
- sample_inputs = torch_model.sample_inputs()
188
-
189
- pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
190
-
191
- # Compile model on a specific device
192
- compile_job = hub.submit_compile_job(
193
- model=pt_model,
194
- device=device,
195
- input_specs=torch_model.get_input_spec(),
196
- )
197
-
198
- # Get target model to run on-device
199
- target_model = compile_job.get_target_model()
200
-
201
- ```
202
-
203
-
204
- Step 2: **Performance profiling on cloud-hosted device**
205
-
206
- After compiling models from step 1. Models can be profiled model on-device using the
207
- `target_model`. Note that this scripts runs the model on a device automatically
208
- provisioned in the cloud. Once the job is submitted, you can navigate to a
209
- provided job URL to view a variety of on-device performance metrics.
210
- ```python
211
- profile_job = hub.submit_profile_job(
212
- model=target_model,
213
- device=device,
214
- )
215
-
216
- ```
217
-
218
- Step 3: **Verify on-device accuracy**
219
-
220
- To verify the accuracy of the model on-device, you can run on-device inference
221
- on sample input data on the same cloud hosted device.
222
- ```python
223
- input_data = torch_model.sample_inputs()
224
- inference_job = hub.submit_inference_job(
225
- model=target_model,
226
- device=device,
227
- inputs=input_data,
228
- )
229
- on_device_output = inference_job.download_output_data()
230
-
231
- ```
232
- With the output of the model, you can compute like PSNR, relative errors or
233
- spot check the output with expected output.
234
-
235
- **Note**: This on-device profiling and inference requires access to Qualcomm®
236
- AI Hub Workbench. [Sign up for access](https://myaccount.qualcomm.com/signup).
237
-
238
-
239
-
240
- ## Run demo on a cloud-hosted device
241
-
242
- You can also run the demo on-device.
243
-
244
- ```bash
245
- python -m qai_hub_models.models.resnet101.demo --eval-mode on-device
246
- ```
247
-
248
- **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
249
- environment, please add the following to your cell (instead of the above).
250
- ```
251
- %run -m qai_hub_models.models.resnet101.demo -- --eval-mode on-device
252
- ```
253
-
254
-
255
- ## Deploying compiled model to Android
256
-
257
-
258
- The models can be deployed using multiple runtimes:
259
- - TensorFlow Lite (`.tflite` export): [This
260
- tutorial](https://www.tensorflow.org/lite/android/quickstart) provides a
261
- guide to deploy the .tflite model in an Android application.
262
-
263
-
264
- - QNN (`.so` export ): This [sample
265
- app](https://docs.qualcomm.com/bundle/publicresource/topics/80-63442-50/sample_app.html)
266
- provides instructions on how to use the `.so` shared library in an Android application.
267
-
268
-
269
- ## View on Qualcomm® AI Hub
270
- Get more details on ResNet101's performance across various devices [here](https://aihub.qualcomm.com/models/resnet101).
271
- Explore all available models on [Qualcomm® AI Hub](https://aihub.qualcomm.com/)
272
-
273
 
274
  ## License
275
  * The license for the original implementation of ResNet101 can be found
276
  [here](https://github.com/pytorch/vision/blob/main/LICENSE).
277
 
278
-
279
-
280
  ## References
281
  * [Deep Residual Learning for Image Recognition](https://arxiv.org/abs/1512.03385)
282
  * [Source Model Implementation](https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py)
283
 
284
-
285
-
286
  ## Community
287
  * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
288
  * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).
289
-
290
-
 
11
 
12
  ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/resnet101/web-assets/model_demo.png)
13
 
14
+ # ResNet101: Optimized for Qualcomm Devices
 
 
15
 
16
  ResNet101 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.
17
 
18
+ This is based on the implementation of ResNet101 found [here](https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py).
19
+ 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/resnet101) library to export with custom configurations. More details on model performance across various devices, can be found [here](#performance-summary).
20
+
21
+ 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.
22
+
23
+ ## Getting Started
24
+ There are two ways to deploy this model on your device:
25
+
26
+ ### Option 1: Download Pre-Exported Models
27
+
28
+ Below are pre-exported model assets ready for deployment.
29
+
30
+ | Runtime | Precision | Chipset | SDK Versions | Download |
31
+ |---|---|---|---|---|
32
+ | 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/resnet101/releases/v0.46.1/resnet101-onnx-float.zip)
33
+ | 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/resnet101/releases/v0.46.1/resnet101-onnx-w8a8.zip)
34
+ | QNN_DLC | float | Universal | QAIRT 2.42 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/resnet101/releases/v0.46.1/resnet101-qnn_dlc-float.zip)
35
+ | QNN_DLC | w8a8 | Universal | QAIRT 2.42 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/resnet101/releases/v0.46.1/resnet101-qnn_dlc-w8a8.zip)
36
+ | 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/resnet101/releases/v0.46.1/resnet101-tflite-float.zip)
37
+ | 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/resnet101/releases/v0.46.1/resnet101-tflite-w8a8.zip)
38
+
39
+ For more device-specific assets and performance metrics, visit **[ResNet101 on Qualcomm® AI Hub](https://aihub.qualcomm.com/models/resnet101)**.
40
+
41
+
42
+ ### Option 2: Export with Custom Configurations
43
+
44
+ Use the [Qualcomm® AI Hub Models](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/resnet101) Python library to compile and export the model with your own:
45
+ - Custom weights (e.g., fine-tuned checkpoints)
46
+ - Custom input shapes
47
+ - Target device and runtime configurations
48
+
49
+ This option is ideal if you need to customize the model beyond the default configuration provided here.
50
+
51
+ See our repository for [ResNet101 on GitHub](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/resnet101) for usage instructions.
52
+
53
+ ## Model Details
54
+
55
+ **Model Type:** Model_use_case.image_classification
56
+
57
+ **Model Stats:**
58
+ - Model checkpoint: Imagenet
59
+ - Input resolution: 224x224
60
+ - Number of parameters: 44.5M
61
+ - Model size (float): 170 MB
62
+ - Model size (w8a8): 43.9 MB
63
+
64
+ ## Performance Summary
65
+ | Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit
66
+ |---|---|---|---|---|---|---
67
+ | ResNet101 | ONNX | float | Snapdragon® X Elite | 3.247 ms | 86 - 86 MB | NPU
68
+ | ResNet101 | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 2.471 ms | 0 - 167 MB | NPU
69
+ | ResNet101 | ONNX | float | Qualcomm® QCS8550 (Proxy) | 3.378 ms | 0 - 180 MB | NPU
70
+ | ResNet101 | ONNX | float | Qualcomm® QCS9075 | 5.374 ms | 0 - 4 MB | NPU
71
+ | ResNet101 | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 2.029 ms | 0 - 124 MB | NPU
72
+ | ResNet101 | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 1.767 ms | 0 - 125 MB | NPU
73
+ | ResNet101 | ONNX | w8a8 | Snapdragon® X Elite | 1.283 ms | 44 - 44 MB | NPU
74
+ | ResNet101 | ONNX | w8a8 | Snapdragon® 8 Gen 3 Mobile | 1.154 ms | 0 - 208 MB | NPU
75
+ | ResNet101 | ONNX | w8a8 | Qualcomm® QCS6490 | 56.63 ms | 8 - 56 MB | CPU
76
+ | ResNet101 | ONNX | w8a8 | Qualcomm® QCS8550 (Proxy) | 1.499 ms | 0 - 51 MB | NPU
77
+ | ResNet101 | ONNX | w8a8 | Qualcomm® QCS9075 | 1.588 ms | 0 - 3 MB | NPU
78
+ | ResNet101 | ONNX | w8a8 | Qualcomm® QCM6690 | 41.586 ms | 11 - 22 MB | CPU
79
+ | ResNet101 | ONNX | w8a8 | Snapdragon® 8 Elite For Galaxy Mobile | 0.979 ms | 0 - 145 MB | NPU
80
+ | ResNet101 | ONNX | w8a8 | Snapdragon® 7 Gen 4 Mobile | 38.871 ms | 9 - 19 MB | CPU
81
+ | ResNet101 | ONNX | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 0.927 ms | 0 - 146 MB | NPU
82
+ | ResNet101 | QNN_DLC | float | Snapdragon® X Elite | 3.531 ms | 1 - 1 MB | NPU
83
+ | ResNet101 | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 2.406 ms | 0 - 125 MB | NPU
84
+ | ResNet101 | QNN_DLC | float | Qualcomm® QCS8275 (Proxy) | 18.336 ms | 1 - 66 MB | NPU
85
+ | ResNet101 | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 3.334 ms | 1 - 3 MB | NPU
86
+ | ResNet101 | QNN_DLC | float | Qualcomm® SA8775P | 5.468 ms | 1 - 67 MB | NPU
87
+ | ResNet101 | QNN_DLC | float | Qualcomm® QCS9075 | 5.286 ms | 1 - 3 MB | NPU
88
+ | ResNet101 | QNN_DLC | float | Qualcomm® QCS8450 (Proxy) | 5.937 ms | 0 - 91 MB | NPU
89
+ | ResNet101 | QNN_DLC | float | Qualcomm® SA7255P | 18.336 ms | 1 - 66 MB | NPU
90
+ | ResNet101 | QNN_DLC | float | Qualcomm® SA8295P | 5.604 ms | 1 - 41 MB | NPU
91
+ | ResNet101 | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 1.961 ms | 1 - 69 MB | NPU
92
+ | ResNet101 | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 1.647 ms | 1 - 70 MB | NPU
93
+ | ResNet101 | QNN_DLC | w8a8 | Snapdragon® X Elite | 1.271 ms | 0 - 0 MB | NPU
94
+ | ResNet101 | QNN_DLC | w8a8 | Snapdragon® 8 Gen 3 Mobile | 0.986 ms | 0 - 119 MB | NPU
95
+ | ResNet101 | QNN_DLC | w8a8 | Qualcomm® QCS6490 | 4.554 ms | 0 - 2 MB | NPU
96
+ | ResNet101 | QNN_DLC | w8a8 | Qualcomm® QCS8275 (Proxy) | 2.953 ms | 0 - 70 MB | NPU
97
+ | ResNet101 | QNN_DLC | w8a8 | Qualcomm® QCS8550 (Proxy) | 1.268 ms | 0 - 2 MB | NPU
98
+ | ResNet101 | QNN_DLC | w8a8 | Qualcomm® SA8775P | 5.196 ms | 0 - 70 MB | NPU
99
+ | ResNet101 | QNN_DLC | w8a8 | Qualcomm® QCS9075 | 1.31 ms | 2 - 4 MB | NPU
100
+ | ResNet101 | QNN_DLC | w8a8 | Qualcomm® QCM6690 | 11.7 ms | 1 - 194 MB | NPU
101
+ | ResNet101 | QNN_DLC | w8a8 | Qualcomm® QCS8450 (Proxy) | 1.793 ms | 0 - 121 MB | NPU
102
+ | ResNet101 | QNN_DLC | w8a8 | Qualcomm® SA7255P | 2.953 ms | 0 - 70 MB | NPU
103
+ | ResNet101 | QNN_DLC | w8a8 | Qualcomm® SA8295P | 1.949 ms | 0 - 68 MB | NPU
104
+ | ResNet101 | QNN_DLC | w8a8 | Snapdragon® 8 Elite For Galaxy Mobile | 0.79 ms | 0 - 70 MB | NPU
105
+ | ResNet101 | QNN_DLC | w8a8 | Snapdragon® 7 Gen 4 Mobile | 1.8 ms | 0 - 80 MB | NPU
106
+ | ResNet101 | QNN_DLC | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 0.741 ms | 0 - 72 MB | NPU
107
+ | ResNet101 | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 2.399 ms | 0 - 192 MB | NPU
108
+ | ResNet101 | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 18.357 ms | 0 - 128 MB | NPU
109
+ | ResNet101 | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 3.302 ms | 0 - 3 MB | NPU
110
+ | ResNet101 | TFLITE | float | Qualcomm® SA8775P | 5.434 ms | 0 - 130 MB | NPU
111
+ | ResNet101 | TFLITE | float | Qualcomm® QCS9075 | 5.286 ms | 0 - 88 MB | NPU
112
+ | ResNet101 | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 5.891 ms | 0 - 158 MB | NPU
113
+ | ResNet101 | TFLITE | float | Qualcomm® SA7255P | 18.357 ms | 0 - 128 MB | NPU
114
+ | ResNet101 | TFLITE | float | Qualcomm® SA8295P | 5.631 ms | 0 - 97 MB | NPU
115
+ | ResNet101 | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 1.95 ms | 0 - 129 MB | NPU
116
+ | ResNet101 | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 1.635 ms | 0 - 132 MB | NPU
117
+ | ResNet101 | TFLITE | w8a8 | Snapdragon® 8 Gen 3 Mobile | 0.867 ms | 0 - 134 MB | NPU
118
+ | ResNet101 | TFLITE | w8a8 | Qualcomm® QCS6490 | 4.312 ms | 0 - 45 MB | NPU
119
+ | ResNet101 | TFLITE | w8a8 | Qualcomm® QCS8275 (Proxy) | 2.731 ms | 0 - 68 MB | NPU
120
+ | ResNet101 | TFLITE | w8a8 | Qualcomm® QCS8550 (Proxy) | 1.141 ms | 0 - 1 MB | NPU
121
+ | ResNet101 | TFLITE | w8a8 | Qualcomm® SA8775P | 1.331 ms | 0 - 70 MB | NPU
122
+ | ResNet101 | TFLITE | w8a8 | Qualcomm® QCS9075 | 1.181 ms | 0 - 45 MB | NPU
123
+ | ResNet101 | TFLITE | w8a8 | Qualcomm® QCM6690 | 11.804 ms | 0 - 195 MB | NPU
124
+ | ResNet101 | TFLITE | w8a8 | Qualcomm® QCS8450 (Proxy) | 1.661 ms | 0 - 137 MB | NPU
125
+ | ResNet101 | TFLITE | w8a8 | Qualcomm® SA7255P | 2.731 ms | 0 - 68 MB | NPU
126
+ | ResNet101 | TFLITE | w8a8 | Qualcomm® SA8295P | 1.771 ms | 0 - 66 MB | NPU
127
+ | ResNet101 | TFLITE | w8a8 | Snapdragon® 8 Elite For Galaxy Mobile | 0.742 ms | 0 - 67 MB | NPU
128
+ | ResNet101 | TFLITE | w8a8 | Snapdragon® 7 Gen 4 Mobile | 1.666 ms | 0 - 75 MB | NPU
129
+ | ResNet101 | TFLITE | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 0.702 ms | 0 - 70 MB | NPU
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
 
131
  ## License
132
  * The license for the original implementation of ResNet101 can be found
133
  [here](https://github.com/pytorch/vision/blob/main/LICENSE).
134
 
 
 
135
  ## References
136
  * [Deep Residual Learning for Image Recognition](https://arxiv.org/abs/1512.03385)
137
  * [Source Model Implementation](https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py)
138
 
 
 
139
  ## Community
140
  * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
141
  * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).
 
 
ResNet101_float.dlc DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:eaf603fa98f89c9413b4bcfe0872ad24140e0f9334afe55372922c2f3615c742
3
- size 178242980
 
 
 
 
ResNet101_float.onnx.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:702a84f015a3b76c72a5a3793238f2ed5527678eeda93edc7db5eaa503241633
3
- size 166416572
 
 
 
 
ResNet101_float.tflite DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:9479f0b5db43a61ba837939b31b14d58c491344e53002bea80be6436df7f2244
3
- size 178034416
 
 
 
 
ResNet101_w8a8.dlc DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:31cc741b1872c42403ff26cf3dc6fb731535db9d4bef0637ee2d5cd3eec70499
3
- size 47877412
 
 
 
 
ResNet101_w8a8.onnx.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:183dc59e56ecf3c37d3715c955f86ae9d56a7a05f720d9514bc4c3e4941f9d6d
3
- size 78915502
 
 
 
 
ResNet101_w8a8.tflite DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:a44aa1e80604a5535c6901ab81b9d5e10c93d85bb41f3747b2d12d915aecaf47
3
- size 46007704
 
 
 
 
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