Instructions to use litert-community/MediaPipe-FaceDetector-BlazeFace-Full-Range with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use litert-community/MediaPipe-FaceDetector-BlazeFace-Full-Range with LiteRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
MediaPipe BlazeFace (Full-Range)
Full-range single-shot face detector (blaze_face_full_range.tflite, 1.1 MB, FP16 weights) optimized for full-range smartphone camera images (such as back-facing cameras within ≈5 meters), packaged for the MediaPipe Face Detector (FaceDetector) task and LiteRT.
Documentation: MediaPipe Face Detector Docs
Samples: Android · iOS · Python Colab · Web · Flutter
Try live: Web Demo
BlazeFace (full-range) uses a CenterNet-like convolutional architecture with a custom encoder to detect smaller or farther faces (within ≈5 meters), such as those captured by rear smartphone cameras.
For each detected face, the MediaPipe FaceDetector task decodes the raw anchor predictions and applies Non-Maximum Suppression (NMS) to return:
- Axis-aligned bounding box (
origin_x,origin_y,width,heightin pixels) - 6 approximate 2D facial keypoints normalized to
[0.0, 1.0](left_eye,right_eye,nose_tip,mouth,left_eye_tragion,right_eye_tragionfrom the observer's perspective) - Detection confidence score in
[0.0, 1.0]
Expects a [1, 192, 192, 3] float32 RGB input normalized to [-1.0, 1.0] (resizing and normalization are handled automatically by MediaPipe FaceDetector).
Files
| File | Precision | Size | SHA-256 |
|---|---|---|---|
blaze_face_full_range.tflite |
float16 |
1.08 MB (1,083,786 B) | 3698b18f063835bc609069ef052228fbe86d9c9a6dc8dcb7c7c2d69aed2b181b |
Companion Files in Repo Root
| File | Role | Size | SHA-256 |
|---|---|---|---|
MediaPipe BlazeFace Model Card (Full Range).pdf |
Upstream Google model card (PDF) | 425.6 KB (425,555 B) | ef24b99475d69bd0e52f504cfd9a17a220121b925dac3e7f7042147ebd6243d5 |
Download
pip install -U huggingface_hub
hf download litert-community/MediaPipe-FaceDetector-BlazeFace-Full-Range blaze_face_full_range.tflite --local-dir .
Inputs, Outputs, and Model Specifications
blaze_face_full_range.tflite
- Embedded
TFLITE_METADATA: nameFull Range Face Detection
| Direction | Tensor | Shape | Type | Notes |
|---|---|---|---|---|
| Input | input |
[1, 192, 192, 3] |
float32 |
image — Input image to be detected — Normalization: mean=[127.5], std=[127.5] |
| Output | reshaped_regressor_face_4 |
[1, 2304, 16] |
float32 |
raw boxes/keypoints — Undecoded face bboxes location and keypoints |
| Output | reshaped_classifier_face_4 |
[1, 2304, 1] |
float32 |
scores — Scores of the detected bboxes. |
Use with MediaPipe Tasks
Python Quickstart
pip install -U mediapipe huggingface_hub
import mediapipe as mp
from huggingface_hub import hf_hub_download
model_path = hf_hub_download(
repo_id="litert-community/MediaPipe-FaceDetector-BlazeFace-Full-Range",
filename="blaze_face_full_range.tflite",
)
BaseOptions = mp.tasks.BaseOptions
FaceDetector = mp.tasks.vision.FaceDetector
FaceDetectorOptions = mp.tasks.vision.FaceDetectorOptions
VisionRunningMode = mp.tasks.vision.RunningMode
options = FaceDetectorOptions(
base_options=BaseOptions(model_asset_path=model_path),
running_mode=VisionRunningMode.IMAGE,
min_detection_confidence=0.5,
)
with FaceDetector.create_from_options(options) as runner:
mp_image = mp.Image.create_from_file("input.jpg")
result = runner.detect(mp_image)
for detection in result.detections:
bbox = detection.bounding_box
score = detection.categories[0].score
print(f"Face score={score:.3f} box=({bbox.origin_x}, {bbox.origin_y}, {bbox.width}, {bbox.height})")
Cross-Platform Guides & Samples
- Task overview & options: Face Detector documentation
- Platform setup guides: Python · Web / JavaScript · Android (Kotlin / Java) · iOS (Swift) · Flutter (Dart)
- Runnable sample apps: Web Demo · Web Source · Android · iOS · Python Notebook · Flutter
Latency Benchmarks
The MediaPipe Face Detector documentation table reports Pixel 6 latency only for BlazeFace (short-range) (2.94 ms CPU / 7.41 ms GPU). For this full-range variant, the bundled PDF model card reports: ≈90 FPS (Pixel 3 GPU), ≈165 FPS (Pixel 4 GPU), ≈50 FPS (Pixel 3 single-core CPU XNNPACK), ≈145 FPS (Pixel 4 CPU XNNPACK).
Intended Use, Limitations, and Fairness
Summarized from the bundled MediaPipe BlazeFace Model Card (Full Range).pdf (Valentin Bazarevsky & Yury Kartynnik, Google, January 19, 2021):
- Intended applications: Detecting prominently displayed faces in images or videos captured by front- and back-facing smartphone cameras for live perception pipelines, mobile AR, and UI enhancements (e.g., auto-zoom / AutoFlip).
- Operating envelope: Designed for faces up to ≈5 meters from the camera, where face bounding box sides are at least 5% of the image dimensions, at least 70% of the face box lies inside the frame, roll/pitch angles are within ±45°, and yaw is within ±90°.
- Out-of-scope uses:
- Any form of surveillance or identity recognition is explicitly out of scope and not enabled by this technology.
- Human life-critical decisions.
- Counting people in crowds, detecting faces > 5 meters away, or detecting individuals looking away / back of the head.
- Known limitations: Produces up to a fixed detection cap (e.g., 10) even when more people are present; low light, sensor noise, motion blur, or face occlusion can reduce quality and increase inter-frame jitter.
- Fairness evaluation (summary): Evaluated across 17 UN geographic subregions (Dataset I: 1,060 images, 60/region + 40 no-face), perceived gender presentation (Dataset II: 1,000 single-face images, 500 feminine / 500 masculine), and 5 Fitzpatrick-aligned skin-tone groups (Dataset III: 500 images, 100/group): average recall 98.9% across genders (99.6% vs. 98.2%), 99.2% across skin tones (98%–100%), 99.3% across subregions (96.7%–100%); average precision 99.8% across genders, 99.6% across skin tones (99%–100%), 89.3% across subregions (88.1%–89.6%).
Provenance
Every model binary in this repository is byte-identical (unmodified FlatBuffer weights and embedded TFLITE_METADATA bytes) to the official artifact served by Google from storage.googleapis.com/mediapipe-models.
| Repo File | Upstream URL | GCS Generation | Upstream Last-Modified |
Pinned Bucket Version |
|---|---|---|---|---|
blaze_face_full_range.tflite |
blaze_face_full_range.tflite |
1773262428607976 |
Wed, 11 Mar 2026 20:53:48 GMT | /1/ |
License and Citation
- License:
apache-2.0— Stated as Apache License, Version 2.0 in the bundled upstream Google model-card PDF.
Citation
@inproceedings{bazarevsky2019blazeface,
title = {BlazeFace: Sub-millisecond Neural Face Detection on Mobile GPUs},
author = {Bazarevsky, Valentin and Kartynnik, Yury and Vakunov, Andrey and Raveendran, Karthik and Grundmann, Matthias},
booktitle = {CVPR Workshop on Computer Vision for Augmented and Virtual Reality},
year = {2019},
url = {https://arxiv.org/abs/1907.05047}
}
- Downloads last month
- 41