qaihm-bot commited on
Commit
62fefcf
·
verified ·
1 Parent(s): 96822da

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +79 -107
README.md CHANGED
@@ -37,64 +37,64 @@ More details on model performance across various devices, can be found
37
 
38
  | Model | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
39
  |---|---|---|---|---|---|---|---|---|
40
- | MediaPipeFaceDetector | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 0.549 ms | 0 - 6 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceDetector.tflite) |
41
- | MediaPipeFaceDetector | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 0.534 ms | 1 - 3 MB | FP16 | NPU | [MediaPipe-Face-Detection.so](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceDetector.so) |
42
- | MediaPipeFaceDetector | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 0.852 ms | 0 - 8 MB | FP16 | NPU | [MediaPipe-Face-Detection.onnx](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceDetector.onnx) |
43
- | MediaPipeFaceDetector | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 0.407 ms | 31 - 55 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceDetector.tflite) |
44
- | MediaPipeFaceDetector | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 0.38 ms | 1 - 20 MB | FP16 | NPU | [MediaPipe-Face-Detection.so](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceDetector.so) |
45
- | MediaPipeFaceDetector | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 0.585 ms | 0 - 30 MB | FP16 | NPU | [MediaPipe-Face-Detection.onnx](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceDetector.onnx) |
46
- | MediaPipeFaceDetector | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 0.414 ms | 0 - 17 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceDetector.tflite) |
47
- | MediaPipeFaceDetector | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 0.343 ms | 0 - 20 MB | FP16 | NPU | Use Export Script |
48
- | MediaPipeFaceDetector | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 0.626 ms | 0 - 22 MB | FP16 | NPU | [MediaPipe-Face-Detection.onnx](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceDetector.onnx) |
49
- | MediaPipeFaceDetector | SA7255P ADP | SA7255P | TFLITE | 18.713 ms | 0 - 14 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceDetector.tflite) |
50
- | MediaPipeFaceDetector | SA7255P ADP | SA7255P | QNN | 18.645 ms | 1 - 10 MB | FP16 | NPU | Use Export Script |
51
- | MediaPipeFaceDetector | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 0.551 ms | 0 - 6 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceDetector.tflite) |
52
- | MediaPipeFaceDetector | SA8255 (Proxy) | SA8255P Proxy | QNN | 0.534 ms | 1 - 3 MB | FP16 | NPU | Use Export Script |
53
- | MediaPipeFaceDetector | SA8295P ADP | SA8295P | TFLITE | 1.138 ms | 0 - 19 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceDetector.tflite) |
54
- | MediaPipeFaceDetector | SA8295P ADP | SA8295P | QNN | 1.068 ms | 0 - 18 MB | FP16 | NPU | Use Export Script |
55
- | MediaPipeFaceDetector | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 0.549 ms | 0 - 6 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceDetector.tflite) |
56
- | MediaPipeFaceDetector | SA8650 (Proxy) | SA8650P Proxy | QNN | 0.533 ms | 0 - 2 MB | FP16 | NPU | Use Export Script |
57
- | MediaPipeFaceDetector | SA8775P ADP | SA8775P | TFLITE | 1.273 ms | 0 - 15 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceDetector.tflite) |
58
- | MediaPipeFaceDetector | SA8775P ADP | SA8775P | QNN | 1.184 ms | 1 - 10 MB | FP16 | NPU | Use Export Script |
59
- | MediaPipeFaceDetector | QCS8275 (Proxy) | QCS8275 Proxy | TFLITE | 18.713 ms | 0 - 14 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceDetector.tflite) |
60
- | MediaPipeFaceDetector | QCS8275 (Proxy) | QCS8275 Proxy | QNN | 18.645 ms | 1 - 10 MB | FP16 | NPU | Use Export Script |
61
- | MediaPipeFaceDetector | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 0.549 ms | 0 - 7 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceDetector.tflite) |
62
- | MediaPipeFaceDetector | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 0.533 ms | 1 - 12 MB | FP16 | NPU | Use Export Script |
63
- | MediaPipeFaceDetector | QCS9075 (Proxy) | QCS9075 Proxy | TFLITE | 1.273 ms | 0 - 15 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceDetector.tflite) |
64
- | MediaPipeFaceDetector | QCS9075 (Proxy) | QCS9075 Proxy | QNN | 1.184 ms | 1 - 10 MB | FP16 | NPU | Use Export Script |
65
- | MediaPipeFaceDetector | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 0.812 ms | 0 - 24 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceDetector.tflite) |
66
- | MediaPipeFaceDetector | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 0.841 ms | 1 - 23 MB | FP16 | NPU | Use Export Script |
67
- | MediaPipeFaceDetector | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 0.68 ms | 1 - 1 MB | FP16 | NPU | Use Export Script |
68
- | MediaPipeFaceDetector | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 0.859 ms | 2 - 2 MB | FP16 | NPU | [MediaPipe-Face-Detection.onnx](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceDetector.onnx) |
69
- | MediaPipeFaceLandmarkDetector | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 0.199 ms | 0 - 5 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceLandmarkDetector.tflite) |
70
- | MediaPipeFaceLandmarkDetector | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 0.219 ms | 0 - 3 MB | FP16 | NPU | [MediaPipe-Face-Detection.so](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceLandmarkDetector.so) |
71
- | MediaPipeFaceLandmarkDetector | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 0.377 ms | 0 - 8 MB | FP16 | NPU | [MediaPipe-Face-Detection.onnx](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceLandmarkDetector.onnx) |
72
- | MediaPipeFaceLandmarkDetector | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 0.151 ms | 0 - 21 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceLandmarkDetector.tflite) |
73
- | MediaPipeFaceLandmarkDetector | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 0.157 ms | 0 - 21 MB | FP16 | NPU | [MediaPipe-Face-Detection.so](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceLandmarkDetector.so) |
74
- | MediaPipeFaceLandmarkDetector | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 0.254 ms | 0 - 26 MB | FP16 | NPU | [MediaPipe-Face-Detection.onnx](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceLandmarkDetector.onnx) |
75
- | MediaPipeFaceLandmarkDetector | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 0.194 ms | 0 - 17 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceLandmarkDetector.tflite) |
76
- | MediaPipeFaceLandmarkDetector | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 0.199 ms | 0 - 18 MB | FP16 | NPU | Use Export Script |
77
- | MediaPipeFaceLandmarkDetector | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 0.297 ms | 0 - 19 MB | FP16 | NPU | [MediaPipe-Face-Detection.onnx](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceLandmarkDetector.onnx) |
78
- | MediaPipeFaceLandmarkDetector | SA7255P ADP | SA7255P | TFLITE | 3.548 ms | 0 - 13 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceLandmarkDetector.tflite) |
79
- | MediaPipeFaceLandmarkDetector | SA7255P ADP | SA7255P | QNN | 3.554 ms | 0 - 10 MB | FP16 | NPU | Use Export Script |
80
- | MediaPipeFaceLandmarkDetector | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 0.19 ms | 0 - 9 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceLandmarkDetector.tflite) |
81
- | MediaPipeFaceLandmarkDetector | SA8255 (Proxy) | SA8255P Proxy | QNN | 0.219 ms | 0 - 3 MB | FP16 | NPU | Use Export Script |
82
- | MediaPipeFaceLandmarkDetector | SA8295P ADP | SA8295P | TFLITE | 0.573 ms | 0 - 17 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceLandmarkDetector.tflite) |
83
- | MediaPipeFaceLandmarkDetector | SA8295P ADP | SA8295P | QNN | 0.575 ms | 0 - 18 MB | FP16 | NPU | Use Export Script |
84
- | MediaPipeFaceLandmarkDetector | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 0.201 ms | 0 - 8 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceLandmarkDetector.tflite) |
85
- | MediaPipeFaceLandmarkDetector | SA8650 (Proxy) | SA8650P Proxy | QNN | 0.22 ms | 0 - 2 MB | FP16 | NPU | Use Export Script |
86
- | MediaPipeFaceLandmarkDetector | SA8775P ADP | SA8775P | TFLITE | 0.51 ms | 0 - 12 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceLandmarkDetector.tflite) |
87
- | MediaPipeFaceLandmarkDetector | SA8775P ADP | SA8775P | QNN | 0.515 ms | 0 - 10 MB | FP16 | NPU | Use Export Script |
88
- | MediaPipeFaceLandmarkDetector | QCS8275 (Proxy) | QCS8275 Proxy | TFLITE | 3.548 ms | 0 - 13 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceLandmarkDetector.tflite) |
89
- | MediaPipeFaceLandmarkDetector | QCS8275 (Proxy) | QCS8275 Proxy | QNN | 3.554 ms | 0 - 10 MB | FP16 | NPU | Use Export Script |
90
- | MediaPipeFaceLandmarkDetector | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 0.194 ms | 0 - 8 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceLandmarkDetector.tflite) |
91
- | MediaPipeFaceLandmarkDetector | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 0.218 ms | 0 - 4 MB | FP16 | NPU | Use Export Script |
92
- | MediaPipeFaceLandmarkDetector | QCS9075 (Proxy) | QCS9075 Proxy | TFLITE | 0.51 ms | 0 - 12 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceLandmarkDetector.tflite) |
93
- | MediaPipeFaceLandmarkDetector | QCS9075 (Proxy) | QCS9075 Proxy | QNN | 0.515 ms | 0 - 10 MB | FP16 | NPU | Use Export Script |
94
- | MediaPipeFaceLandmarkDetector | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 0.337 ms | 0 - 25 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceLandmarkDetector.tflite) |
95
- | MediaPipeFaceLandmarkDetector | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 0.379 ms | 0 - 28 MB | FP16 | NPU | Use Export Script |
96
- | MediaPipeFaceLandmarkDetector | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 0.297 ms | 0 - 0 MB | FP16 | NPU | Use Export Script |
97
- | MediaPipeFaceLandmarkDetector | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 0.361 ms | 2 - 2 MB | FP16 | NPU | [MediaPipe-Face-Detection.onnx](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/MediaPipeFaceLandmarkDetector.onnx) |
98
 
