What is MediaPipe Face Mesh? Face detection, pose, and how MediaPipe works

MediaPipe is Google's open-source on-device vision framework. Face Mesh, face detection, Pose vs OpenPose, a tutorial, and moving off Haar cascades.

Walking a room through the products he has shipped
Walking a room through the products he has shipped

Key takeaways

  • MediaPipe is an open-source Google framework of ready-made, on-device ML solutions for faces, hands, pose, objects and more.
  • Face Mesh, now the Face Landmarker task, finds hundreds of 3D face landmarks in real time on phones and in browsers.
  • Detection and landmarks locate faces; recognition identifies who someone is, which needs a separate embedding model.
  • MediaPipe Pose tracks 33 body landmarks and runs fast on devices; OpenPose detects multiple people and needs more compute.
  • Replacing Haar cascades with MediaPipe gives far more robust faces and landmarks in a few lines of code.

MediaPipe Face Mesh is a Google model that finds hundreds of 3D landmarks on a face in real time, enough to track eyes, lips and face shape for filters, gaze, expression and liveness checks. It is part of MediaPipe, Google's open-source framework of ready-made, on-device machine learning solutions for faces, hands, pose and objects that run on phones, browsers and desktops. I built browser-based face detection, recognition and liveness in FaceVision, so this page covers how MediaPipe works, Face Mesh and Face Landmarker, face detection, detection versus recognition, Pose versus OpenPose, a tutorial and migrating from Haar cascades.

Is MediaPipe from Google?

Yes. MediaPipe is developed by Google and released as open source under the Apache 2.0 licence. It is now part of Google AI Edge, Google's set of tools for running AI on devices.

Google uses MediaPipe-style pipelines in its own products, and the framework is widely used in apps for fitness, video calls, augmented-reality filters, sign language research and accessibility. It provides solutions through a Tasks API for Python, Android, iOS and the web, plus Model Maker for customising some models with your own data. Because models run on the device, latency is low and images do not need to leave the user's phone or browser.

How does Google MediaPipe work?

MediaPipe runs efficient machine learning models in pipelines that process camera frames: detect an object such as a face or hand, crop the region, run a landmark model on it, and track across frames to avoid repeating expensive detection on every frame.

The Tasks API wraps these pipelines into simple components such as Face Landmarker, Hand Landmarker, Pose Landmarker and Object Detector. Models are optimised for mobile CPUs and GPUs and for WebAssembly and WebGL in browsers. You choose a running mode, for single images, video files or live camera streams, and receive structured results, such as landmark coordinates, which your app uses for drawing, measurement or decisions.

What is MediaPipe Face Mesh?

Face Mesh is MediaPipe's face landmark model that estimates hundreds of 3D points across the face, including eyes, eyebrows, nose, lips and face contour, from a single camera, in real time.

It is used for AR effects and filters, virtual try-on, gaze and blink detection, driver drowsiness monitoring, expression analysis and liveness checks that look for natural movement. The legacy Face Mesh solution has been succeeded by the Face Landmarker task, which provides the same kind of dense landmarks plus extras. Because it runs on device, it suits privacy-conscious apps where raw face images should not be uploaded.

What is MediaPipe Face Landmarker?

Face Landmarker is the current MediaPipe task for face landmarks. It outputs 478 3D landmarks per face, including iris points, plus optional blendshape scores describing expressions, such as smiles or eye blinks, and transformation matrices for placing 3D effects.

It works on images, videos and live streams, can track several faces, and is available in Python, JavaScript, Android and iOS. Blendshapes are useful for animating avatars and detecting expressions without writing geometry code yourself. For new projects, use Face Landmarker rather than the legacy Face Mesh API; the documentation's guide shows setup for each platform and lists the model files to download.

How does MediaPipe face detection work?

MediaPipe face detection uses BlazeFace, a lightweight neural network designed for mobile GPUs, which predicts face bounding boxes and a few key points, such as eyes and nose tip, very quickly.

BlazeFace uses an efficient architecture and anchor scheme tuned for faces at typical phone-camera distances, with separate models for close-range selfie use and full-range scenes. Detection is the first stage: once a face is found, landmark models can run on the cropped region for detailed points. Detection does not identify the person; it only says where faces are.

MediaPipe vs face recognition: what is the difference?

MediaPipe finds faces and their landmarks: where a face is and the shape of its features. Face recognition identifies who a face belongs to, by turning a face into an embedding vector and comparing it with stored embeddings of known people.

So a full recognition system combines both: detect and align the face, compute an embedding with a recognition model, then compare with a database using a similarity threshold, ideally with liveness checks against photos and screens. FaceVision does this in the browser with ONNX Runtime Web, and its FastAPI and PostgreSQL backend stores embeddings only, never images. Face recognition is sensitive: get explicit consent, follow privacy laws, and avoid using it where errors could harm people.

What is MediaPipe Pose?

