bhushans commited on
Commit
7d9a43f
·
verified ·
1 Parent(s): f9b388a

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +47 -29
README.md CHANGED
@@ -14,7 +14,7 @@ tags:
14
  ## Facial landmark predictor with 3DMM
15
 
16
 
17
- Facial landmark is a deep learning model that can predict 68 landmarks from a single image. It can also be used as a backbone in building more complex models for specific use cases.
18
 
19
  This model is an implementation of Facial-Landmark-Detection found [here](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/facemap_3dmm/model.py).
20
 
@@ -34,29 +34,31 @@ More details on model performance across various devices, can be found
34
 
35
  | Model | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
36
  |---|---|---|---|---|---|---|---|---|
37
- | Facial-Landmark-Detection | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 0.353 ms | 0 - 3 MB | FP16 | NPU | [Facial-Landmark-Detection.tflite](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.tflite) |
38
- | Facial-Landmark-Detection | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 0.356 ms | 0 - 35 MB | FP16 | NPU | [Facial-Landmark-Detection.so](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.so) |
39
- | Facial-Landmark-Detection | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 0.479 ms | 0 - 12 MB | FP16 | NPU | [Facial-Landmark-Detection.onnx](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.onnx) |
40
- | Facial-Landmark-Detection | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 0.27 ms | 0 - 24 MB | FP16 | NPU | [Facial-Landmark-Detection.tflite](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.tflite) |
41
- | Facial-Landmark-Detection | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 0.273 ms | 0 - 11 MB | FP16 | NPU | [Facial-Landmark-Detection.so](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.so) |
42
- | Facial-Landmark-Detection | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 0.381 ms | 0 - 25 MB | FP16 | NPU | [Facial-Landmark-Detection.onnx](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.onnx) |
43
- | Facial-Landmark-Detection | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 0.271 ms | 0 - 15 MB | FP16 | NPU | [Facial-Landmark-Detection.tflite](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.tflite) |
44
- | Facial-Landmark-Detection | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 0.293 ms | 0 - 9 MB | FP16 | NPU | Use Export Script |
45
- | Facial-Landmark-Detection | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 0.344 ms | 0 - 15 MB | FP16 | NPU | [Facial-Landmark-Detection.onnx](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.onnx) |
46
- | Facial-Landmark-Detection | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 0.351 ms | 0 - 2 MB | FP16 | NPU | [Facial-Landmark-Detection.tflite](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.tflite) |
47
- | Facial-Landmark-Detection | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 0.352 ms | 0 - 1 MB | FP16 | NPU | Use Export Script |
48
- | Facial-Landmark-Detection | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 0.352 ms | 0 - 14 MB | FP16 | NPU | [Facial-Landmark-Detection.tflite](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.tflite) |
49
- | Facial-Landmark-Detection | SA8255 (Proxy) | SA8255P Proxy | QNN | 0.357 ms | 0 - 2 MB | FP16 | NPU | Use Export Script |
50
- | Facial-Landmark-Detection | SA8775 (Proxy) | SA8775P Proxy | TFLITE | 0.353 ms | 0 - 2 MB | FP16 | NPU | [Facial-Landmark-Detection.tflite](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.tflite) |
51
- | Facial-Landmark-Detection | SA8775 (Proxy) | SA8775P Proxy | QNN | 0.355 ms | 0 - 1 MB | FP16 | NPU | Use Export Script |
52
- | Facial-Landmark-Detection | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 0.342 ms | 0 - 4 MB | FP16 | NPU | [Facial-Landmark-Detection.tflite](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.tflite) |
53
- | Facial-Landmark-Detection | SA8650 (Proxy) | SA8650P Proxy | QNN | 0.352 ms | 0 - 1 MB | FP16 | NPU | Use Export Script |
54
- | Facial-Landmark-Detection | SA8295P ADP | SA8295P | TFLITE | 0.725 ms | 0 - 14 MB | FP16 | NPU | [Facial-Landmark-Detection.tflite](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.tflite) |
55
- | Facial-Landmark-Detection | SA8295P ADP | SA8295P | QNN | 0.978 ms | 0 - 6 MB | FP16 | NPU | Use Export Script |
56
- | Facial-Landmark-Detection | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 0.447 ms | 0 - 25 MB | FP16 | NPU | [Facial-Landmark-Detection.tflite](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.tflite) |
57
- | Facial-Landmark-Detection | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 0.463 ms | 0 - 13 MB | FP16 | NPU | Use Export Script |
58
- | Facial-Landmark-Detection | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 0.423 ms | 0 - 0 MB | FP16 | NPU | Use Export Script |
59
- | Facial-Landmark-Detection | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 0.504 ms | 12 - 12 MB | FP16 | NPU | [Facial-Landmark-Detection.onnx](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.onnx) |
 
 
60
 
