Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
@@ -33,7 +33,7 @@ More details on model performance across various devices, can be found
|
|
33 |
|
34 |
| Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
|
35 |
| ---|---|---|---|---|---|---|---|
|
36 |
-
| Samsung Galaxy S23 Ultra (Android 13) | Snapdragon® 8 Gen 2 | TFLite | 11.
|
37 |
|
38 |
|
39 |
|
@@ -95,9 +95,9 @@ python -m qai_hub_models.models.litehrnet.export
|
|
95 |
```
|
96 |
Profile Job summary of LiteHRNet
|
97 |
--------------------------------------------------
|
98 |
-
Device:
|
99 |
-
Estimated Inference Time: 11.
|
100 |
-
Estimated Peak Memory Range: 6.
|
101 |
Compute Units: NPU (1225),CPU (10) | Total (1235)
|
102 |
|
103 |
|
@@ -119,29 +119,13 @@ in memory using the `jit.trace` and then call the `submit_compile_job` API.
|
|
119 |
import torch
|
120 |
|
121 |
import qai_hub as hub
|
122 |
-
from qai_hub_models.models.litehrnet import
|
123 |
|
124 |
# Load the model
|
125 |
-
torch_model = Model.from_pretrained()
|
126 |
|
127 |
# Device
|
128 |
device = hub.Device("Samsung Galaxy S23")
|
129 |
|
130 |
-
# Trace model
|
131 |
-
input_shape = torch_model.get_input_spec()
|
132 |
-
sample_inputs = torch_model.sample_inputs()
|
133 |
-
|
134 |
-
pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
|
135 |
-
|
136 |
-
# Compile model on a specific device
|
137 |
-
compile_job = hub.submit_compile_job(
|
138 |
-
model=pt_model,
|
139 |
-
device=device,
|
140 |
-
input_specs=torch_model.get_input_spec(),
|
141 |
-
)
|
142 |
-
|
143 |
-
# Get target model to run on-device
|
144 |
-
target_model = compile_job.get_target_model()
|
145 |
|
146 |
```
|
147 |
|
@@ -154,10 +138,10 @@ provisioned in the cloud. Once the job is submitted, you can navigate to a
|
|
154 |
provided job URL to view a variety of on-device performance metrics.
|
155 |
```python
|
156 |
profile_job = hub.submit_profile_job(
|
157 |
-
|
158 |
-
|
159 |
-
)
|
160 |
-
|
161 |
```
|
162 |
|
163 |
Step 3: **Verify on-device accuracy**
|
@@ -167,12 +151,11 @@ on sample input data on the same cloud hosted device.
|
|
167 |
```python
|
168 |
input_data = torch_model.sample_inputs()
|
169 |
inference_job = hub.submit_inference_job(
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
)
|
174 |
-
|
175 |
-
on_device_output = inference_job.download_output_data()
|
176 |
|
177 |
```
|
178 |
With the output of the model, you can compute like PSNR, relative errors or
|
|
|
33 |
|
34 |
| Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
|
35 |
| ---|---|---|---|---|---|---|---|
|
36 |
+
| Samsung Galaxy S23 Ultra (Android 13) | Snapdragon® 8 Gen 2 | TFLite | 11.098 ms | 6 - 189 MB | FP16 | NPU | [LiteHRNet.tflite](https://huggingface.co/qualcomm/LiteHRNet/blob/main/LiteHRNet.tflite)
|
37 |
|
38 |
|
39 |
|
|
|
95 |
```
|
96 |
Profile Job summary of LiteHRNet
|
97 |
--------------------------------------------------
|
98 |
+
Device: SA8255 (Proxy) (13)
|
99 |
+
Estimated Inference Time: 11.21 ms
|
100 |
+
Estimated Peak Memory Range: 6.23-8.89 MB
|
101 |
Compute Units: NPU (1225),CPU (10) | Total (1235)
|
102 |
|
103 |
|
|
|
119 |
import torch
|
120 |
|
121 |
import qai_hub as hub
|
122 |
+
from qai_hub_models.models.litehrnet import
|
123 |
|
124 |
# Load the model
|
|
|
125 |
|
126 |
# Device
|
127 |
device = hub.Device("Samsung Galaxy S23")
|
128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
|
130 |
```
|
131 |
|
|
|
138 |
provided job URL to view a variety of on-device performance metrics.
|
139 |
```python
|
140 |
profile_job = hub.submit_profile_job(
|
141 |
+
model=target_model,
|
142 |
+
device=device,
|
143 |
+
)
|
144 |
+
|
145 |
```
|
146 |
|
147 |
Step 3: **Verify on-device accuracy**
|
|
|
151 |
```python
|
152 |
input_data = torch_model.sample_inputs()
|
153 |
inference_job = hub.submit_inference_job(
|
154 |
+
model=target_model,
|
155 |
+
device=device,
|
156 |
+
inputs=input_data,
|
157 |
+
)
|
158 |
+
on_device_output = inference_job.download_output_data()
|
|
|
159 |
|
160 |
```
|
161 |
With the output of the model, you can compute like PSNR, relative errors or
|