MediaPipe Pose, now the Pose Landmarker task, detects a person's body and estimates 33 landmarks, such as shoulders, elbows, hips, knees and ankles, in 2D and 3D, in real time on devices. It is based on BlazePose.

Also asked as: mediapipe vs openpose (human pose landmark detection

It powers fitness apps that count repetitions and check form, physiotherapy tools, dance and sports analysis, gesture control and animation. Accuracy is best with the full body visible, good lighting and a single main subject. A typical project computes joint angles, such as the knee angle for squats, from landmark coordinates and applies simple rules or a small classifier to give feedback.

MediaPipe vs OpenPose: which should I use?

Use MediaPipe for fast, on-device single-person pose tracking in apps, especially on phones and in browsers. Use OpenPose, or newer multi-person models, when you need to detect many people at once or need research-style keypoints and can use a GPU.

OpenPose, from Carnegie Mellon University, detects body, hand and face keypoints for multiple people in an image using part affinity fields, and is well known in research. It is heavier and its licence restricts commercial use. MediaPipe is lighter, easier to deploy and Apache-licensed, but focuses on one or a few people. For a mobile fitness app, MediaPipe; for analysing crowded sports footage on a server, a multi-person model.

Is there a Google MediaPipe tutorial?

Yes. The MediaPipe Solutions guide on Google AI Edge has step-by-step guides and code samples for each task. Here is a minimal Python example for face landmarks.

# pip install mediapipe  (download face_landmarker.task from the guide)
import mediapipe as mp
from mediapipe.tasks.python import vision, BaseOptions

opts = vision.FaceLandmarkerOptions(base_options=BaseOptions(model_asset_path="face_landmarker.task"),
                                    output_face_blendshapes=True, num_faces=1)
detector = vision.FaceLandmarker.create_from_options(opts)
image = mp.Image.create_from_file("face.jpg")
result = detector.detect(image)
print(len(result.face_landmarks[0]), "landmarks")

From there, switch to video or live-stream mode and draw landmarks with OpenCV.

How do I migrate from Haar cascades to MediaPipe Face Mesh?

Replace OpenCV's Haar cascade detector with MediaPipe's face detector or Face Landmarker: load the model once, convert each frame to MediaPipe's image format, run detection, and map the results back to pixel coordinates for drawing or cropping.

Also asked as: haar cascades to mediapipe face mesh: migration guide

Why migrate: Haar cascades are fast but fail with tilted faces, poor lighting and partial occlusion, and give only a box. MediaPipe is far more robust and gives landmarks for alignment, gaze and expressions. Migration steps:

  • Keep your OpenCV capture loop; convert frames from BGR to RGB.
  • Use video or live-stream mode with timestamps for tracking.
  • Convert normalised landmark coordinates to pixels by multiplying by width and height.
  • Test on your hardest footage and tune confidence thresholds.

Sources

  1. Google AI Edge, MediaPipe Solutions guideai.google.dev
  2. Google AI Edge, Face landmark detection guideai.google.dev
  3. Google, MediaPipe repositorygithub.com
  4. Bazarevsky et al., BlazeFace: Sub-millisecond Neural Face Detection on Mobile GPUs (2019)arxiv.org
  5. Cao et al., OpenPose: Realtime Multi-Person 2D Pose Estimation (2018)arxiv.org
Pranjul Rathour
Pranjul Rathour
GenAI Engineer · India

GenAI engineer and AI product builder with 2+ years shipping production-grade AI systems: RAG pipelines, fine-tuned LLMs, hybrid retrieval and multi-modal apps across vision, speech and OCR, architected end to end from ingestion to deployment. Leads engineering for SCULT INDIA's 14-member team, founded the 500+ member TechVerse Enclave community and has mentored 200+ students. Three hackathon first prizes: Changethon 2025 (IIT Roorkee), Product Genesis at Vividhotsava 2025 (CSJMU) and BYTEBATTLE (MeetKats).

Open to GenAI roles, hackathon judging, mentorship sessions and guest talks at colleges. For campus sessions the inviting institution covers the visit end to end: travel (a First AC train ticket for journeys up to five hours, a flight for anything longer), accommodation, meals, and pickup and drop; the honorarium and workshop fees are negotiable on WhatsApp or on the call, and requests are welcome from institutions that can cover the visit this way. Email pranjulrathour41@gmail.com.

Keep reading

More on Vision, speech & OCR

All Vision, speech & OCR guides →
Campus talks · hackathon judging · mentoring

Want this as a live session at your college?

Open to GenAI roles, hackathon judging, mentorship sessions and guest talks at colleges. For campus sessions the inviting institution covers the visit end to end: travel (a First AC train ticket for journeys up to five hours, a flight for anything longer), accommodation, meals, and pickup and drop; the honorarium and workshop fees are negotiable on WhatsApp or on the call, and requests are welcome from institutions that can cover the visit this way.

Pranjul Rathour, GenAI engineer in India