Image Classification
PyTorch
TF Lite
ONNX
backbone
android
shreyajn commited on
Commit
9b1068c
1 Parent(s): e758ad4

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +15 -32
README.md CHANGED
@@ -38,8 +38,8 @@ More details on model performance across various devices, can be found
38
 
39
  | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
40
  | ---|---|---|---|---|---|---|---|
41
- | Samsung Galaxy S23 Ultra (Android 13) | Snapdragon® 8 Gen 2 | TFLite | 28.867 ms | 0 - 6 MB | FP16 | NPU | [Swin-Small.tflite](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.tflite)
42
- | Samsung Galaxy S23 Ultra (Android 13) | Snapdragon® 8 Gen 2 | QNN Model Library | 23.696 ms | 0 - 35 MB | FP16 | NPU | [Swin-Small.so](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.so)
43
 
44
 
45
 
@@ -100,9 +100,9 @@ python -m qai_hub_models.models.swin_small.export
100
  ```
101
  Profile Job summary of Swin-Small
102
  --------------------------------------------------
103
- Device: SA8255 (Proxy) (13)
104
- Estimated Inference Time: 23.40 ms
105
- Estimated Peak Memory Range: 0.04-38.23 MB
106
  Compute Units: NPU (1246) | Total (1246)
107
 
108
 
@@ -124,29 +124,13 @@ in memory using the `jit.trace` and then call the `submit_compile_job` API.
124
  import torch
125
 
126
  import qai_hub as hub
127
- from qai_hub_models.models.swin_small import Model
128
 
129
  # Load the model
130
- torch_model = Model.from_pretrained()
131
 
132
  # Device
133
  device = hub.Device("Samsung Galaxy S23")
134
 
135
- # Trace model
136
- input_shape = torch_model.get_input_spec()
137
- sample_inputs = torch_model.sample_inputs()
138
-
139
- pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
140
-
141
- # Compile model on a specific device
142
- compile_job = hub.submit_compile_job(
143
- model=pt_model,
144
- device=device,
145
- input_specs=torch_model.get_input_spec(),
146
- )
147
-
148
- # Get target model to run on-device
149
- target_model = compile_job.get_target_model()
150
 
151
  ```
152
 
@@ -159,10 +143,10 @@ provisioned in the cloud. Once the job is submitted, you can navigate to a
159
  provided job URL to view a variety of on-device performance metrics.
160
  ```python
161
  profile_job = hub.submit_profile_job(
162
- model=target_model,
163
- device=device,
164
- )
165
-
166
  ```
167
 
168
  Step 3: **Verify on-device accuracy**
@@ -172,12 +156,11 @@ on sample input data on the same cloud hosted device.
172
  ```python
173
  input_data = torch_model.sample_inputs()
174
  inference_job = hub.submit_inference_job(
175
- model=target_model,
176
- device=device,
177
- inputs=input_data,
178
- )
179
-
180
- on_device_output = inference_job.download_output_data()
181
 
182
  ```
183
  With the output of the model, you can compute like PSNR, relative errors or
 
38
 
39
  | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
40
  | ---|---|---|---|---|---|---|---|
41
+ | Samsung Galaxy S23 Ultra (Android 13) | Snapdragon® 8 Gen 2 | TFLite | 64.033 ms | 7 - 14 MB | FP16 | NPU | [Swin-Small.tflite](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.tflite)
42
+ | Samsung Galaxy S23 Ultra (Android 13) | Snapdragon® 8 Gen 2 | QNN Model Library | 23.891 ms | 0 - 42 MB | FP16 | NPU | [Swin-Small.so](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.so)
43
 
44
 
45
 
 
100
  ```
101
  Profile Job summary of Swin-Small
102
  --------------------------------------------------
103
+ Device: Snapdragon X Elite CRD (11)
104
+ Estimated Inference Time: 22.25 ms
105
+ Estimated Peak Memory Range: 0.57-0.57 MB
106
  Compute Units: NPU (1246) | Total (1246)
107
 
108
 
 
124
  import torch
125
 
126
  import qai_hub as hub
127
+ from qai_hub_models.models.swin_small import
128
 
129
  # Load the model
 
130
 
131
  # Device
132
  device = hub.Device("Samsung Galaxy S23")
133
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
 
135
  ```
136
 
 
143
  provided job URL to view a variety of on-device performance metrics.
144
  ```python
145
  profile_job = hub.submit_profile_job(
146
+ model=target_model,
147
+ device=device,
148
+ )
149
+
150
  ```
151
 
152
  Step 3: **Verify on-device accuracy**
 
156
  ```python
157
  input_data = torch_model.sample_inputs()
158
  inference_job = hub.submit_inference_job(
159
+ model=target_model,
160
+ device=device,
161
+ inputs=input_data,
162
+ )
163
+ on_device_output = inference_job.download_output_data()
 
164
 
165
  ```
166
  With the output of the model, you can compute like PSNR, relative errors or