99
 
100
 
@@ -155,20 +155,20 @@ python -m qai_hub_models.models.mediapipe_face.export
155
  ```
156
  Profiling Results
157
  ------------------------------------------------------------
158
- MediaPipeFaceDetector
159
  Device : Samsung Galaxy S23 (13)
160
  Runtime : TFLITE
161
- Estimated inference time (ms) : 0.5
162
  Estimated peak memory usage (MB): [0, 6]
163
  Total # Ops : 111
164
  Compute Unit(s) : NPU (111 ops)
165
 
166
  ------------------------------------------------------------
167
- MediaPipeFaceLandmarkDetector
168
  Device : Samsung Galaxy S23 (13)
169
  Runtime : TFLITE
170
  Estimated inference time (ms) : 0.2
171
- Estimated peak memory usage (MB): [0, 5]
172
  Total # Ops : 100
173
  Compute Unit(s) : NPU (100 ops)
174
  ```
@@ -192,43 +192,26 @@ import qai_hub as hub
192
  from qai_hub_models.models.mediapipe_face import Model
193
 
194
  # Load the model
195
- model = Model.from_pretrained()
196
- face_detector_model = model.face_detector
197
- face_landmark_detector_model = model.face_landmark_detector
198
 
199
  # Device
200
- device = hub.Device("Samsung Galaxy S23")
201
 
