--- library_name: pytorch license: other tags: - real_time - android pipeline_tag: object-detection --- ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/mediapipe_face/web-assets/model_demo.png) # MediaPipe-Face-Detection: Optimized for Qualcomm Devices Designed for sub-millisecond processing, this model predicts bounding boxes and pose skeletons (left eye, right eye, nose tip, mouth, left eye tragion, and right eye tragion) of faces in an image. This is based on the implementation of MediaPipe-Face-Detection found [here](https://github.com/zmurez/MediaPipePyTorch/). This repository contains pre-exported model files optimized for Qualcomm® devices. You can use the [Qualcomm® AI Hub Models](https://github.com/qualcomm/ai-hub-models/blob/main/src/qai_hub_models/models/mediapipe_face) library to export with custom configurations. More details on model performance across various devices, can be found [here](#performance-summary). Qualcomm AI Hub Models uses [Qualcomm AI Hub Workbench](https://workbench.aihub.qualcomm.com) to compile, profile, and evaluate this model. [Sign up](https://myaccount.qualcomm.com/signup) to run these models on a hosted Qualcomm® device. ## Getting Started There are two ways to deploy this model on your device: ### Option 1: Download Pre-Exported Models Below are pre-exported model assets ready for deployment. | Runtime | Precision | Chipset | SDK Versions | Download | |---|---|---|---|---| | ONNX | float | Universal | QAIRT 2.42, ONNX Runtime 1.24.3 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/mediapipe_face/releases/v0.52.0/mediapipe_face-onnx-float.zip) | QNN_DLC | float | Universal | QAIRT 2.45 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/mediapipe_face/releases/v0.52.0/mediapipe_face-qnn_dlc-float.zip) | TFLITE | float | Universal | QAIRT 2.45 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/mediapipe_face/releases/v0.52.0/mediapipe_face-tflite-float.zip) For more device-specific assets and performance metrics, visit **[MediaPipe-Face-Detection on Qualcomm® AI Hub](https://aihub.qualcomm.com/models/mediapipe_face)**. ### Option 2: Export with Custom Configurations Use the [Qualcomm® AI Hub Models](https://github.com/qualcomm/ai-hub-models/blob/main/src/qai_hub_models/models/mediapipe_face) Python library to compile and export the model with your own: - Custom weights (e.g., fine-tuned checkpoints) - Custom input shapes - Target device and runtime configurations This option is ideal if you need to customize the model beyond the default configuration provided here. See our repository for [MediaPipe-Face-Detection on GitHub](https://github.com/qualcomm/ai-hub-models/blob/main/src/qai_hub_models/models/mediapipe_face) for usage instructions. ## Model Details **Model Type:** Model_use_case.object_detection **Model Stats:** - Input resolution: 256x256 - Number of output classes: 6 - Number of parameters (face_detector): 135K - Model size (face_detector) (w8a8): 260 KB - Number of parameters (face_landmark_detector): 603K - Model size (face_landmark_detector) (w8a8): 750 KB - Model size (face_detector) (float): 557 KB - Model size (face_landmark_detector) (float): 2.33 MB ## Performance Summary | Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit |---|---|---|---|---|---|--- | face_detector | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 0.333 ms | 0 - 34 MB | NPU | face_detector | ONNX | float | Snapdragon® X2 Elite | 0.407 ms | 0 - 0 MB | NPU | face_detector | ONNX | float | Snapdragon® X Elite | 0.88 ms | 2 - 2 MB | NPU | face_detector | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 0.499 ms | 0 - 43 MB | NPU | face_detector | ONNX | float | Qualcomm® QCS8550 (Proxy) | 0.684 ms | 0 - 2 MB | NPU | face_detector | ONNX | float | Qualcomm® QCS9075 | 1.143 ms | 1 - 3 MB | NPU | face_detector | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 0.413 ms | 0 - 29 MB | NPU | face_detector | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 0.271 ms | 1 - 33 MB | NPU | face_detector | QNN_DLC | float | Snapdragon® X2 Elite | 0.546 ms | 1 - 1 MB | NPU | face_detector | QNN_DLC | float | Snapdragon® X Elite | 0.689 ms | 1 - 1 MB | NPU | face_detector | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 0.391 ms | 0 - 40 MB | NPU | face_detector | QNN_DLC | float | Qualcomm® QCS8275 (Proxy) | 2.897 ms | 1 - 30 MB | NPU | face_detector | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 0.528 ms | 1 - 71 MB | NPU | face_detector | QNN_DLC | float | Qualcomm® SA8775P | 0.997 ms | 1 - 32 MB | NPU | face_detector | QNN_DLC | float | Qualcomm® QCS9075 | 0.874 ms | 1 - 3 MB | NPU | face_detector | QNN_DLC | float | Qualcomm® QCS8450 (Proxy) | 0.769 ms | 0 - 37 MB | NPU | face_detector | QNN_DLC | float | Qualcomm® SA7255P | 2.897 ms | 1 - 30 MB | NPU | face_detector | QNN_DLC | float | Qualcomm® SA8295P | 1.099 ms | 0 - 25 MB | NPU | face_detector | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 0.334 ms | 1 - 33 MB | NPU | face_detector | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 0.281 ms | 0 - 32 MB | NPU | face_detector | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 0.397 ms | 0 - 39 MB | NPU | face_detector | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 2.949 ms | 0 - 28 MB | NPU | face_detector | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 0.541 ms | 0 - 72 MB | NPU | face_detector | TFLITE | float | Qualcomm® SA8775P | 1.029 ms | 0 - 32 MB | NPU | face_detector | TFLITE | float | Qualcomm® QCS9075 | 0.887 ms | 0 - 3 MB | NPU | face_detector | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 0.77 ms | 0 - 37 MB | NPU | face_detector | TFLITE | float | Qualcomm® SA7255P | 2.949 ms | 0 - 28 MB | NPU | face_detector | TFLITE | float | Qualcomm® SA8295P | 1.09 ms | 0 - 25 MB | NPU | face_detector | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 0.339 ms | 0 - 32 MB | NPU | face_landmark_detector | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 0.156 ms | 0 - 27 MB | NPU | face_landmark_detector | ONNX | float | Snapdragon® X2 Elite | 0.157 ms | 0 - 0 MB | NPU | face_landmark_detector | ONNX | float | Snapdragon® X Elite | 0.378 ms | 0 - 0 MB | NPU | face_landmark_detector | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 0.207 ms | 0 - 33 MB | NPU | face_landmark_detector | ONNX | float | Qualcomm® QCS8550 (Proxy) | 0.281 ms | 0 - 24 MB | NPU | face_landmark_detector | ONNX | float | Qualcomm® QCS9075 | 0.42 ms | 0 - 3 MB | NPU | face_landmark_detector | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 0.177 ms | 0 - 22 MB | NPU | face_landmark_detector | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 0.126 ms | 0 - 26 MB | NPU | face_landmark_detector | QNN_DLC | float | Snapdragon® X2 Elite | 0.244 ms | 0 - 0 MB | NPU | face_landmark_detector | QNN_DLC | float | Snapdragon® X Elite | 0.331 ms | 0 - 0 MB | NPU | face_landmark_detector | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 0.162 ms | 0 - 33 MB | NPU | face_landmark_detector | QNN_DLC | float | Qualcomm® QCS8275 (Proxy) | 0.852 ms | 0 - 23 MB | NPU | face_landmark_detector | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 0.219 ms | 0 - 72 MB | NPU | face_landmark_detector | QNN_DLC | float | Qualcomm® SA8775P | 0.441 ms | 0 - 24 MB | NPU | face_landmark_detector | QNN_DLC | float | Qualcomm® QCS9075 | 0.332 ms | 0 - 3 MB | NPU | face_landmark_detector | QNN_DLC | float | Qualcomm® QCS8450 (Proxy) | 0.328 ms | 0 - 38 MB | NPU | face_landmark_detector | QNN_DLC | float | Qualcomm® SA7255P | 0.852 ms | 0 - 23 MB | NPU | face_landmark_detector | QNN_DLC | float | Qualcomm® SA8295P | 0.581 ms | 0 - 24 MB | NPU | face_landmark_detector | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 0.151 ms | 0 - 23 MB | NPU | face_landmark_detector | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 0.108 ms | 0 - 27 MB | NPU | face_landmark_detector | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 0.148 ms | 0 - 33 MB | NPU | face_landmark_detector | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 0.912 ms | 0 - 23 MB | NPU | face_landmark_detector | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 0.194 ms | 0 - 1 MB | NPU | face_landmark_detector | TFLITE | float | Qualcomm® SA8775P | 0.42 ms | 0 - 25 MB | NPU | face_landmark_detector | TFLITE | float | Qualcomm® QCS9075 | 0.309 ms | 0 - 4 MB | NPU | face_landmark_detector | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 0.314 ms | 0 - 37 MB | NPU | face_landmark_detector | TFLITE | float | Qualcomm® SA7255P | 0.912 ms | 0 - 23 MB | NPU | face_landmark_detector | TFLITE | float | Qualcomm® SA8295P | 0.587 ms | 0 - 25 MB | NPU | face_landmark_detector | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 0.134 ms | 0 - 29 MB | NPU ## License * The license for the original implementation of MediaPipe-Face-Detection can be found [here](https://github.com/zmurez/MediaPipePyTorch/blob/master/LICENSE). ## References * [BlazeFace: Sub-millisecond Neural Face Detection on Mobile GPUs](https://arxiv.org/abs/1907.05047) * [Source Model Implementation](https://github.com/zmurez/MediaPipePyTorch/) ## Community * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI. * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).