61
 
62
 
@@ -120,10 +122,10 @@ Profiling Results
120
  Facial-Landmark-Detection
121
  Device : Samsung Galaxy S23 (13)
122
  Runtime : TFLITE
123
- Estimated inference time (ms) : 0.4
124
- Estimated peak memory usage (MB): [0, 3]
125
- Total # Ops : 47
126
- Compute Unit(s) : NPU (47 ops)
127
  ```
128
 
129
 
@@ -142,13 +144,29 @@ in memory using the `jit.trace` and then call the `submit_compile_job` API.
142
  import torch
143
 
144
  import qai_hub as hub
145
- from qai_hub_models.models.facemap_3dmm import
146
 
147
  # Load the model
 
148
 
149
  # Device
150
  device = hub.Device("Samsung Galaxy S23")
151
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
 
153
  ```
154
 
 
14
  ## Facial landmark predictor with 3DMM
15
 
16
 
17
+ Real-time 3D facial landmark detection optimized for mobile and edge.
18
 
19
  This model is an implementation of Facial-Landmark-Detection found [here](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/facemap_3dmm/model.py).
20
 
 
34
 
35
  | Model | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
36
  |---|---|---|---|---|---|---|---|---|
37
+ | Facial-Landmark-Detection | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 0.296 ms | 0 - 45 MB | FP16 | NPU | [Facial-Landmark-Detection.tflite](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.tflite) |
38
+ | Facial-Landmark-Detection | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 0.359 ms | 1 - 171 MB | FP16 | NPU | [Facial-Landmark-Detection.so](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.so) |
39
+ | Facial-Landmark-Detection | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 0.466 ms | 0 - 2 MB | FP16 | NPU | [Facial-Landmark-Detection.onnx](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.onnx) |
40
+ | Facial-Landmark-Detection | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 0.225 ms | 0 - 9 MB | FP16 | NPU | [Facial-Landmark-Detection.tflite](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.tflite) |
41
+ | Facial-Landmark-Detection | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 0.27 ms | 0 - 11 MB | FP16 | NPU | [Facial-Landmark-Detection.so](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.so) |
42
+ | Facial-Landmark-Detection | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 0.382 ms | 0 - 25 MB | FP16 | NPU | [Facial-Landmark-Detection.onnx](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.onnx) |
43
+ | Facial-Landmark-Detection | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 0.202 ms | 0 - 8 MB | FP16 | NPU | [Facial-Landmark-Detection.tflite](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.tflite) |
44
+ | Facial-Landmark-Detection | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 0.241 ms | 0 - 8 MB | FP16 | NPU | Use Export Script |
45
+ | Facial-Landmark-Detection | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 0.368 ms | 0 - 16 MB | FP16 | NPU | [Facial-Landmark-Detection.onnx](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.onnx) |
46
+ | Facial-Landmark-Detection | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 0.301 ms | 0 - 3 MB | FP16 | NPU | [Facial-Landmark-Detection.tflite](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.tflite) |
47
+ | Facial-Landmark-Detection | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 0.349 ms | 0 - 2 MB | FP16 | NPU | Use Export Script |
48
+ | Facial-Landmark-Detection | SA7255P ADP | SA7255P | TFLITE | 6.491 ms | 0 - 10 MB | FP16 | NPU | [Facial-Landmark-Detection.tflite](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.tflite) |
49
+ | Facial-Landmark-Detection | SA7255P ADP | SA7255P | QNN | 6.719 ms | 0 - 6 MB | FP16 | NPU | Use Export Script |
50
+ | Facial-Landmark-Detection | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 0.302 ms | 0 - 114 MB | FP16 | NPU | [Facial-Landmark-Detection.tflite](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.tflite) |
51
+ | Facial-Landmark-Detection | SA8255 (Proxy) | SA8255P Proxy | QNN | 0.352 ms | 0 - 1 MB | FP16 | NPU | Use Export Script |
52
+ | Facial-Landmark-Detection | SA8295P ADP | SA8295P | TFLITE | 0.69 ms | 0 - 8 MB | FP16 | NPU | [Facial-Landmark-Detection.tflite](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.tflite) |
53
+ | Facial-Landmark-Detection | SA8295P ADP | SA8295P | QNN | 0.867 ms | 0 - 6 MB | FP16 | NPU | Use Export Script |
54
+ | Facial-Landmark-Detection | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 0.293 ms | 0 - 202 MB | FP16 | NPU | [Facial-Landmark-Detection.tflite](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.tflite) |
55
+ | Facial-Landmark-Detection | SA8650 (Proxy) | SA8650P Proxy | QNN | 0.35 ms | 0 - 2 MB | FP16 | NPU | Use Export Script |
56
+ | Facial-Landmark-Detection | SA8775P ADP | SA8775P | TFLITE | 0.621 ms | 0 - 8 MB | FP16 | NPU | [Facial-Landmark-Detection.tflite](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.tflite) |
57
+ | Facial-Landmark-Detection | SA8775P ADP | SA8775P | QNN | 0.874 ms | 0 - 6 MB | FP16 | NPU | Use Export Script |
58
+ | Facial-Landmark-Detection | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 0.422 ms | 0 - 13 MB | FP16 | NPU | [Facial-Landmark-Detection.tflite](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.tflite) |
59
+ | Facial-Landmark-Detection | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 0.485 ms | 0 - 12 MB | FP16 | NPU | Use Export Script |
60
+ | Facial-Landmark-Detection | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 0.434 ms | 0 - 0 MB | FP16 | NPU | Use Export Script |
61
+ | Facial-Landmark-Detection | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 4.527 ms | 12 - 12 MB | FP16 | NPU | [Facial-Landmark-Detection.onnx](https://huggingface.co/qualcomm/Facial-Landmark-Detection/blob/main/Facial-Landmark-Detection.onnx) |
62
 
63
 
64
 
 
122
  Facial-Landmark-Detection
123
  Device : Samsung Galaxy S23 (13)
124
  Runtime : TFLITE
125
+ Estimated inference time (ms) : 0.3
126
+ Estimated peak memory usage (MB): [0, 45]
127
+ Total # Ops : 38
128
+ Compute Unit(s) : NPU (38 ops)
129
  ```
130
 
131
 
 
144
  import torch
145
 
146
  import qai_hub as hub
147
+ from qai_hub_models.models.facemap_3dmm import Model
148
 
149
  # Load the model
150
+ torch_model = Model.from_pretrained()
151
 
152
  # Device
153
  device = hub.Device("Samsung Galaxy S23")
154
 
155
+ # Trace model
156
+ input_shape = torch_model.get_input_spec()
157
+ sample_inputs = torch_model.sample_inputs()
158
+
159
+ pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
160
+
161
+ # Compile model on a specific device
162
+ compile_job = hub.submit_compile_job(
163
+ model=pt_model,
164
+ device=device,
165
+ input_specs=torch_model.get_input_spec(),
166
+ )
167
+
168
+ # Get target model to run on-device
169
+ target_model = compile_job.get_target_model()
170
 
171
  ```
172