202
  # Trace model
203
- face_detector_input_shape = face_detector_model.get_input_spec()
204
- face_detector_sample_inputs = face_detector_model.sample_inputs()
205
 
206
- traced_face_detector_model = torch.jit.trace(face_detector_model, [torch.tensor(data[0]) for _, data in face_detector_sample_inputs.items()])
207
 
208
  # Compile model on a specific device
209
- face_detector_compile_job = hub.submit_compile_job(
210
- model=traced_face_detector_model ,
211
  device=device,
212
- input_specs=face_detector_model.get_input_spec(),
213
  )
214
 
215
  # Get target model to run on-device
216
- face_detector_target_model = face_detector_compile_job.get_target_model()
217
- # Trace model
218
- face_landmark_detector_input_shape = face_landmark_detector_model.get_input_spec()
219
- face_landmark_detector_sample_inputs = face_landmark_detector_model.sample_inputs()
220
-
221
- traced_face_landmark_detector_model = torch.jit.trace(face_landmark_detector_model, [torch.tensor(data[0]) for _, data in face_landmark_detector_sample_inputs.items()])
222
-
223
- # Compile model on a specific device
224
- face_landmark_detector_compile_job = hub.submit_compile_job(
225
- model=traced_face_landmark_detector_model ,
226
- device=device,
227
- input_specs=face_landmark_detector_model.get_input_spec(),
228
- )
229
-
230
- # Get target model to run on-device
231
- face_landmark_detector_target_model = face_landmark_detector_compile_job.get_target_model()
232
 
233
  ```
234
 
@@ -240,15 +223,11 @@ After compiling models from step 1. Models can be profiled model on-device using
240
  provisioned in the cloud. Once the job is submitted, you can navigate to a
241
  provided job URL to view a variety of on-device performance metrics.
242
  ```python
