Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
@@ -34,42 +34,42 @@ More details on model performance across various devices, can be found
|
|
34 |
- Input resolution: 640x480
|
35 |
- Number of output classes: 2
|
36 |
- Number of parameters: 2.53M
|
37 |
-
- Model size:
|
38 |
|
39 |
| Model | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
|
40 |
|---|---|---|---|---|---|---|---|---|
|
41 |
-
| Person-Foot-Detection-Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 1.
|
42 |
-
| Person-Foot-Detection-Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 1.
|
43 |
-
| Person-Foot-Detection-Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX |
|
44 |
-
| Person-Foot-Detection-Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 0.
|
45 |
-
| Person-Foot-Detection-Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 0.
|
46 |
-
| Person-Foot-Detection-Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 1.
|
47 |
-
| Person-Foot-Detection-Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 0.
|
48 |
-
| Person-Foot-Detection-Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 0.
|
49 |
-
| Person-Foot-Detection-Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX |
|
50 |
-
| Person-Foot-Detection-Quantized | SA7255P ADP | SA7255P | TFLITE | 19.
|
51 |
-
| Person-Foot-Detection-Quantized | SA7255P ADP | SA7255P | QNN | 19.
|
52 |
-
| Person-Foot-Detection-Quantized | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 1.
|
53 |
-
| Person-Foot-Detection-Quantized | SA8255 (Proxy) | SA8255P Proxy | QNN | 1.
|
54 |
-
| Person-Foot-Detection-Quantized | SA8295P ADP | SA8295P | TFLITE | 2.
|
55 |
-
| Person-Foot-Detection-Quantized | SA8295P ADP | SA8295P | QNN | 2.
|
56 |
-
| Person-Foot-Detection-Quantized | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 1.
|
57 |
-
| Person-Foot-Detection-Quantized | SA8650 (Proxy) | SA8650P Proxy | QNN | 1.
|
58 |
-
| Person-Foot-Detection-Quantized | SA8775P ADP | SA8775P | TFLITE |
|
59 |
-
| Person-Foot-Detection-Quantized | SA8775P ADP | SA8775P | QNN |
|
60 |
-
| Person-Foot-Detection-Quantized | RB3 Gen 2 (Proxy) | QCS6490 Proxy | TFLITE | 5.
|
61 |
-
| Person-Foot-Detection-Quantized | RB3 Gen 2 (Proxy) | QCS6490 Proxy | QNN |
|
62 |
-
| Person-Foot-Detection-Quantized | RB5 (Proxy) | QCS8250 Proxy | TFLITE |
|
63 |
-
| Person-Foot-Detection-Quantized | QCS8275 (Proxy) | QCS8275 Proxy | TFLITE | 19.
|
64 |
-
| Person-Foot-Detection-Quantized | QCS8275 (Proxy) | QCS8275 Proxy | QNN | 19.
|
65 |
-
| Person-Foot-Detection-Quantized | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 1.
|
66 |
-
| Person-Foot-Detection-Quantized | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 1.
|
67 |
-
| Person-Foot-Detection-Quantized | QCS9075 (Proxy) | QCS9075 Proxy | TFLITE |
|
68 |
-
| Person-Foot-Detection-Quantized | QCS9075 (Proxy) | QCS9075 Proxy | QNN |
|
69 |
-
| Person-Foot-Detection-Quantized | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 1.
|
70 |
-
| Person-Foot-Detection-Quantized | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 1.
|
71 |
-
| Person-Foot-Detection-Quantized | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 1.
|
72 |
-
| Person-Foot-Detection-Quantized | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX |
|
73 |
|
74 |
|
75 |
|
@@ -134,12 +134,88 @@ Person-Foot-Detection-Quantized
|
|
134 |
Device : Samsung Galaxy S23 (13)
|
135 |
Runtime : TFLITE
|
136 |
Estimated inference time (ms) : 1.3
|
137 |
-
Estimated peak memory usage (MB): [0,
|
138 |
-
Total # Ops :
|
139 |
-
Compute Unit(s) : NPU (
|
140 |
```
|
141 |
|
142 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
|
144 |
|
145 |
## Run demo on a cloud-hosted device
|
@@ -178,13 +254,12 @@ Explore all available models on [Qualcomm® AI Hub](https://aihub.qualcomm.com/)
|
|
178 |
|
179 |
## License
|
180 |
* The license for the original implementation of Person-Foot-Detection-Quantized can be found
|
181 |
-
[here](https://github.com/
|
182 |
* The license for the compiled assets for on-device deployment can be found [here](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/Qualcomm+AI+Hub+Proprietary+License.pdf)
|
183 |
|
184 |
|
185 |
|
186 |
## References
|
187 |
-
* [None](None)
|
188 |
* [Source Model Implementation](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/foot_track_net_quantized/model.py)
|
189 |
|
190 |
|
|
|
34 |
- Input resolution: 640x480
|
35 |
- Number of output classes: 2
|
36 |
- Number of parameters: 2.53M
|
37 |
+
- Model size: 2.62 MB
|
38 |
|
39 |
| Model | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
|
40 |
|---|---|---|---|---|---|---|---|---|
|
41 |
+
| Person-Foot-Detection-Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 1.291 ms | 0 - 11 MB | INT8 | NPU | [Person-Foot-Detection-Quantized.tflite](https://huggingface.co/qualcomm/Person-Foot-Detection-Quantized/blob/main/Person-Foot-Detection-Quantized.tflite) |
|
42 |
+
| Person-Foot-Detection-Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 1.141 ms | 1 - 4 MB | INT8 | NPU | [Person-Foot-Detection-Quantized.so](https://huggingface.co/qualcomm/Person-Foot-Detection-Quantized/blob/main/Person-Foot-Detection-Quantized.so) |
|
43 |
+
| Person-Foot-Detection-Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 2.41 ms | 0 - 16 MB | INT8 | NPU | [Person-Foot-Detection-Quantized.onnx](https://huggingface.co/qualcomm/Person-Foot-Detection-Quantized/blob/main/Person-Foot-Detection-Quantized.onnx) |
|
44 |
+
| Person-Foot-Detection-Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 0.912 ms | 0 - 34 MB | INT8 | NPU | [Person-Foot-Detection-Quantized.tflite](https://huggingface.co/qualcomm/Person-Foot-Detection-Quantized/blob/main/Person-Foot-Detection-Quantized.tflite) |
|
45 |
+
| Person-Foot-Detection-Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 0.768 ms | 1 - 19 MB | INT8 | NPU | [Person-Foot-Detection-Quantized.so](https://huggingface.co/qualcomm/Person-Foot-Detection-Quantized/blob/main/Person-Foot-Detection-Quantized.so) |
|
46 |
+
| Person-Foot-Detection-Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 1.737 ms | 0 - 45 MB | INT8 | NPU | [Person-Foot-Detection-Quantized.onnx](https://huggingface.co/qualcomm/Person-Foot-Detection-Quantized/blob/main/Person-Foot-Detection-Quantized.onnx) |
|
47 |
+
| Person-Foot-Detection-Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 0.9 ms | 0 - 27 MB | INT8 | NPU | [Person-Foot-Detection-Quantized.tflite](https://huggingface.co/qualcomm/Person-Foot-Detection-Quantized/blob/main/Person-Foot-Detection-Quantized.tflite) |
|
48 |
+
| Person-Foot-Detection-Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 0.761 ms | 1 - 32 MB | INT8 | NPU | Use Export Script |
|
49 |
+
| Person-Foot-Detection-Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 1.716 ms | 1 - 38 MB | INT8 | NPU | [Person-Foot-Detection-Quantized.onnx](https://huggingface.co/qualcomm/Person-Foot-Detection-Quantized/blob/main/Person-Foot-Detection-Quantized.onnx) |
|
50 |
+
| Person-Foot-Detection-Quantized | SA7255P ADP | SA7255P | TFLITE | 19.624 ms | 1 - 24 MB | INT8 | NPU | [Person-Foot-Detection-Quantized.tflite](https://huggingface.co/qualcomm/Person-Foot-Detection-Quantized/blob/main/Person-Foot-Detection-Quantized.tflite) |
|
51 |
+
| Person-Foot-Detection-Quantized | SA7255P ADP | SA7255P | QNN | 19.323 ms | 1 - 11 MB | INT8 | NPU | Use Export Script |
|
52 |
+
| Person-Foot-Detection-Quantized | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 1.318 ms | 0 - 8 MB | INT8 | NPU | [Person-Foot-Detection-Quantized.tflite](https://huggingface.co/qualcomm/Person-Foot-Detection-Quantized/blob/main/Person-Foot-Detection-Quantized.tflite) |
|
53 |
+
| Person-Foot-Detection-Quantized | SA8255 (Proxy) | SA8255P Proxy | QNN | 1.133 ms | 1 - 4 MB | INT8 | NPU | Use Export Script |
|
54 |
+
| Person-Foot-Detection-Quantized | SA8295P ADP | SA8295P | TFLITE | 2.44 ms | 0 - 26 MB | INT8 | NPU | [Person-Foot-Detection-Quantized.tflite](https://huggingface.co/qualcomm/Person-Foot-Detection-Quantized/blob/main/Person-Foot-Detection-Quantized.tflite) |
|
55 |
+
| Person-Foot-Detection-Quantized | SA8295P ADP | SA8295P | QNN | 2.183 ms | 1 - 19 MB | INT8 | NPU | Use Export Script |
|
56 |
+
| Person-Foot-Detection-Quantized | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 1.283 ms | 0 - 11 MB | INT8 | NPU | [Person-Foot-Detection-Quantized.tflite](https://huggingface.co/qualcomm/Person-Foot-Detection-Quantized/blob/main/Person-Foot-Detection-Quantized.tflite) |
|
57 |
+
| Person-Foot-Detection-Quantized | SA8650 (Proxy) | SA8650P Proxy | QNN | 1.141 ms | 1 - 4 MB | INT8 | NPU | Use Export Script |
|
58 |
+
| Person-Foot-Detection-Quantized | SA8775P ADP | SA8775P | TFLITE | 2.011 ms | 0 - 24 MB | INT8 | NPU | [Person-Foot-Detection-Quantized.tflite](https://huggingface.co/qualcomm/Person-Foot-Detection-Quantized/blob/main/Person-Foot-Detection-Quantized.tflite) |
|
59 |
+
| Person-Foot-Detection-Quantized | SA8775P ADP | SA8775P | QNN | 1.755 ms | 1 - 11 MB | INT8 | NPU | Use Export Script |
|
60 |
+
| Person-Foot-Detection-Quantized | RB3 Gen 2 (Proxy) | QCS6490 Proxy | TFLITE | 5.195 ms | 1 - 33 MB | INT8 | NPU | [Person-Foot-Detection-Quantized.tflite](https://huggingface.co/qualcomm/Person-Foot-Detection-Quantized/blob/main/Person-Foot-Detection-Quantized.tflite) |
|
61 |
+
| Person-Foot-Detection-Quantized | RB3 Gen 2 (Proxy) | QCS6490 Proxy | QNN | 6.573 ms | 1 - 11 MB | INT8 | NPU | Use Export Script |
|
62 |
+
| Person-Foot-Detection-Quantized | RB5 (Proxy) | QCS8250 Proxy | TFLITE | 26.876 ms | 1 - 4 MB | INT8 | NPU | [Person-Foot-Detection-Quantized.tflite](https://huggingface.co/qualcomm/Person-Foot-Detection-Quantized/blob/main/Person-Foot-Detection-Quantized.tflite) |
|
63 |
+
| Person-Foot-Detection-Quantized | QCS8275 (Proxy) | QCS8275 Proxy | TFLITE | 19.624 ms | 1 - 24 MB | INT8 | NPU | [Person-Foot-Detection-Quantized.tflite](https://huggingface.co/qualcomm/Person-Foot-Detection-Quantized/blob/main/Person-Foot-Detection-Quantized.tflite) |
|
64 |
+
| Person-Foot-Detection-Quantized | QCS8275 (Proxy) | QCS8275 Proxy | QNN | 19.323 ms | 1 - 11 MB | INT8 | NPU | Use Export Script |
|
65 |
+
| Person-Foot-Detection-Quantized | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 1.278 ms | 0 - 11 MB | INT8 | NPU | [Person-Foot-Detection-Quantized.tflite](https://huggingface.co/qualcomm/Person-Foot-Detection-Quantized/blob/main/Person-Foot-Detection-Quantized.tflite) |
|
66 |
+
| Person-Foot-Detection-Quantized | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 1.135 ms | 1 - 4 MB | INT8 | NPU | Use Export Script |
|
67 |
+
| Person-Foot-Detection-Quantized | QCS9075 (Proxy) | QCS9075 Proxy | TFLITE | 2.011 ms | 0 - 24 MB | INT8 | NPU | [Person-Foot-Detection-Quantized.tflite](https://huggingface.co/qualcomm/Person-Foot-Detection-Quantized/blob/main/Person-Foot-Detection-Quantized.tflite) |
|
68 |
+
| Person-Foot-Detection-Quantized | QCS9075 (Proxy) | QCS9075 Proxy | QNN | 1.755 ms | 1 - 11 MB | INT8 | NPU | Use Export Script |
|
69 |
+
| Person-Foot-Detection-Quantized | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 1.754 ms | 0 - 33 MB | INT8 | NPU | [Person-Foot-Detection-Quantized.tflite](https://huggingface.co/qualcomm/Person-Foot-Detection-Quantized/blob/main/Person-Foot-Detection-Quantized.tflite) |
|
70 |
+
| Person-Foot-Detection-Quantized | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 1.706 ms | 1 - 35 MB | INT8 | NPU | Use Export Script |
|
71 |
+
| Person-Foot-Detection-Quantized | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 1.323 ms | 1 - 1 MB | INT8 | NPU | Use Export Script |
|
72 |
+
| Person-Foot-Detection-Quantized | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 2.38 ms | 7 - 7 MB | INT8 | NPU | [Person-Foot-Detection-Quantized.onnx](https://huggingface.co/qualcomm/Person-Foot-Detection-Quantized/blob/main/Person-Foot-Detection-Quantized.onnx) |
|
73 |
|
74 |
|
75 |
|
|
|
134 |
Device : Samsung Galaxy S23 (13)
|
135 |
Runtime : TFLITE
|
136 |
Estimated inference time (ms) : 1.3
|
137 |
+
Estimated peak memory usage (MB): [0, 11]
|
138 |
+
Total # Ops : 143
|
139 |
+
Compute Unit(s) : NPU (143 ops)
|
140 |
```
|
141 |
|
142 |
|
143 |
+
## How does this work?
|
144 |
+
|
145 |
+
This [export script](https://aihub.qualcomm.com/models/foot_track_net_quantized/qai_hub_models/models/Person-Foot-Detection-Quantized/export.py)
|
146 |
+
leverages [Qualcomm® AI Hub](https://aihub.qualcomm.com/) to optimize, validate, and deploy this model
|
147 |
+
on-device. Lets go through each step below in detail:
|
148 |
+
|
149 |
+
Step 1: **Compile model for on-device deployment**
|
150 |
+
|
151 |
+
To compile a PyTorch model for on-device deployment, we first trace the model
|
152 |
+
in memory using the `jit.trace` and then call the `submit_compile_job` API.
|
153 |
+
|
154 |
+
```python
|
155 |
+
import torch
|
156 |
+
|
157 |
+
import qai_hub as hub
|
158 |
+
from qai_hub_models.models.foot_track_net_quantized import Model
|
159 |
+
|
160 |
+
# Load the model
|
161 |
+
torch_model = Model.from_pretrained()
|
162 |
+
|
163 |
+
# Device
|
164 |
+
device = hub.Device("Samsung Galaxy S24")
|
165 |
+
|
166 |
+
# Trace model
|
167 |
+
input_shape = torch_model.get_input_spec()
|
168 |
+
sample_inputs = torch_model.sample_inputs()
|
169 |
+
|
170 |
+
pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
|
171 |
+
|
172 |
+
# Compile model on a specific device
|
173 |
+
compile_job = hub.submit_compile_job(
|
174 |
+
model=pt_model,
|
175 |
+
device=device,
|
176 |
+
input_specs=torch_model.get_input_spec(),
|
177 |
+
)
|
178 |
+
|
179 |
+
# Get target model to run on-device
|
180 |
+
target_model = compile_job.get_target_model()
|
181 |
+
|
182 |
+
```
|
183 |
+
|
184 |
+
|
185 |
+
Step 2: **Performance profiling on cloud-hosted device**
|
186 |
+
|
187 |
+
After compiling models from step 1. Models can be profiled model on-device using the
|
188 |
+
`target_model`. Note that this scripts runs the model on a device automatically
|
189 |
+
provisioned in the cloud. Once the job is submitted, you can navigate to a
|
190 |
+
provided job URL to view a variety of on-device performance metrics.
|
191 |
+
```python
|
192 |
+
profile_job = hub.submit_profile_job(
|
193 |
+
model=target_model,
|
194 |
+
device=device,
|
195 |
+
)
|
196 |
+
|
197 |
+
```
|
198 |
+
|
199 |
+
Step 3: **Verify on-device accuracy**
|
200 |
+
|
201 |
+
To verify the accuracy of the model on-device, you can run on-device inference
|
202 |
+
on sample input data on the same cloud hosted device.
|
203 |
+
```python
|
204 |
+
input_data = torch_model.sample_inputs()
|
205 |
+
inference_job = hub.submit_inference_job(
|
206 |
+
model=target_model,
|
207 |
+
device=device,
|
208 |
+
inputs=input_data,
|
209 |
+
)
|
210 |
+
on_device_output = inference_job.download_output_data()
|
211 |
+
|
212 |
+
```
|
213 |
+
With the output of the model, you can compute like PSNR, relative errors or
|
214 |
+
spot check the output with expected output.
|
215 |
+
|
216 |
+
**Note**: This on-device profiling and inference requires access to Qualcomm®
|
217 |
+
AI Hub. [Sign up for access](https://myaccount.qualcomm.com/signup).
|
218 |
+
|
219 |
|
220 |
|
221 |
## Run demo on a cloud-hosted device
|
|
|
254 |
|
255 |
## License
|
256 |
* The license for the original implementation of Person-Foot-Detection-Quantized can be found
|
257 |
+
[here](https://github.com/quic/ai-hub-models/blob/main/LICENSE).
|
258 |
* The license for the compiled assets for on-device deployment can be found [here](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/Qualcomm+AI+Hub+Proprietary+License.pdf)
|
259 |
|
260 |
|
261 |
|
262 |
## References
|
|
|
263 |
* [Source Model Implementation](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/foot_track_net_quantized/model.py)
|
264 |
|
265 |
|