qaihm-bot commited on
Commit
ff84694
·
verified ·
1 Parent(s): fb600f6

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

README.md CHANGED
@@ -9,280 +9,131 @@ pipeline_tag: image-to-image
9
 
10
  ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/xlsr/web-assets/model_demo.png)
11
 
12
- # XLSR: Optimized for Mobile Deployment
13
- ## Upscale images in real time
14
-
15
 
16
  XLSR is designed for lightweight real-time upscaling of images.
17
 
18
- This model is an implementation of XLSR found [here](https://github.com/quic/aimet-model-zoo/tree/develop/aimet_zoo_torch/xlsr).
19
-
20
-
21
- This repository provides scripts to run XLSR on Qualcomm® devices.
22
- More details on model performance across various devices, can be found
23
- [here](https://aihub.qualcomm.com/models/xlsr).
24
-
25
-
26
-
27
- ### Model Details
28
-
29
- - **Model Type:** Model_use_case.super_resolution
30
- - **Model Stats:**
31
- - Model checkpoint: xlsr_3x_checkpoint
32
- - Input resolution: 128x128
33
- - Number of parameters: 28.0K
34
- - Model size (float): 115 KB
35
- - Model size (w8a8): 45.6 KB
36
-
37
- | Model | Precision | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit | Target Model
38
- |---|---|---|---|---|---|---|---|---|
39
- | XLSR | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | TFLITE | 4.583 ms | 0 - 114 MB | NPU | [XLSR.tflite](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.tflite) |
40
- | XLSR | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | QNN_DLC | 2.173 ms | 0 - 115 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.dlc) |
41
- | XLSR | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | TFLITE | 2.561 ms | 0 - 128 MB | NPU | [XLSR.tflite](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.tflite) |
42
- | XLSR | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | QNN_DLC | 1.045 ms | 0 - 133 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.dlc) |
43
- | XLSR | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | TFLITE | 2.222 ms | 0 - 2 MB | NPU | [XLSR.tflite](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.tflite) |
44
- | XLSR | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | QNN_DLC | 0.815 ms | 0 - 3 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.dlc) |
45
- | XLSR | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | ONNX | 1.244 ms | 0 - 3 MB | NPU | [XLSR.onnx.zip](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.onnx.zip) |
46
- | XLSR | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | TFLITE | 2.663 ms | 0 - 115 MB | NPU | [XLSR.tflite](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.tflite) |
47
- | XLSR | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | QNN_DLC | 1.139 ms | 0 - 115 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.dlc) |
48
- | XLSR | float | SA7255P ADP | Qualcomm® SA7255P | TFLITE | 4.583 ms | 0 - 114 MB | NPU | [XLSR.tflite](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.tflite) |
49
- | XLSR | float | SA7255P ADP | Qualcomm® SA7255P | QNN_DLC | 2.173 ms | 0 - 115 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.dlc) |
50
- | XLSR | float | SA8295P ADP | Qualcomm® SA8295P | TFLITE | 3.263 ms | 0 - 120 MB | NPU | [XLSR.tflite](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.tflite) |
51
- | XLSR | float | SA8295P ADP | Qualcomm® SA8295P | QNN_DLC | 1.39 ms | 0 - 120 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.dlc) |
52
- | XLSR | float | SA8775P ADP | Qualcomm® SA8775P | TFLITE | 2.663 ms | 0 - 115 MB | NPU | [XLSR.tflite](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.tflite) |
53
- | XLSR | float | SA8775P ADP | Qualcomm® SA8775P | QNN_DLC | 1.139 ms | 0 - 115 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.dlc) |
54
- | XLSR | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | TFLITE | 1.446 ms | 0 - 133 MB | NPU | [XLSR.tflite](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.tflite) |
55
- | XLSR | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | QNN_DLC | 0.47 ms | 0 - 133 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.dlc) |
56
- | XLSR | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 0.762 ms | 0 - 104 MB | NPU | [XLSR.onnx.zip](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.onnx.zip) |
57
- | XLSR | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | TFLITE | 0.995 ms | 0 - 118 MB | NPU | [XLSR.tflite](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.tflite) |
58
- | XLSR | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | QNN_DLC | 0.35 ms | 0 - 121 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.dlc) |
59
- | XLSR | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | ONNX | 0.583 ms | 0 - 90 MB | NPU | [XLSR.onnx.zip](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.onnx.zip) |
60
- | XLSR | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | TFLITE | 0.809 ms | 0 - 117 MB | NPU | [XLSR.tflite](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.tflite) |
61
- | XLSR | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | QNN_DLC | 0.349 ms | 0 - 119 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.dlc) |
62
- | XLSR | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | ONNX | 0.534 ms | 0 - 90 MB | NPU | [XLSR.onnx.zip](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.onnx.zip) |
63
- | XLSR | float | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN_DLC | 0.903 ms | 0 - 0 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.dlc) |
64
- | XLSR | float | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 1.075 ms | 8 - 8 MB | NPU | [XLSR.onnx.zip](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR.onnx.zip) |
65
- | XLSR | w8a8 | Dragonwing Q-6690 MTP | Qualcomm® QCM6690 | TFLITE | 1.588 ms | 0 - 120 MB | NPU | [XLSR.tflite](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.tflite) |
66
- | XLSR | w8a8 | Dragonwing Q-6690 MTP | Qualcomm® QCM6690 | QNN_DLC | 1.636 ms | 0 - 119 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.dlc) |
67
- | XLSR | w8a8 | Dragonwing Q-6690 MTP | Qualcomm® QCM6690 | ONNX | 8.37 ms | 19 - 30 MB | CPU | [XLSR.onnx.zip](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.onnx.zip) |
68
- | XLSR | w8a8 | Dragonwing RB3 Gen 2 Vision Kit | Qualcomm® QCS6490 | TFLITE | 1.089 ms | 0 - 3 MB | NPU | [XLSR.tflite](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.tflite) |
69
- | XLSR | w8a8 | Dragonwing RB3 Gen 2 Vision Kit | Qualcomm® QCS6490 | QNN_DLC | 1.415 ms | 0 - 2 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.dlc) |
70
- | XLSR | w8a8 | Dragonwing RB3 Gen 2 Vision Kit | Qualcomm® QCS6490 | ONNX | 11.805 ms | 19 - 22 MB | CPU | [XLSR.onnx.zip](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.onnx.zip) |
71
- | XLSR | w8a8 | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | TFLITE | 0.878 ms | 0 - 115 MB | NPU | [XLSR.tflite](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.tflite) |
72
- | XLSR | w8a8 | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | QNN_DLC | 0.9 ms | 0 - 114 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.dlc) |
73
- | XLSR | w8a8 | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | TFLITE | 0.555 ms | 0 - 131 MB | NPU | [XLSR.tflite](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.tflite) |
74
- | XLSR | w8a8 | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | QNN_DLC | 0.541 ms | 0 - 133 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.dlc) |
75
- | XLSR | w8a8 | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | TFLITE | 0.385 ms | 0 - 3 MB | NPU | [XLSR.tflite](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.tflite) |
76
- | XLSR | w8a8 | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | QNN_DLC | 0.395 ms | 0 - 3 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.dlc) |
77
- | XLSR | w8a8 | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | ONNX | 1.337 ms | 0 - 3 MB | NPU | [XLSR.onnx.zip](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.onnx.zip) |
78
- | XLSR | w8a8 | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | TFLITE | 2.103 ms | 0 - 114 MB | NPU | [XLSR.tflite](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.tflite) |
79
- | XLSR | w8a8 | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | QNN_DLC | 0.571 ms | 0 - 114 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.dlc) |
80
- | XLSR | w8a8 | SA7255P ADP | Qualcomm® SA7255P | TFLITE | 0.878 ms | 0 - 115 MB | NPU | [XLSR.tflite](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.tflite) |
81
- | XLSR | w8a8 | SA7255P ADP | Qualcomm® SA7255P | QNN_DLC | 0.9 ms | 0 - 114 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.dlc) |
82
- | XLSR | w8a8 | SA8295P ADP | Qualcomm® SA8295P | TFLITE | 0.768 ms | 0 - 121 MB | NPU | [XLSR.tflite](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.tflite) |
83
- | XLSR | w8a8 | SA8295P ADP | Qualcomm® SA8295P | QNN_DLC | 0.765 ms | 0 - 120 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.dlc) |
84
- | XLSR | w8a8 | SA8775P ADP | Qualcomm® SA8775P | TFLITE | 2.103 ms | 0 - 114 MB | NPU | [XLSR.tflite](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.tflite) |
85
- | XLSR | w8a8 | SA8775P ADP | Qualcomm® SA8775P | QNN_DLC | 0.571 ms | 0 - 114 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.dlc) |
86
- | XLSR | w8a8 | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | TFLITE | 0.233 ms | 0 - 127 MB | NPU | [XLSR.tflite](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.tflite) |
87
- | XLSR | w8a8 | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | QNN_DLC | 0.236 ms | 0 - 128 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.dlc) |
88
- | XLSR | w8a8 | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 0.846 ms | 0 - 103 MB | NPU | [XLSR.onnx.zip](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.onnx.zip) |
89
- | XLSR | w8a8 | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | TFLITE | 0.212 ms | 0 - 119 MB | NPU | [XLSR.tflite](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.tflite) |
90
- | XLSR | w8a8 | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | QNN_DLC | 0.187 ms | 0 - 118 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.dlc) |
91
- | XLSR | w8a8 | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | ONNX | 0.693 ms | 0 - 94 MB | NPU | [XLSR.onnx.zip](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.onnx.zip) |
92
- | XLSR | w8a8 | Snapdragon 7 Gen 4 QRD | Snapdragon® 7 Gen 4 Mobile | TFLITE | 0.411 ms | 0 - 119 MB | NPU | [XLSR.tflite](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.tflite) |
93
- | XLSR | w8a8 | Snapdragon 7 Gen 4 QRD | Snapdragon® 7 Gen 4 Mobile | QNN_DLC | 0.41 ms | 0 - 118 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.dlc) |
94
- | XLSR | w8a8 | Snapdragon 7 Gen 4 QRD | Snapdragon® 7 Gen 4 Mobile | ONNX | 7.454 ms | 19 - 34 MB | CPU | [XLSR.onnx.zip](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.onnx.zip) |
95
- | XLSR | w8a8 | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | TFLITE | 0.168 ms | 0 - 118 MB | NPU | [XLSR.tflite](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.tflite) |
96
- | XLSR | w8a8 | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | QNN_DLC | 0.181 ms | 0 - 117 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.dlc) |
97
- | XLSR | w8a8 | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | ONNX | 0.646 ms | 0 - 91 MB | NPU | [XLSR.onnx.zip](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.onnx.zip) |
98
- | XLSR | w8a8 | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN_DLC | 0.482 ms | 0 - 0 MB | NPU | [XLSR.dlc](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.dlc) |
99
- | XLSR | w8a8 | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 1.227 ms | 9 - 9 MB | NPU | [XLSR.onnx.zip](https://huggingface.co/qualcomm/XLSR/blob/main/XLSR_w8a8.onnx.zip) |
100
-
101
-
102
-
103
-
104
- ## Installation
105
-
106
-
107
- Install the package via pip:
108
- ```bash
109
- pip install qai-hub-models
110
- ```
111
-
112
-
113
- ## Configure Qualcomm® AI Hub Workbench to run this model on a cloud-hosted device
114
-
115
- Sign-in to [Qualcomm® AI Hub Workbench](https://workbench.aihub.qualcomm.com/) with your
116
- Qualcomm® ID. Once signed in navigate to `Account -> Settings -> API Token`.
117
-
118
- With this API token, you can configure your client to run models on the cloud
119
- hosted devices.
120
- ```bash
121
- qai-hub configure --api_token API_TOKEN
122
- ```
123
- Navigate to [docs](https://workbench.aihub.qualcomm.com/docs/) for more information.
124
-
125
-
126
-
127
- ## Demo off target
128
-
129
- The package contains a simple end-to-end demo that downloads pre-trained
130
- weights and runs this model on a sample input.
131
-
132
- ```bash
133
- python -m qai_hub_models.models.xlsr.demo
134
- ```
135
-
136
- The above demo runs a reference implementation of pre-processing, model
137
- inference, and post processing.
138
-
139
- **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
140
- environment, please add the following to your cell (instead of the above).
141
- ```
142
- %run -m qai_hub_models.models.xlsr.demo
143
- ```
144
-
145
-
146
- ### Run model on a cloud-hosted device
147
-
148
- In addition to the demo, you can also run the model on a cloud-hosted Qualcomm®
149
- device. This script does the following:
150
- * Performance check on-device on a cloud-hosted device
151
- * Downloads compiled assets that can be deployed on-device for Android.
152
- * Accuracy check between PyTorch and on-device outputs.
153
-
154
- ```bash
155
- python -m qai_hub_models.models.xlsr.export
156
- ```
157
-
158
-
159
-
160
- ## How does this work?
161
-
162
- This [export script](https://aihub.qualcomm.com/models/xlsr/qai_hub_models/models/XLSR/export.py)
163
- leverages [Qualcomm® AI Hub](https://aihub.qualcomm.com/) to optimize, validate, and deploy this model
164
- on-device. Lets go through each step below in detail:
165
-
166
- Step 1: **Compile model for on-device deployment**
167
-
168
- To compile a PyTorch model for on-device deployment, we first trace the model
169
- in memory using the `jit.trace` and then call the `submit_compile_job` API.
170
-
171
- ```python
172
- import torch
173
-
174
- import qai_hub as hub
175
- from qai_hub_models.models.xlsr import Model
176
-
177
- # Load the model
178
- torch_model = Model.from_pretrained()
179
-
180
- # Device
181
- device = hub.Device("Samsung Galaxy S25")
182
-
183
- # Trace model
184
- input_shape = torch_model.get_input_spec()
185
- sample_inputs = torch_model.sample_inputs()
186
-
187
- pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
188
-
189
- # Compile model on a specific device
190
- compile_job = hub.submit_compile_job(
191
- model=pt_model,
192
- device=device,
193
- input_specs=torch_model.get_input_spec(),
194
- )
195
-
196
- # Get target model to run on-device
197
- target_model = compile_job.get_target_model()
198
-
199
- ```
200
-
201
-
202
- Step 2: **Performance profiling on cloud-hosted device**
203
-
204
- After compiling models from step 1. Models can be profiled model on-device using the
205
- `target_model`. Note that this scripts runs the model on a device automatically
206
- provisioned in the cloud. Once the job is submitted, you can navigate to a
207
- provided job URL to view a variety of on-device performance metrics.
208
- ```python
209
- profile_job = hub.submit_profile_job(
210
- model=target_model,
211
- device=device,
212
- )
213
-
214
- ```
215
-
216
- Step 3: **Verify on-device accuracy**
217
-
218
- To verify the accuracy of the model on-device, you can run on-device inference
219
- on sample input data on the same cloud hosted device.
220
- ```python
221
- input_data = torch_model.sample_inputs()
222
- inference_job = hub.submit_inference_job(
223
- model=target_model,
224
- device=device,
225
- inputs=input_data,
226
- )
227
- on_device_output = inference_job.download_output_data()
228
-
229
- ```
230
- With the output of the model, you can compute like PSNR, relative errors or
231
- spot check the output with expected output.
232
-
233
- **Note**: This on-device profiling and inference requires access to Qualcomm®
234
- AI Hub Workbench. [Sign up for access](https://myaccount.qualcomm.com/signup).
235
-
236
-
237
-
238
- ## Run demo on a cloud-hosted device
239
-
240
- You can also run the demo on-device.
241
-
242
- ```bash
243
- python -m qai_hub_models.models.xlsr.demo --eval-mode on-device
244
- ```
245
-
246
- **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
247
- environment, please add the following to your cell (instead of the above).
248
- ```
249
- %run -m qai_hub_models.models.xlsr.demo -- --eval-mode on-device
250
- ```
251
-
252
-
253
- ## Deploying compiled model to Android
254
-
255
-
256
- The models can be deployed using multiple runtimes:
257
- - TensorFlow Lite (`.tflite` export): [This
258
- tutorial](https://www.tensorflow.org/lite/android/quickstart) provides a
259
- guide to deploy the .tflite model in an Android application.
260
-
261
-
262
- - QNN (`.so` export ): This [sample
263
- app](https://docs.qualcomm.com/bundle/publicresource/topics/80-63442-50/sample_app.html)
264
- provides instructions on how to use the `.so` shared library in an Android application.
265
-
266
-
267
- ## View on Qualcomm® AI Hub
268
- Get more details on XLSR's performance across various devices [here](https://aihub.qualcomm.com/models/xlsr).
269
- Explore all available models on [Qualcomm® AI Hub](https://aihub.qualcomm.com/)
270
-
271
 
272
  ## License
273
  * The license for the original implementation of XLSR can be found
274
  [here](https://github.com/quic/aimet-model-zoo/blob/develop/LICENSE.pdf).
275
 
276
-
277
-
278
  ## References
279
  * [Extremely Lightweight Quantization Robust Real-Time Single-Image Super Resolution for Mobile Devices](https://arxiv.org/abs/2105.10288)
280
  * [Source Model Implementation](https://github.com/quic/aimet-model-zoo/tree/develop/aimet_zoo_torch/xlsr)
281
 
282
-
283
-
284
  ## Community
285
  * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
286
  * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).
287
-
288
-
 
9
 
10
  ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/xlsr/web-assets/model_demo.png)
11
 
12
+ # XLSR: Optimized for Qualcomm Devices
 
 
13
 
14
  XLSR is designed for lightweight real-time upscaling of images.
15
 
16
+ This is based on the implementation of XLSR found [here](https://github.com/quic/aimet-model-zoo/tree/develop/aimet_zoo_torch/xlsr).
17
+ This repository contains pre-exported model files optimized for Qualcomm® devices. You can use the [Qualcomm® AI Hub Models](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/xlsr) library to export with custom configurations. More details on model performance across various devices, can be found [here](#performance-summary).
18
+
19
+ Qualcomm AI Hub Models uses [Qualcomm AI Hub Workbench](https://workbench.aihub.qualcomm.com) to compile, profile, and evaluate this model. [Sign up](https://myaccount.qualcomm.com/signup) to run these models on a hosted Qualcomm® device.
20
+
21
+ ## Getting Started
22
+ There are two ways to deploy this model on your device:
23
+
24
+ ### Option 1: Download Pre-Exported Models
25
+
26
+ Below are pre-exported model assets ready for deployment.
27
+
28
+ | Runtime | Precision | Chipset | SDK Versions | Download |
29
+ |---|---|---|---|---|
30
+ | ONNX | float | Universal | QAIRT 2.37, ONNX Runtime 1.23.0 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/xlsr/releases/v0.46.1/xlsr-onnx-float.zip)
31
+ | 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/xlsr/releases/v0.46.1/xlsr-onnx-w8a8.zip)
32
+ | QNN_DLC | float | Universal | QAIRT 2.42 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/xlsr/releases/v0.46.1/xlsr-qnn_dlc-float.zip)
33
+ | QNN_DLC | w8a8 | Universal | QAIRT 2.42 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/xlsr/releases/v0.46.1/xlsr-qnn_dlc-w8a8.zip)
34
+ | 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/xlsr/releases/v0.46.1/xlsr-tflite-float.zip)
35
+ | 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/xlsr/releases/v0.46.1/xlsr-tflite-w8a8.zip)
36
+
37
+ For more device-specific assets and performance metrics, visit **[XLSR on Qualcomm® AI Hub](https://aihub.qualcomm.com/models/xlsr)**.
38
+
39
+
40
+ ### Option 2: Export with Custom Configurations
41
+
42
+ Use the [Qualcomm® AI Hub Models](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/xlsr) Python library to compile and export the model with your own:
43
+ - Custom weights (e.g., fine-tuned checkpoints)
44
+ - Custom input shapes
45
+ - Target device and runtime configurations
46
+
47
+ This option is ideal if you need to customize the model beyond the default configuration provided here.
48
+
49
+ See our repository for [XLSR on GitHub](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/xlsr) for usage instructions.
50
+
51
+ ## Model Details
52
+
53
+ **Model Type:** Model_use_case.super_resolution
54
+
55
+ **Model Stats:**
56
+ - Model checkpoint: xlsr_3x_checkpoint
57
+ - Input resolution: 128x128
58
+ - Number of parameters: 28.0K
59
+ - Model size (float): 115 KB
60
+ - Model size (w8a8): 45.6 KB
61
+
62
+ ## Performance Summary
63
+ | Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit
64
+ |---|---|---|---|---|---|---
65
+ | XLSR | ONNX | float | Snapdragon® X Elite | 1.088 ms | 8 - 8 MB | NPU
66
+ | XLSR | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 0.869 ms | 0 - 98 MB | NPU
67
+ | XLSR | ONNX | float | Qualcomm® QCS8550 (Proxy) | 1.185 ms | 0 - 2 MB | NPU
68
+ | XLSR | ONNX | float | Qualcomm® QCS9075 | 1.49 ms | 8 - 11 MB | NPU
69
+ | XLSR | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 0.615 ms | 0 - 91 MB | NPU
70
+ | XLSR | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 0.532 ms | 0 - 90 MB | NPU
71
+ | XLSR | ONNX | w8a8 | Snapdragon® X Elite | 1.2 ms | 9 - 9 MB | NPU
72
+ | XLSR | ONNX | w8a8 | Snapdragon® 8 Gen 3 Mobile | 0.958 ms | 0 - 98 MB | NPU
73
+ | XLSR | ONNX | w8a8 | Qualcomm® QCS6490 | 12.183 ms | 19 - 23 MB | CPU
74
+ | XLSR | ONNX | w8a8 | Qualcomm® QCS8550 (Proxy) | 1.257 ms | 0 - 3 MB | NPU
75
+ | XLSR | ONNX | w8a8 | Qualcomm® QCS9075 | 1.857 ms | 0 - 3 MB | NPU
76
+ | XLSR | ONNX | w8a8 | Qualcomm® QCM6690 | 8.312 ms | 17 - 23 MB | CPU
77
+ | XLSR | ONNX | w8a8 | Snapdragon® 8 Elite For Galaxy Mobile | 0.766 ms | 0 - 89 MB | NPU
78
+ | XLSR | ONNX | w8a8 | Snapdragon® 7 Gen 4 Mobile | 6.249 ms | 18 - 25 MB | CPU
79
+ | XLSR | ONNX | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 0.66 ms | 0 - 90 MB | NPU
80
+ | XLSR | QNN_DLC | float | Snapdragon® X Elite | 0.893 ms | 0 - 0 MB | NPU
81
+ | XLSR | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 0.478 ms | 0 - 29 MB | NPU
82
+ | XLSR | QNN_DLC | float | Qualcomm® QCS8275 (Proxy) | 2.181 ms | 0 - 21 MB | NPU
83
+ | XLSR | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 0.767 ms | 0 - 31 MB | NPU
84
+ | XLSR | QNN_DLC | float | Qualcomm® SA8775P | 1.143 ms | 0 - 22 MB | NPU
85
+ | XLSR | QNN_DLC | float | Qualcomm® QCS9075 | 1.106 ms | 0 - 5 MB | NPU
86
+ | XLSR | QNN_DLC | float | Qualcomm® QCS8450 (Proxy) | 1.047 ms | 0 - 30 MB | NPU
87
+ | XLSR | QNN_DLC | float | Qualcomm® SA7255P | 2.181 ms | 0 - 21 MB | NPU
88
+ | XLSR | QNN_DLC | float | Qualcomm® SA8295P | 1.4 ms | 0 - 18 MB | NPU
89
+ | XLSR | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 0.359 ms | 0 - 25 MB | NPU
90
+ | XLSR | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 0.351 ms | 0 - 24 MB | NPU
91
+ | XLSR | QNN_DLC | w8a8 | Snapdragon® X Elite | 0.48 ms | 0 - 0 MB | NPU
92
+ | XLSR | QNN_DLC | w8a8 | Snapdragon® 8 Gen 3 Mobile | 0.259 ms | 0 - 27 MB | NPU
93
+ | XLSR | QNN_DLC | w8a8 | Qualcomm® QCS6490 | 1.405 ms | 0 - 2 MB | NPU
94
+ | XLSR | QNN_DLC | w8a8 | Qualcomm® QCS8275 (Proxy) | 0.907 ms | 0 - 21 MB | NPU
95
+ | XLSR | QNN_DLC | w8a8 | Qualcomm® QCS8550 (Proxy) | 0.37 ms | 0 - 15 MB | NPU
96
+ | XLSR | QNN_DLC | w8a8 | Qualcomm® SA8775P | 0.571 ms | 0 - 21 MB | NPU
97
+ | XLSR | QNN_DLC | w8a8 | Qualcomm® QCS9075 | 0.523 ms | 0 - 2 MB | NPU
98
+ | XLSR | QNN_DLC | w8a8 | Qualcomm® QCM6690 | 1.652 ms | 0 - 18 MB | NPU
99
+ | XLSR | QNN_DLC | w8a8 | Qualcomm® QCS8450 (Proxy) | 0.524 ms | 0 - 29 MB | NPU
100
+ | XLSR | QNN_DLC | w8a8 | Qualcomm® SA7255P | 0.907 ms | 0 - 21 MB | NPU
101
+ | XLSR | QNN_DLC | w8a8 | Qualcomm® SA8295P | 0.772 ms | 0 - 17 MB | NPU
102
+ | XLSR | QNN_DLC | w8a8 | Snapdragon® 8 Elite For Galaxy Mobile | 0.199 ms | 0 - 18 MB | NPU
103
+ | XLSR | QNN_DLC | w8a8 | Snapdragon® 7 Gen 4 Mobile | 0.402 ms | 1 - 19 MB | NPU
104
+ | XLSR | QNN_DLC | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 0.168 ms | 0 - 21 MB | NPU
105
+ | XLSR | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 1.456 ms | 0 - 29 MB | NPU
106
+ | XLSR | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 4.607 ms | 3 - 24 MB | NPU
107
+ | XLSR | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 2.22 ms | 0 - 67 MB | NPU
108
+ | XLSR | TFLITE | float | Qualcomm® SA8775P | 2.688 ms | 0 - 21 MB | NPU
109
+ | XLSR | TFLITE | float | Qualcomm® QCS9075 | 2.601 ms | 3 - 8 MB | NPU
110
+ | XLSR | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 2.563 ms | 0 - 30 MB | NPU
111
+ | XLSR | TFLITE | float | Qualcomm® SA7255P | 4.607 ms | 3 - 24 MB | NPU
112
+ | XLSR | TFLITE | float | Qualcomm® SA8295P | 3.263 ms | 0 - 17 MB | NPU
113
+ | XLSR | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 0.999 ms | 0 - 24 MB | NPU
114
+ | XLSR | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 0.82 ms | 0 - 22 MB | NPU
115
+ | XLSR | TFLITE | w8a8 | Snapdragon® 8 Gen 3 Mobile | 0.252 ms | 0 - 28 MB | NPU
116
+ | XLSR | TFLITE | w8a8 | Qualcomm® QCS6490 | 1.112 ms | 0 - 3 MB | NPU
117
+ | XLSR | TFLITE | w8a8 | Qualcomm® QCS8275 (Proxy) | 0.915 ms | 0 - 21 MB | NPU
118
+ | XLSR | TFLITE | w8a8 | Qualcomm® QCS8550 (Proxy) | 0.376 ms | 0 - 60 MB | NPU
119
+ | XLSR | TFLITE | w8a8 | Qualcomm® SA8775P | 0.592 ms | 0 - 21 MB | NPU
120
+ | XLSR | TFLITE | w8a8 | Qualcomm® QCS9075 | 0.593 ms | 0 - 3 MB | NPU
121
+ | XLSR | TFLITE | w8a8 | Qualcomm® QCM6690 | 1.617 ms | 0 - 18 MB | NPU
122
+ | XLSR | TFLITE | w8a8 | Qualcomm® QCS8450 (Proxy) | 0.533 ms | 0 - 29 MB | NPU
123
+ | XLSR | TFLITE | w8a8 | Qualcomm® SA7255P | 0.915 ms | 0 - 21 MB | NPU
124
+ | XLSR | TFLITE | w8a8 | Qualcomm® SA8295P | 0.77 ms | 0 - 18 MB | NPU
125
+ | XLSR | TFLITE | w8a8 | Snapdragon® 8 Elite For Galaxy Mobile | 0.234 ms | 0 - 21 MB | NPU
126
+ | XLSR | TFLITE | w8a8 | Snapdragon® 7 Gen 4 Mobile | 0.414 ms | 0 - 18 MB | NPU
127
+ | XLSR | TFLITE | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 0.169 ms | 0 - 22 MB | NPU
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
 
129
  ## License
130
  * The license for the original implementation of XLSR can be found
131
  [here](https://github.com/quic/aimet-model-zoo/blob/develop/LICENSE.pdf).
132
 
 
 
133
  ## References
134
  * [Extremely Lightweight Quantization Robust Real-Time Single-Image Super Resolution for Mobile Devices](https://arxiv.org/abs/2105.10288)
135
  * [Source Model Implementation](https://github.com/quic/aimet-model-zoo/tree/develop/aimet_zoo_torch/xlsr)
136
 
 
 
137
  ## Community
138
  * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
139
  * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).
 
 
XLSR_float.dlc DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:13433be004db7a59511d759d89a84b943d1a55ce58fc50cbca607dfcd80f93cd
3
- size 149164
 
 
 
 
XLSR_float.onnx.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:15b97338e7ca446b6c23468b6a3e0591e15331672fbcd8f21d79fe617510321a
3
- size 106980
 
 
 
 
XLSR_float.tflite DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:1a05990c63190d79903a5609b357aaf08498040e071e94bc14e1ab94a3be0ce5
3
- size 118352
 
 
 
 
XLSR_w8a8.dlc DELETED
Binary file (87.1 kB)
 
XLSR_w8a8.onnx.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:729d8f24f744a006d2e403b295e6c89c64f01beaafff0b42428428c69f651a78
3
- size 75969
 
 
 
 
XLSR_w8a8.tflite DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:7d617191fb5921d3cab802735c78b3f4d30d726a185b46ec93c548fbd6fc566e
3
- size 47712
 
 
 
 
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