243
- face_detector_profile_job = hub.submit_profile_job(
244
- model=face_detector_target_model,
245
- device=device,
246
- )
247
- face_landmark_detector_profile_job = hub.submit_profile_job(
248
- model=face_landmark_detector_target_model,
249
  device=device,
250
  )
251
-
252
  ```
253
 
254
  Step 3: **Verify on-device accuracy**
@@ -256,20 +235,13 @@ Step 3: **Verify on-device accuracy**
256
  To verify the accuracy of the model on-device, you can run on-device inference
257
  on sample input data on the same cloud hosted device.
258
  ```python
259
- face_detector_input_data = face_detector_model.sample_inputs()
260
- face_detector_inference_job = hub.submit_inference_job(
261
- model=face_detector_target_model,
262
- device=device,
263
- inputs=face_detector_input_data,
264
- )
265
- face_detector_inference_job.download_output_data()
266
- face_landmark_detector_input_data = face_landmark_detector_model.sample_inputs()
267
- face_landmark_detector_inference_job = hub.submit_inference_job(
268
- model=face_landmark_detector_target_model,
269
  device=device,
270
- inputs=face_landmark_detector_input_data,
271
  )
272
- face_landmark_detector_inference_job.download_output_data()
273
 
274
  ```
275
  With the output of the model, you can compute like PSNR, relative errors or
 
37
 
38
  | Model | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
39
  |---|---|---|---|---|---|---|---|---|
40
+ | FaceDetector | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 0.551 ms | 0 - 6 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceDetector.tflite) |
41
+ | FaceDetector | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 0.537 ms | 1 - 3 MB | FP16 | NPU | [MediaPipe-Face-Detection.so](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceDetector.so) |
42
+ | FaceDetector | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 0.838 ms | 0 - 7 MB | FP16 | NPU | [MediaPipe-Face-Detection.onnx](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceDetector.onnx) |
43
+ | FaceDetector | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 0.403 ms | 0 - 29 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceDetector.tflite) |
44
+ | FaceDetector | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 0.383 ms | 1 - 21 MB | FP16 | NPU | [MediaPipe-Face-Detection.so](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceDetector.so) |
45
+ | FaceDetector | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 0.579 ms | 0 - 26 MB | FP16 | NPU | [MediaPipe-Face-Detection.onnx](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceDetector.onnx) |
46
+ | FaceDetector | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 0.344 ms | 0 - 24 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceDetector.tflite) |
47
+ | FaceDetector | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 0.465 ms | 1 - 21 MB | FP16 | NPU | Use Export Script |
48
+ | FaceDetector | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 0.593 ms | 1 - 21 MB | FP16 | NPU | [MediaPipe-Face-Detection.onnx](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceDetector.onnx) |
49
+ | FaceDetector | SA7255P ADP | SA7255P | TFLITE | 18.69 ms | 0 - 14 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceDetector.tflite) |
50
+ | FaceDetector | SA7255P ADP | SA7255P | QNN | 18.639 ms | 1 - 9 MB | FP16 | NPU | Use Export Script |
51
+ | FaceDetector | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 0.545 ms | 0 - 4 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceDetector.tflite) |
52
+ | FaceDetector | SA8255 (Proxy) | SA8255P Proxy | QNN | 0.533 ms | 1 - 3 MB | FP16 | NPU | Use Export Script |
53
+ | FaceDetector | SA8295P ADP | SA8295P | TFLITE | 1.154 ms | 0 - 19 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceDetector.tflite) |
54
+ | FaceDetector | SA8295P ADP | SA8295P | QNN | 1.057 ms | 0 - 18 MB | FP16 | NPU | Use Export Script |
55
+ | FaceDetector | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 0.551 ms | 0 - 6 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceDetector.tflite) |
56
+ | FaceDetector | SA8650 (Proxy) | SA8650P Proxy | QNN | 0.528 ms | 0 - 2 MB | FP16 | NPU | Use Export Script |
57
+ | FaceDetector | SA8775P ADP | SA8775P | TFLITE | 1.25 ms | 0 - 14 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceDetector.tflite) |
58
+ | FaceDetector | SA8775P ADP | SA8775P | QNN | 1.205 ms | 0 - 10 MB | FP16 | NPU | Use Export Script |
59
+ | FaceDetector | QCS8275 (Proxy) | QCS8275 Proxy | TFLITE | 18.69 ms | 0 - 14 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceDetector.tflite) |
60
+ | FaceDetector | QCS8275 (Proxy) | QCS8275 Proxy | QNN | 18.639 ms | 1 - 9 MB | FP16 | NPU | Use Export Script |
61
+ | FaceDetector | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 0.546 ms | 0 - 6 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceDetector.tflite) |
62
+ | FaceDetector | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 0.543 ms | 1 - 5 MB | FP16 | NPU | Use Export Script |
63
+ | FaceDetector | QCS9075 (Proxy) | QCS9075 Proxy | TFLITE | 1.25 ms | 0 - 14 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceDetector.tflite) |
64
+ | FaceDetector | QCS9075 (Proxy) | QCS9075 Proxy | QNN | 1.205 ms | 0 - 10 MB | FP16 | NPU | Use Export Script |
65
+ | FaceDetector | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 0.827 ms | 0 - 21 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceDetector.tflite) |
66
+ | FaceDetector | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 0.868 ms | 1 - 28 MB | FP16 | NPU | Use Export Script |
67
+ | FaceDetector | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 0.669 ms | 1 - 1 MB | FP16 | NPU | Use Export Script |
68
+ | FaceDetector | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 0.845 ms | 2 - 2 MB | FP16 | NPU | [MediaPipe-Face-Detection.onnx](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceDetector.onnx) |
69
+ | FaceLandmarkDetector | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 0.19 ms | 0 - 8 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceLandmarkDetector.tflite) |
70
+ | FaceLandmarkDetector | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 0.216 ms | 0 - 2 MB | FP16 | NPU | [MediaPipe-Face-Detection.so](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceLandmarkDetector.so) |
71
+ | FaceLandmarkDetector | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 0.373 ms | 0 - 8 MB | FP16 | NPU | [MediaPipe-Face-Detection.onnx](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceLandmarkDetector.onnx) |
72
+ | FaceLandmarkDetector | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 0.146 ms | 0 - 26 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceLandmarkDetector.tflite) |
73
+ | FaceLandmarkDetector | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 0.156 ms | 0 - 21 MB | FP16 | NPU | [MediaPipe-Face-Detection.so](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceLandmarkDetector.so) |
74
+ | FaceLandmarkDetector | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 0.266 ms | 0 - 21 MB | FP16 | NPU | [MediaPipe-Face-Detection.onnx](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceLandmarkDetector.onnx) |
75
+ | FaceLandmarkDetector | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 0.127 ms | 0 - 19 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceLandmarkDetector.tflite) |
76
+ | FaceLandmarkDetector | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 0.17 ms | 0 - 15 MB | FP16 | NPU | Use Export Script |
77
+ | FaceLandmarkDetector | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 0.293 ms | 0 - 20 MB | FP16 | NPU | [MediaPipe-Face-Detection.onnx](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceLandmarkDetector.onnx) |
78
+ | FaceLandmarkDetector | SA7255P ADP | SA7255P | TFLITE | 3.548 ms | 0 - 13 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceLandmarkDetector.tflite) |
79
+ | FaceLandmarkDetector | SA7255P ADP | SA7255P | QNN | 3.543 ms | 0 - 10 MB | FP16 | NPU | Use Export Script |
80
+ | FaceLandmarkDetector | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 0.205 ms | 0 - 8 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceLandmarkDetector.tflite) |
81
+ | FaceLandmarkDetector | SA8255 (Proxy) | SA8255P Proxy | QNN | 0.222 ms | 0 - 4 MB | FP16 | NPU | Use Export Script |
82
+ | FaceLandmarkDetector | SA8295P ADP | SA8295P | TFLITE | 0.569 ms | 0 - 18 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceLandmarkDetector.tflite) |
83
+ | FaceLandmarkDetector | SA8295P ADP | SA8295P | QNN | 0.613 ms | 0 - 18 MB | FP16 | NPU | Use Export Script |
84
+ | FaceLandmarkDetector | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 0.198 ms | 0 - 7 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceLandmarkDetector.tflite) |
85
+ | FaceLandmarkDetector | SA8650 (Proxy) | SA8650P Proxy | QNN | 0.217 ms | 0 - 2 MB | FP16 | NPU | Use Export Script |
86
+ | FaceLandmarkDetector | SA8775P ADP | SA8775P | TFLITE | 0.501 ms | 0 - 12 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceLandmarkDetector.tflite) |
87
+ | FaceLandmarkDetector | SA8775P ADP | SA8775P | QNN | 0.519 ms | 0 - 10 MB | FP16 | NPU | Use Export Script |
88
+ | FaceLandmarkDetector | QCS8275 (Proxy) | QCS8275 Proxy | TFLITE | 3.548 ms | 0 - 13 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceLandmarkDetector.tflite) |
89
+ | FaceLandmarkDetector | QCS8275 (Proxy) | QCS8275 Proxy | QNN | 3.543 ms | 0 - 10 MB | FP16 | NPU | Use Export Script |
90
+ | FaceLandmarkDetector | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 0.19 ms | 0 - 8 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceLandmarkDetector.tflite) |
91
+ | FaceLandmarkDetector | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 0.219 ms | 0 - 4 MB | FP16 | NPU | Use Export Script |
92
+ | FaceLandmarkDetector | QCS9075 (Proxy) | QCS9075 Proxy | TFLITE | 0.501 ms | 0 - 12 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceLandmarkDetector.tflite) |
93
+ | FaceLandmarkDetector | QCS9075 (Proxy) | QCS9075 Proxy | QNN | 0.519 ms | 0 - 10 MB | FP16 | NPU | Use Export Script |
94
+ | FaceLandmarkDetector | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 0.348 ms | 0 - 26 MB | FP16 | NPU | [MediaPipe-Face-Detection.tflite](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceLandmarkDetector.tflite) |
95
+ | FaceLandmarkDetector | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 0.366 ms | 0 - 21 MB | FP16 | NPU | Use Export Script |
96
+ | FaceLandmarkDetector | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 0.309 ms | 0 - 0 MB | FP16 | NPU | Use Export Script |
97
+ | FaceLandmarkDetector | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 0.36 ms | 1 - 1 MB | FP16 | NPU | [MediaPipe-Face-Detection.onnx](https://huggingface.co/qualcomm/MediaPipe-Face-Detection/blob/main/FaceLandmarkDetector.onnx) |
98
 
99
 
100
 
 
155
  ```
