qaihm-bot commited on
Commit
d666216
·
verified ·
1 Parent(s): 47c789c

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/resnext101/web-assets/model_demo.png)
13
 
14
- # ResNeXt101: Optimized for Mobile Deployment
15
- ## Imagenet classifier and general purpose backbone
16
-
17
 
18
  ResNeXt101 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 ResNeXt101 found [here](https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py).
21
-
22
-
23
- This repository provides scripts to run ResNeXt101 on Qualcomm® devices.
24
- More details on model performance across various devices, can be found
25
- [here](https://aihub.qualcomm.com/models/resnext101).
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: 88.7M
36
- - Model size (float): 338 MB
37
- - Model size (w8a8): 87.3 MB
38
-
39
- | Model | Precision | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit | Target Model
40
- |---|---|---|---|---|---|---|---|---|
41
- | ResNeXt101 | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | TFLITE | 35.91 ms | 0 - 434 MB | NPU | [ResNeXt101.tflite](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.tflite) |
42
- | ResNeXt101 | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | QNN_DLC | 36.065 ms | 1 - 266 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.dlc) |
43
- | ResNeXt101 | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | TFLITE | 9.701 ms | 0 - 566 MB | NPU | [ResNeXt101.tflite](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.tflite) |
44
- | ResNeXt101 | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | QNN_DLC | 9.746 ms | 1 - 389 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.dlc) |
45
- | ResNeXt101 | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | TFLITE | 6.801 ms | 0 - 3 MB | NPU | [ResNeXt101.tflite](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.tflite) |
46
- | ResNeXt101 | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | QNN_DLC | 6.496 ms | 1 - 3 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.dlc) |
47
- | ResNeXt101 | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | ONNX | 6.653 ms | 0 - 194 MB | NPU | [ResNeXt101.onnx.zip](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.onnx.zip) |
48
- | ResNeXt101 | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | TFLITE | 10.341 ms | 0 - 446 MB | NPU | [ResNeXt101.tflite](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.tflite) |
49
- | ResNeXt101 | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | QNN_DLC | 44.715 ms | 1 - 253 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.dlc) |
50
- | ResNeXt101 | float | SA7255P ADP | Qualcomm® SA7255P | TFLITE | 35.91 ms | 0 - 434 MB | NPU | [ResNeXt101.tflite](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.tflite) |
51
- | ResNeXt101 | float | SA7255P ADP | Qualcomm® SA7255P | QNN_DLC | 36.065 ms | 1 - 266 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.dlc) |
52
- | ResNeXt101 | float | SA8295P ADP | Qualcomm® SA8295P | TFLITE | 10.859 ms | 0 - 394 MB | NPU | [ResNeXt101.tflite](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.tflite) |
53
- | ResNeXt101 | float | SA8295P ADP | Qualcomm® SA8295P | QNN_DLC | 10.799 ms | 1 - 216 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.dlc) |
54
- | ResNeXt101 | float | SA8775P ADP | Qualcomm® SA8775P | TFLITE | 10.341 ms | 0 - 446 MB | NPU | [ResNeXt101.tflite](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.tflite) |
55
- | ResNeXt101 | float | SA8775P ADP | Qualcomm® SA8775P | QNN_DLC | 44.715 ms | 1 - 253 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.dlc) |
56
- | ResNeXt101 | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | TFLITE | 4.696 ms | 0 - 614 MB | NPU | [ResNeXt101.tflite](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.tflite) |
57
- | ResNeXt101 | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | QNN_DLC | 4.88 ms | 1 - 445 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.dlc) |
58
- | ResNeXt101 | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 4.717 ms | 1 - 409 MB | NPU | [ResNeXt101.onnx.zip](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.onnx.zip) |
59
- | ResNeXt101 | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | TFLITE | 3.912 ms | 0 - 423 MB | NPU | [ResNeXt101.tflite](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.tflite) |
60
- | ResNeXt101 | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | QNN_DLC | 3.906 ms | 0 - 253 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.dlc) |
61
- | ResNeXt101 | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | ONNX | 4.055 ms | 0 - 227 MB | NPU | [ResNeXt101.onnx.zip](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.onnx.zip) |
62
- | ResNeXt101 | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | TFLITE | 3.121 ms | 0 - 434 MB | NPU | [ResNeXt101.tflite](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.tflite) |
63
- | ResNeXt101 | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | QNN_DLC | 3.136 ms | 1 - 260 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.dlc) |
64
- | ResNeXt101 | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | ONNX | 3.307 ms | 1 - 234 MB | NPU | [ResNeXt101.onnx.zip](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.onnx.zip) |
65
- | ResNeXt101 | float | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN_DLC | 6.747 ms | 1 - 1 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.dlc) |
66
- | ResNeXt101 | float | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 6.594 ms | 172 - 172 MB | NPU | [ResNeXt101.onnx.zip](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101.onnx.zip) |
67
- | ResNeXt101 | w8a8 | Dragonwing Q-6690 MTP | Qualcomm® QCM6690 | TFLITE | 26.72 ms | 2 - 352 MB | NPU | [ResNeXt101.tflite](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.tflite) |
68
- | ResNeXt101 | w8a8 | Dragonwing Q-6690 MTP | Qualcomm® QCM6690 | QNN_DLC | 29.513 ms | 0 - 366 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.dlc) |
69
- | ResNeXt101 | w8a8 | Dragonwing Q-6690 MTP | Qualcomm® QCM6690 | ONNX | 73.027 ms | 0 - 17 MB | CPU | [ResNeXt101.onnx.zip](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.onnx.zip) |
70
- | ResNeXt101 | w8a8 | Dragonwing RB3 Gen 2 Vision Kit | Qualcomm® QCS6490 | TFLITE | 8.388 ms | 0 - 89 MB | NPU | [ResNeXt101.tflite](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.tflite) |
71
- | ResNeXt101 | w8a8 | Dragonwing RB3 Gen 2 Vision Kit | Qualcomm® QCS6490 | QNN_DLC | 9.018 ms | 2 - 4 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.dlc) |
72
- | ResNeXt101 | w8a8 | Dragonwing RB3 Gen 2 Vision Kit | Qualcomm® QCS6490 | ONNX | 114.404 ms | 4 - 51 MB | CPU | [ResNeXt101.onnx.zip](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.onnx.zip) |
73
- | ResNeXt101 | w8a8 | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | TFLITE | 6.241 ms | 0 - 302 MB | NPU | [ResNeXt101.tflite](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.tflite) |
74
- | ResNeXt101 | w8a8 | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | QNN_DLC | 6.538 ms | 0 - 291 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.dlc) |
75
- | ResNeXt101 | w8a8 | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | TFLITE | 3.735 ms | 0 - 333 MB | NPU | [ResNeXt101.tflite](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.tflite) |
76
- | ResNeXt101 | w8a8 | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | QNN_DLC | 4.065 ms | 0 - 338 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.dlc) |
77
- | ResNeXt101 | w8a8 | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | TFLITE | 2.651 ms | 0 - 4 MB | NPU | [ResNeXt101.tflite](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.tflite) |
78
- | ResNeXt101 | w8a8 | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | QNN_DLC | 2.839 ms | 0 - 3 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.dlc) |
79
- | ResNeXt101 | w8a8 | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | ONNX | 3.213 ms | 0 - 99 MB | NPU | [ResNeXt101.onnx.zip](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.onnx.zip) |
80
- | ResNeXt101 | w8a8 | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | TFLITE | 3.261 ms | 0 - 300 MB | NPU | [ResNeXt101.tflite](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.tflite) |
81
- | ResNeXt101 | w8a8 | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | QNN_DLC | 13.387 ms | 0 - 291 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.dlc) |
82
- | ResNeXt101 | w8a8 | SA7255P ADP | Qualcomm® SA7255P | TFLITE | 6.241 ms | 0 - 302 MB | NPU | [ResNeXt101.tflite](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.tflite) |
83
- | ResNeXt101 | w8a8 | SA7255P ADP | Qualcomm® SA7255P | QNN_DLC | 6.538 ms | 0 - 291 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.dlc) |
84
- | ResNeXt101 | w8a8 | SA8295P ADP | Qualcomm® SA8295P | TFLITE | 4.025 ms | 0 - 300 MB | NPU | [ResNeXt101.tflite](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.tflite) |
85
- | ResNeXt101 | w8a8 | SA8295P ADP | Qualcomm® SA8295P | QNN_DLC | 4.226 ms | 0 - 294 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.dlc) |
86
- | ResNeXt101 | w8a8 | SA8775P ADP | Qualcomm® SA8775P | TFLITE | 3.261 ms | 0 - 300 MB | NPU | [ResNeXt101.tflite](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.tflite) |
87
- | ResNeXt101 | w8a8 | SA8775P ADP | Qualcomm® SA8775P | QNN_DLC | 13.387 ms | 0 - 291 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.dlc) |
88
- | ResNeXt101 | w8a8 | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | TFLITE | 1.995 ms | 0 - 343 MB | NPU | [ResNeXt101.tflite](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.tflite) |
89
- | ResNeXt101 | w8a8 | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | QNN_DLC | 2.148 ms | 0 - 337 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.dlc) |
90
- | ResNeXt101 | w8a8 | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 2.29 ms | 0 - 329 MB | NPU | [ResNeXt101.onnx.zip](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.onnx.zip) |
91
- | ResNeXt101 | w8a8 | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | TFLITE | 1.8 ms | 0 - 299 MB | NPU | [ResNeXt101.tflite](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.tflite) |
92
- | ResNeXt101 | w8a8 | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | QNN_DLC | 1.797 ms | 0 - 293 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.dlc) |
93
- | ResNeXt101 | w8a8 | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | ONNX | 2.068 ms | 0 - 284 MB | NPU | [ResNeXt101.onnx.zip](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.onnx.zip) |
94
- | ResNeXt101 | w8a8 | Snapdragon 7 Gen 4 QRD | Snapdragon® 7 Gen 4 Mobile | TFLITE | 3.984 ms | 0 - 414 MB | NPU | [ResNeXt101.tflite](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.tflite) |
95
- | ResNeXt101 | w8a8 | Snapdragon 7 Gen 4 QRD | Snapdragon® 7 Gen 4 Mobile | QNN_DLC | 4.111 ms | 0 - 326 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.dlc) |
96
- | ResNeXt101 | w8a8 | Snapdragon 7 Gen 4 QRD | Snapdragon® 7 Gen 4 Mobile | ONNX | 67.008 ms | 0 - 19 MB | CPU | [ResNeXt101.onnx.zip](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.onnx.zip) |
97
- | ResNeXt101 | w8a8 | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | TFLITE | 1.462 ms | 0 - 298 MB | NPU | [ResNeXt101.tflite](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.tflite) |
98
- | ResNeXt101 | w8a8 | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | QNN_DLC | 1.494 ms | 0 - 295 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.dlc) |
99
- | ResNeXt101 | w8a8 | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | ONNX | 1.769 ms | 0 - 286 MB | NPU | [ResNeXt101.onnx.zip](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.onnx.zip) |
100
- | ResNeXt101 | w8a8 | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN_DLC | 3.055 ms | 0 - 0 MB | NPU | [ResNeXt101.dlc](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_w8a8.dlc) |
101
- | ResNeXt101 | w8a8 | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 3.135 ms | 87 - 87 MB | NPU | [ResNeXt101.onnx.zip](https://huggingface.co/qualcomm/ResNeXt101/blob/main/ResNeXt101_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.resnext101.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.resnext101.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.resnext101.export
158
- ```
159
-
160
-
161
-
162
- ## How does this work?
163
-
164
- This [export script](https://aihub.qualcomm.com/models/resnext101/qai_hub_models/models/ResNeXt101/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.resnext101 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.resnext101.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.resnext101.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 ResNeXt101's performance across various devices [here](https://aihub.qualcomm.com/models/resnext101).
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 ResNeXt101 can be found
276
  [here](https://github.com/pytorch/vision/blob/main/LICENSE).
277
 
278
-
279
-
280
  ## References
281
  * [Aggregated Residual Transformations for Deep Neural Networks](https://arxiv.org/abs/1611.05431)
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/resnext101/web-assets/model_demo.png)
13
 
14
+ # ResNeXt101: Optimized for Qualcomm Devices
 
 
15
 
16
  ResNeXt101 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 ResNeXt101 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/resnext101) 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/resnext101/releases/v0.46.1/resnext101-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/resnext101/releases/v0.46.1/resnext101-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/resnext101/releases/v0.46.1/resnext101-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/resnext101/releases/v0.46.1/resnext101-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/resnext101/releases/v0.46.1/resnext101-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/resnext101/releases/v0.46.1/resnext101-tflite-w8a8.zip)
38
+
39
+ For more device-specific assets and performance metrics, visit **[ResNeXt101 on Qualcomm® AI Hub](https://aihub.qualcomm.com/models/resnext101)**.
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/resnext101) 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 [ResNeXt101 on GitHub](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/resnext101) 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: 88.7M
61
+ - Model size (float): 338 MB
62
+ - Model size (w8a8): 87.3 MB
63
+
64
+ ## Performance Summary
65
+ | Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit
66
+ |---|---|---|---|---|---|---
67
+ | ResNeXt101 | ONNX | float | Snapdragon® X Elite | 6.573 ms | 172 - 172 MB | NPU
68
+ | ResNeXt101 | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 4.726 ms | 0 - 405 MB | NPU
69
+ | ResNeXt101 | ONNX | float | Qualcomm® QCS8550 (Proxy) | 6.715 ms | 0 - 194 MB | NPU
70
+ | ResNeXt101 | ONNX | float | Qualcomm® QCS9075 | 10.044 ms | 0 - 4 MB | NPU
71
+ | ResNeXt101 | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 4.052 ms | 0 - 226 MB | NPU
72
+ | ResNeXt101 | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 3.262 ms | 0 - 233 MB | NPU
73
+ | ResNeXt101 | ONNX | w8a8 | Snapdragon® X Elite | 3.135 ms | 87 - 87 MB | NPU
74
+ | ResNeXt101 | ONNX | w8a8 | Snapdragon® 8 Gen 3 Mobile | 2.372 ms | 0 - 330 MB | NPU
75
+ | ResNeXt101 | ONNX | w8a8 | Qualcomm® QCS6490 | 112.485 ms | 3 - 52 MB | CPU
76
+ | ResNeXt101 | ONNX | w8a8 | Qualcomm® QCS8550 (Proxy) | 3.18 ms | 0 - 98 MB | NPU
77
+ | ResNeXt101 | ONNX | w8a8 | Qualcomm® QCS9075 | 3.411 ms | 0 - 3 MB | NPU
78
+ | ResNeXt101 | ONNX | w8a8 | Qualcomm® QCM6690 | 72.672 ms | 0 - 12 MB | CPU
79
+ | ResNeXt101 | ONNX | w8a8 | Snapdragon® 8 Elite For Galaxy Mobile | 2.153 ms | 0 - 285 MB | NPU
80
+ | ResNeXt101 | ONNX | w8a8 | Snapdragon® 7 Gen 4 Mobile | 67.614 ms | 0 - 12 MB | CPU
81
+ | ResNeXt101 | ONNX | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 1.741 ms | 0 - 288 MB | NPU
82
+ | ResNeXt101 | QNN_DLC | float | Snapdragon® X Elite | 6.785 ms | 1 - 1 MB | NPU
83
+ | ResNeXt101 | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 4.852 ms | 0 - 384 MB | NPU
84
+ | ResNeXt101 | QNN_DLC | float | Qualcomm® QCS8275 (Proxy) | 36.113 ms | 1 - 203 MB | NPU
85
+ | ResNeXt101 | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 6.579 ms | 1 - 5 MB | NPU
86
+ | ResNeXt101 | QNN_DLC | float | Qualcomm® SA8775P | 10.261 ms | 1 - 190 MB | NPU
87
+ | ResNeXt101 | QNN_DLC | float | Qualcomm® QCS9075 | 9.977 ms | 3 - 5 MB | NPU
88
+ | ResNeXt101 | QNN_DLC | float | Qualcomm® QCS8450 (Proxy) | 9.874 ms | 0 - 312 MB | NPU
89
+ | ResNeXt101 | QNN_DLC | float | Qualcomm® SA7255P | 36.113 ms | 1 - 203 MB | NPU
90
+ | ResNeXt101 | QNN_DLC | float | Qualcomm® SA8295P | 10.903 ms | 1 - 140 MB | NPU
91
+ | ResNeXt101 | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 3.984 ms | 1 - 189 MB | NPU
92
+ | ResNeXt101 | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 3.111 ms | 0 - 193 MB | NPU
93
+ | ResNeXt101 | QNN_DLC | w8a8 | Snapdragon® X Elite | 3.062 ms | 0 - 0 MB | NPU
94
+ | ResNeXt101 | QNN_DLC | w8a8 | Snapdragon® 8 Gen 3 Mobile | 2.125 ms | 0 - 252 MB | NPU
95
+ | ResNeXt101 | QNN_DLC | w8a8 | Qualcomm® QCS6490 | 9.111 ms | 2 - 4 MB | NPU
96
+ | ResNeXt101 | QNN_DLC | w8a8 | Qualcomm® QCS8275 (Proxy) | 6.538 ms | 0 - 206 MB | NPU
97
+ | ResNeXt101 | QNN_DLC | w8a8 | Qualcomm® QCS8550 (Proxy) | 2.85 ms | 0 - 2 MB | NPU
98
+ | ResNeXt101 | QNN_DLC | w8a8 | Qualcomm® SA8775P | 3.469 ms | 0 - 208 MB | NPU
99
+ | ResNeXt101 | QNN_DLC | w8a8 | Qualcomm® QCS9075 | 3.118 ms | 0 - 2 MB | NPU
100
+ | ResNeXt101 | QNN_DLC | w8a8 | Qualcomm® QCM6690 | 26.699 ms | 0 - 368 MB | NPU
101
+ | ResNeXt101 | QNN_DLC | w8a8 | Qualcomm® QCS8450 (Proxy) | 3.877 ms | 0 - 251 MB | NPU
102
+ | ResNeXt101 | QNN_DLC | w8a8 | Qualcomm® SA7255P | 6.538 ms | 0 - 206 MB | NPU
103
+ | ResNeXt101 | QNN_DLC | w8a8 | Qualcomm® SA8295P | 4.239 ms | 0 - 210 MB | NPU
104
+ | ResNeXt101 | QNN_DLC | w8a8 | Snapdragon® 8 Elite For Galaxy Mobile | 1.808 ms | 0 - 204 MB | NPU
105
+ | ResNeXt101 | QNN_DLC | w8a8 | Snapdragon® 7 Gen 4 Mobile | 4.088 ms | 0 - 245 MB | NPU
106
+ | ResNeXt101 | QNN_DLC | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 1.497 ms | 0 - 210 MB | NPU
107
+ | ResNeXt101 | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 4.673 ms | 0 - 562 MB | NPU
108
+ | ResNeXt101 | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 35.918 ms | 0 - 397 MB | NPU
109
+ | ResNeXt101 | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 6.91 ms | 0 - 3 MB | NPU
110
+ | ResNeXt101 | TFLITE | float | Qualcomm® SA8775P | 10.374 ms | 0 - 408 MB | NPU
111
+ | ResNeXt101 | TFLITE | float | Qualcomm® QCS9075 | 10.026 ms | 0 - 174 MB | NPU
112
+ | ResNeXt101 | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 9.84 ms | 0 - 517 MB | NPU
113
+ | ResNeXt101 | TFLITE | float | Qualcomm® SA7255P | 35.918 ms | 0 - 397 MB | NPU
114
+ | ResNeXt101 | TFLITE | float | Qualcomm® SA8295P | 10.865 ms | 0 - 342 MB | NPU
115
+ | ResNeXt101 | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 3.917 ms | 0 - 385 MB | NPU
116
+ | ResNeXt101 | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 3.105 ms | 0 - 395 MB | NPU
117
+ | ResNeXt101 | TFLITE | w8a8 | Snapdragon® 8 Gen 3 Mobile | 1.971 ms | 0 - 242 MB | NPU
118
+ | ResNeXt101 | TFLITE | w8a8 | Qualcomm® QCS6490 | 8.997 ms | 0 - 88 MB | NPU
119
+ | ResNeXt101 | TFLITE | w8a8 | Qualcomm® QCS8275 (Proxy) | 6.265 ms | 0 - 218 MB | NPU
120
+ | ResNeXt101 | TFLITE | w8a8 | Qualcomm® QCS8550 (Proxy) | 2.647 ms | 0 - 3 MB | NPU
121
+ | ResNeXt101 | TFLITE | w8a8 | Qualcomm® SA8775P | 3.285 ms | 0 - 219 MB | NPU
122
+ | ResNeXt101 | TFLITE | w8a8 | Qualcomm® QCS9075 | 2.926 ms | 0 - 89 MB | NPU
123
+ | ResNeXt101 | TFLITE | w8a8 | Qualcomm® QCM6690 | 24.894 ms | 0 - 363 MB | NPU
124
+ | ResNeXt101 | TFLITE | w8a8 | Qualcomm® QCS8450 (Proxy) | 3.873 ms | 0 - 253 MB | NPU
125
+ | ResNeXt101 | TFLITE | w8a8 | Qualcomm® SA7255P | 6.265 ms | 0 - 218 MB | NPU
126
+ | ResNeXt101 | TFLITE | w8a8 | Qualcomm® SA8295P | 4.065 ms | 0 - 219 MB | NPU
127
+ | ResNeXt101 | TFLITE | w8a8 | Snapdragon® 8 Elite For Galaxy Mobile | 1.774 ms | 0 - 203 MB | NPU
128
+ | ResNeXt101 | TFLITE | w8a8 | Snapdragon® 7 Gen 4 Mobile | 3.981 ms | 0 - 294 MB | NPU
129
+ | ResNeXt101 | TFLITE | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 1.447 ms | 0 - 213 MB | NPU
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
 
131
  ## License
132
  * The license for the original implementation of ResNeXt101 can be found
133
  [here](https://github.com/pytorch/vision/blob/main/LICENSE).
134
 
 
 
135
  ## References
136
  * [Aggregated Residual Transformations for Deep Neural Networks](https://arxiv.org/abs/1611.05431)
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).
 
 
ResNeXt101_float.dlc DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:4a3af384430cc64853d51b344c1bf9d74b05409b2146dffdfb0853d3afbdf114
3
- size 355016612
 
 
 
 
ResNeXt101_float.onnx.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:d18bd63086bd67d54e19b724598d39407726cd9497841edeaa0d0e7328415660
3
- size 333208587
 
 
 
 
ResNeXt101_float.tflite DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:b8e80646ee79363c3791a6bd32375af7073e65e6c2ac7fbb5a928009483975ba
3
- size 354807272
 
 
 
 
ResNeXt101_w8a8.dlc DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:48bd74ae2416ff7da1a5bb07f90f214776b0917aed0fa74181d6213d68b580f6
3
- size 94948132
 
 
 
 
ResNeXt101_w8a8.onnx.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:124818991ada4b33c97d062db7b5db0f83a6c370c694919a957def975bbb7866
3
- size 154795778
 
 
 
 
ResNeXt101_w8a8.tflite DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:6836db4b4582b6891d552da6062476f28113a45662042d15ae0ad5d730742793
3
- size 91516288
 
 
 
 
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