qaihm-bot commited on
Commit
28fd7c7
·
verified ·
1 Parent(s): cb659dc

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

DETR-ResNet101-DC5_float.dlc DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:025318cb2f9936af7bb2dd3071085ca66430cf2ae67d6a034875269063eb0d47
3
- size 243425316
 
 
 
 
DETR-ResNet101-DC5_float.onnx.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:f6189fad4f07e8873837b2feb038a228140a15071a26f7940029e7608356da5f
3
- size 225191617
 
 
 
 
README.md CHANGED
@@ -10,234 +10,80 @@ pipeline_tag: object-detection
10
 
11
  ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/detr_resnet101_dc5/web-assets/model_demo.png)
12
 
13
- # DETR-ResNet101-DC5: Optimized for Mobile Deployment
14
- ## Transformer based object detector with ResNet101 backbone (dilated C5 stage)
15
-
16
 
17
  DETR is a machine learning model that can detect objects (trained on COCO dataset).
18
 
19
- This model is an implementation of DETR-ResNet101-DC5 found [here](https://github.com/facebookresearch/detr).
20
-
21
-
22
- This repository provides scripts to run DETR-ResNet101-DC5 on Qualcomm® devices.
23
- More details on model performance across various devices, can be found
24
- [here](https://aihub.qualcomm.com/models/detr_resnet101_dc5).
25
-
26
-
27
-
28
- ### Model Details
29
-
30
- - **Model Type:** Model_use_case.object_detection
31
- - **Model Stats:**
32
- - Model checkpoint: ResNet101-DC5
33
- - Input resolution: 480x480
34
- - Model size (float): 232 MB
35
-
36
- | Model | Precision | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit | Target Model
37
- |---|---|---|---|---|---|---|---|---|
38
- | DETR-ResNet101-DC5 | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | QNN_DLC | 212.262 ms | 5 - 492 MB | NPU | [DETR-ResNet101-DC5.dlc](https://huggingface.co/qualcomm/DETR-ResNet101-DC5/blob/main/DETR-ResNet101-DC5.dlc) |
39
- | DETR-ResNet101-DC5 | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | QNN_DLC | 96.46 ms | 5 - 460 MB | NPU | [DETR-ResNet101-DC5.dlc](https://huggingface.co/qualcomm/DETR-ResNet101-DC5/blob/main/DETR-ResNet101-DC5.dlc) |
40
- | DETR-ResNet101-DC5 | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | QNN_DLC | 50.461 ms | 5 - 7 MB | NPU | [DETR-ResNet101-DC5.dlc](https://huggingface.co/qualcomm/DETR-ResNet101-DC5/blob/main/DETR-ResNet101-DC5.dlc) |
41
- | DETR-ResNet101-DC5 | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | ONNX | 49.348 ms | 0 - 126 MB | NPU | [DETR-ResNet101-DC5.onnx.zip](https://huggingface.co/qualcomm/DETR-ResNet101-DC5/blob/main/DETR-ResNet101-DC5.onnx.zip) |
42
- | DETR-ResNet101-DC5 | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | QNN_DLC | 69.209 ms | 0 - 479 MB | NPU | [DETR-ResNet101-DC5.dlc](https://huggingface.co/qualcomm/DETR-ResNet101-DC5/blob/main/DETR-ResNet101-DC5.dlc) |
43
- | DETR-ResNet101-DC5 | float | SA7255P ADP | Qualcomm® SA7255P | QNN_DLC | 212.262 ms | 5 - 492 MB | NPU | [DETR-ResNet101-DC5.dlc](https://huggingface.co/qualcomm/DETR-ResNet101-DC5/blob/main/DETR-ResNet101-DC5.dlc) |
44
- | DETR-ResNet101-DC5 | float | SA8295P ADP | Qualcomm® SA8295P | QNN_DLC | 77.479 ms | 0 - 330 MB | NPU | [DETR-ResNet101-DC5.dlc](https://huggingface.co/qualcomm/DETR-ResNet101-DC5/blob/main/DETR-ResNet101-DC5.dlc) |
45
- | DETR-ResNet101-DC5 | float | SA8775P ADP | Qualcomm® SA8775P | QNN_DLC | 69.209 ms | 0 - 479 MB | NPU | [DETR-ResNet101-DC5.dlc](https://huggingface.co/qualcomm/DETR-ResNet101-DC5/blob/main/DETR-ResNet101-DC5.dlc) |
46
- | DETR-ResNet101-DC5 | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | QNN_DLC | 36.685 ms | 5 - 666 MB | NPU | [DETR-ResNet101-DC5.dlc](https://huggingface.co/qualcomm/DETR-ResNet101-DC5/blob/main/DETR-ResNet101-DC5.dlc) |
47
- | DETR-ResNet101-DC5 | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 36.01 ms | 5 - 546 MB | NPU | [DETR-ResNet101-DC5.onnx.zip](https://huggingface.co/qualcomm/DETR-ResNet101-DC5/blob/main/DETR-ResNet101-DC5.onnx.zip) |
48
- | DETR-ResNet101-DC5 | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | QNN_DLC | 27.856 ms | 5 - 504 MB | NPU | [DETR-ResNet101-DC5.dlc](https://huggingface.co/qualcomm/DETR-ResNet101-DC5/blob/main/DETR-ResNet101-DC5.dlc) |
49
- | DETR-ResNet101-DC5 | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | ONNX | 27.752 ms | 2 - 406 MB | NPU | [DETR-ResNet101-DC5.onnx.zip](https://huggingface.co/qualcomm/DETR-ResNet101-DC5/blob/main/DETR-ResNet101-DC5.onnx.zip) |
50
- | DETR-ResNet101-DC5 | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | QNN_DLC | 23.357 ms | 5 - 515 MB | NPU | [DETR-ResNet101-DC5.dlc](https://huggingface.co/qualcomm/DETR-ResNet101-DC5/blob/main/DETR-ResNet101-DC5.dlc) |
51
- | DETR-ResNet101-DC5 | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | ONNX | 21.769 ms | 3 - 496 MB | NPU | [DETR-ResNet101-DC5.onnx.zip](https://huggingface.co/qualcomm/DETR-ResNet101-DC5/blob/main/DETR-ResNet101-DC5.onnx.zip) |
52
- | DETR-ResNet101-DC5 | float | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN_DLC | 52.376 ms | 5 - 5 MB | NPU | [DETR-ResNet101-DC5.dlc](https://huggingface.co/qualcomm/DETR-ResNet101-DC5/blob/main/DETR-ResNet101-DC5.dlc) |
53
- | DETR-ResNet101-DC5 | float | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 50.154 ms | 116 - 116 MB | NPU | [DETR-ResNet101-DC5.onnx.zip](https://huggingface.co/qualcomm/DETR-ResNet101-DC5/blob/main/DETR-ResNet101-DC5.onnx.zip) |
54
-
55
-
56
-
57
-
58
- ## Installation
59
-
60
-
61
- Install the package via pip:
62
- ```bash
63
- # NOTE: 3.10 <= PYTHON_VERSION < 3.14 is supported.
64
- pip install "qai-hub-models[detr-resnet101-dc5]"
65
- ```
66
-
67
-
68
- ## Configure Qualcomm® AI Hub Workbench to run this model on a cloud-hosted device
69
-
70
- Sign-in to [Qualcomm® AI Hub Workbench](https://workbench.aihub.qualcomm.com/) with your
71
- Qualcomm® ID. Once signed in navigate to `Account -> Settings -> API Token`.
72
-
73
- With this API token, you can configure your client to run models on the cloud
74
- hosted devices.
75
- ```bash
76
- qai-hub configure --api_token API_TOKEN
77
- ```
78
- Navigate to [docs](https://workbench.aihub.qualcomm.com/docs/) for more information.
79
-
80
-
81
-
82
- ## Demo off target
83
-
84
- The package contains a simple end-to-end demo that downloads pre-trained
85
- weights and runs this model on a sample input.
86
-
87
- ```bash
88
- python -m qai_hub_models.models.detr_resnet101_dc5.demo
89
- ```
90
-
91
- The above demo runs a reference implementation of pre-processing, model
92
- inference, and post processing.
93
-
94
- **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
95
- environment, please add the following to your cell (instead of the above).
96
- ```
97
- %run -m qai_hub_models.models.detr_resnet101_dc5.demo
98
- ```
99
-
100
-
101
- ### Run model on a cloud-hosted device
102
-
103
- In addition to the demo, you can also run the model on a cloud-hosted Qualcomm®
104
- device. This script does the following:
105
- * Performance check on-device on a cloud-hosted device
106
- * Downloads compiled assets that can be deployed on-device for Android.
107
- * Accuracy check between PyTorch and on-device outputs.
108
-
109
- ```bash
110
- python -m qai_hub_models.models.detr_resnet101_dc5.export
111
- ```
112
 
 
113
 
 
 
114
 
115
- ## How does this work?
116
 
117
- This [export script](https://aihub.qualcomm.com/models/detr_resnet101_dc5/qai_hub_models/models/DETR-ResNet101-DC5/export.py)
118
- leverages [Qualcomm® AI Hub](https://aihub.qualcomm.com/) to optimize, validate, and deploy this model
119
- on-device. Lets go through each step below in detail:
120
 
121
- Step 1: **Compile model for on-device deployment**
 
 
 
 
122
 
123
- To compile a PyTorch model for on-device deployment, we first trace the model
124
- in memory using the `jit.trace` and then call the `submit_compile_job` API.
125
 
126
- ```python
127
- import torch
128
 
129
- import qai_hub as hub
130
- from qai_hub_models.models.detr_resnet101_dc5 import Model
131
 
132
- # Load the model
133
- torch_model = Model.from_pretrained()
 
 
134
 
135
- # Device
136
- device = hub.Device("Samsung Galaxy S25")
137
 
138
- # Trace model
139
- input_shape = torch_model.get_input_spec()
140
- sample_inputs = torch_model.sample_inputs()
141
 
142
- pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
143
 
144
- # Compile model on a specific device
145
- compile_job = hub.submit_compile_job(
146
- model=pt_model,
147
- device=device,
148
- input_specs=torch_model.get_input_spec(),
149
- )
150
 
151
- # Get target model to run on-device
152
- target_model = compile_job.get_target_model()
153
-
154
- ```
155
-
156
-
157
- Step 2: **Performance profiling on cloud-hosted device**
158
-
159
- After compiling models from step 1. Models can be profiled model on-device using the
160
- `target_model`. Note that this scripts runs the model on a device automatically
161
- provisioned in the cloud. Once the job is submitted, you can navigate to a
162
- provided job URL to view a variety of on-device performance metrics.
163
- ```python
164
- profile_job = hub.submit_profile_job(
165
- model=target_model,
166
- device=device,
167
- )
168
-
169
- ```
170
-
171
- Step 3: **Verify on-device accuracy**
172
-
173
- To verify the accuracy of the model on-device, you can run on-device inference
174
- on sample input data on the same cloud hosted device.
175
- ```python
176
- input_data = torch_model.sample_inputs()
177
- inference_job = hub.submit_inference_job(
178
- model=target_model,
179
- device=device,
180
- inputs=input_data,
181
- )
182
- on_device_output = inference_job.download_output_data()
183
-
184
- ```
185
- With the output of the model, you can compute like PSNR, relative errors or
186
- spot check the output with expected output.
187
-
188
- **Note**: This on-device profiling and inference requires access to Qualcomm®
189
- AI Hub Workbench. [Sign up for access](https://myaccount.qualcomm.com/signup).
190
-
191
-
192
-
193
- ## Run demo on a cloud-hosted device
194
-
195
- You can also run the demo on-device.
196
-
197
- ```bash
198
- python -m qai_hub_models.models.detr_resnet101_dc5.demo --eval-mode on-device
199
- ```
200
-
201
- **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
202
- environment, please add the following to your cell (instead of the above).
203
- ```
204
- %run -m qai_hub_models.models.detr_resnet101_dc5.demo -- --eval-mode on-device
205
- ```
206
-
207
-
208
- ## Deploying compiled model to Android
209
-
210
-
211
- The models can be deployed using multiple runtimes:
212
- - TensorFlow Lite (`.tflite` export): [This
213
- tutorial](https://www.tensorflow.org/lite/android/quickstart) provides a
214
- guide to deploy the .tflite model in an Android application.
215
-
216
-
217
- - QNN (`.so` export ): This [sample
218
- app](https://docs.qualcomm.com/bundle/publicresource/topics/80-63442-50/sample_app.html)
219
- provides instructions on how to use the `.so` shared library in an Android application.
220
-
221
-
222
- ## View on Qualcomm® AI Hub
223
- Get more details on DETR-ResNet101-DC5's performance across various devices [here](https://aihub.qualcomm.com/models/detr_resnet101_dc5).
224
- Explore all available models on [Qualcomm® AI Hub](https://aihub.qualcomm.com/)
225
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
 
227
  ## License
228
  * The license for the original implementation of DETR-ResNet101-DC5 can be found
229
  [here](https://github.com/facebookresearch/detr/blob/main/LICENSE).
230
 
231
-
232
-
233
  ## References
234
  * [End-to-End Object Detection with Transformers](https://arxiv.org/abs/2005.12872)
235
  * [Source Model Implementation](https://github.com/facebookresearch/detr)
236
 
237
-
238
-
239
  ## Community
240
  * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
241
  * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).
242
-
243
-
 
10
 
11
  ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/detr_resnet101_dc5/web-assets/model_demo.png)
12
 
13
+ # DETR-ResNet101-DC5: Optimized for Qualcomm Devices
 
 
14
 
15
  DETR is a machine learning model that can detect objects (trained on COCO dataset).
16
 
17
+ This is based on the implementation of DETR-ResNet101-DC5 found [here](https://github.com/facebookresearch/detr).
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/detr_resnet101_dc5) 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/detr_resnet101_dc5/releases/v0.46.1/detr_resnet101_dc5-onnx-float.zip)
32
+ | QNN_DLC | float | Universal | QAIRT 2.42 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/detr_resnet101_dc5/releases/v0.46.1/detr_resnet101_dc5-qnn_dlc-float.zip)
33
+ | 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/detr_resnet101_dc5/releases/v0.46.1/detr_resnet101_dc5-tflite-float.zip)
34
 
35
+ For more device-specific assets and performance metrics, visit **[DETR-ResNet101-DC5 on Qualcomm® AI Hub](https://aihub.qualcomm.com/models/detr_resnet101_dc5)**.
 
36
 
 
 
37
 
38
+ ### Option 2: Export with Custom Configurations
 
39
 
40
+ Use the [Qualcomm® AI Hub Models](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/detr_resnet101_dc5) Python library to compile and export the model with your own:
41
+ - Custom weights (e.g., fine-tuned checkpoints)
42
+ - Custom input shapes
43
+ - Target device and runtime configurations
44
 
45
+ This option is ideal if you need to customize the model beyond the default configuration provided here.
 
46
 
47
+ See our repository for [DETR-ResNet101-DC5 on GitHub](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/detr_resnet101_dc5) for usage instructions.
 
 
48
 
49
+ ## Model Details
50
 
51
+ **Model Type:** Model_use_case.object_detection
 
 
 
 
 
52
 
53
+ **Model Stats:**
54
+ - Model checkpoint: ResNet101-DC5
55
+ - Input resolution: 480x480
56
+ - Model size (float): 232 MB
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
+ ## Performance Summary
59
+ | Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit
60
+ |---|---|---|---|---|---|---
61
+ | DETR-ResNet101-DC5 | ONNX | float | Snapdragon® X Elite | 50.19 ms | 116 - 116 MB | NPU
62
+ | DETR-ResNet101-DC5 | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 36.327 ms | 7 - 634 MB | NPU
63
+ | DETR-ResNet101-DC5 | ONNX | float | Qualcomm® QCS8550 (Proxy) | 49.085 ms | 0 - 126 MB | NPU
64
+ | DETR-ResNet101-DC5 | ONNX | float | Qualcomm® QCS9075 | 71.995 ms | 5 - 12 MB | NPU
65
+ | DETR-ResNet101-DC5 | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 27.503 ms | 2 - 406 MB | NPU
66
+ | DETR-ResNet101-DC5 | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 21.467 ms | 1 - 494 MB | NPU
67
+ | DETR-ResNet101-DC5 | QNN_DLC | float | Snapdragon® X Elite | 54.381 ms | 5 - 5 MB | NPU
68
+ | DETR-ResNet101-DC5 | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 39.11 ms | 5 - 719 MB | NPU
69
+ | DETR-ResNet101-DC5 | QNN_DLC | float | Qualcomm® QCS8275 (Proxy) | 219.013 ms | 2 - 531 MB | NPU
70
+ | DETR-ResNet101-DC5 | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 53.499 ms | 5 - 7 MB | NPU
71
+ | DETR-ResNet101-DC5 | QNN_DLC | float | Qualcomm® SA8775P | 72.159 ms | 2 - 528 MB | NPU
72
+ | DETR-ResNet101-DC5 | QNN_DLC | float | Qualcomm® QCS9075 | 81.376 ms | 5 - 11 MB | NPU
73
+ | DETR-ResNet101-DC5 | QNN_DLC | float | Qualcomm® QCS8450 (Proxy) | 88.126 ms | 3 - 490 MB | NPU
74
+ | DETR-ResNet101-DC5 | QNN_DLC | float | Qualcomm® SA7255P | 219.013 ms | 2 - 531 MB | NPU
75
+ | DETR-ResNet101-DC5 | QNN_DLC | float | Qualcomm® SA8295P | 76.367 ms | 0 - 338 MB | NPU
76
+ | DETR-ResNet101-DC5 | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 28.632 ms | 5 - 558 MB | NPU
77
+ | DETR-ResNet101-DC5 | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 23.02 ms | 5 - 534 MB | NPU
78
 
79
  ## License
80
  * The license for the original implementation of DETR-ResNet101-DC5 can be found
81
  [here](https://github.com/facebookresearch/detr/blob/main/LICENSE).
82
 
 
 
83
  ## References
84
  * [End-to-End Object Detection with Transformers](https://arxiv.org/abs/2005.12872)
85
  * [Source Model Implementation](https://github.com/facebookresearch/detr)
86
 
 
 
87
  ## Community
88
  * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
89
  * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).
 
 
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