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