156
  Profiling Results
157
  ------------------------------------------------------------
158
+ FaceDetector
159
  Device : Samsung Galaxy S23 (13)
160
  Runtime : TFLITE
161
+ Estimated inference time (ms) : 0.6
162
  Estimated peak memory usage (MB): [0, 6]
163
  Total # Ops : 111
164
  Compute Unit(s) : NPU (111 ops)
165
 
166
  ------------------------------------------------------------
167
+ FaceLandmarkDetector
168
  Device : Samsung Galaxy S23 (13)
169
  Runtime : TFLITE
170
  Estimated inference time (ms) : 0.2
171
+ Estimated peak memory usage (MB): [0, 8]
172
  Total # Ops : 100
173
  Compute Unit(s) : NPU (100 ops)
174
  ```
 
192
  from qai_hub_models.models.mediapipe_face import Model
193
 
194
  # Load the model
195
+ torch_model = Model.from_pretrained()
 
 
196
 
197
  # Device
198
+ device = hub.Device("Samsung Galaxy S24")
199
 
200
  # Trace model
201
+ input_shape = torch_model.get_input_spec()
202
+ sample_inputs = torch_model.sample_inputs()
203
 
204
+ pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
205
 
206
  # Compile model on a specific device
207
+ compile_job = hub.submit_compile_job(
208
+ model=pt_model,
209
  device=device,
210
+ input_specs=torch_model.get_input_spec(),
211
  )
212
 
213
  # Get target model to run on-device
214
+ target_model = compile_job.get_target_model()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
215
 
216
  ```
217
 
 
223
  provisioned in the cloud. Once the job is submitted, you can navigate to a
224
  provided job URL to view a variety of on-device performance metrics.
225
  ```python
226
+ profile_job = hub.submit_profile_job(
227
+ model=target_model,
 
 
 
 
228
  device=device,
229
  )
230
+
231
  ```
232
 
233
  Step 3: **Verify on-device accuracy**
 
235
  To verify the accuracy of the model on-device, you can run on-device inference
236
  on sample input data on the same cloud hosted device.
237
  ```python
238
+ input_data = torch_model.sample_inputs()
239
+ inference_job = hub.submit_inference_job(
240
+ model=target_model,
 
 
 
 
 
 
 
241
  device=device,
242
+ inputs=input_data,
243
  )
244
+ on_device_output = inference_job.download_output_data()
245
 
246
  ```
247
  With the output of the model, you can compute like PSNR, relative errors or