face-landmark-detection Β· vision Β· MediaPipe Β· ~4 MB
MediaPipe's FaceLandmarker finds a face in an image or video and returns a dense
478-point mesh, plus 52 blendshape coefficients β ARKit-style
expression channels like jawOpen, mouthSmileLeft, and
eyeBlinkRight β and a 4Γ4 head-pose matrix. It's a real downloadable
.task model that runs on-device via WebAssembly (with a GPU delegate when
available). Drop a photo or turn on your webcam and watch the expression bars move.
| Model | MediaPipe FaceLandmarker (Google) |
|---|---|
| Runtime | MediaPipe Tasks Vision (@mediapipe/tasks-vision) β .task bundle |
| Output | 478 landmarks (x, y, z normalized), 52 blendshapes, 4Γ4 facial transformation matrix |
| Faces | 1 by default (configurable via numFaces) |
| Delegate | GPU when a WebGPU/WebGL adapter exists, otherwise CPU (XNNPACK) |
| Download | ~4 MB .task file, cached by the browser after first load |
| License | Apache-2.0 (Google MediaPipe) |
| Web APIs | WebAssembly, Canvas, getUserMedia β all Baseline widely available |
Pick a sample face, drop your own photo, or use your webcam. The 478-point mesh is drawn on the canvas and the 52 blendshapes animate as a live bar panel.
The model's 52 expression coefficients, highest first (0 = not active, 1 = fully active). This is the same signal a face-driven avatar reads.
Detect a face to see its 52 blendshape values.
A face comes back as 478 normalized x, y, z landmarks, the 52 blendshapes above,
and a 4Γ4 transformation matrix that encodes where the head is pointing. Below are a handful of
named landmark coordinates and the head pose (yaw/pitch/roll) decoded from that matrix β exactly
what the model returned for the current face.
| # | landmark | x | y | z |
|---|
Face-mesh tracking used to mean ARKit, a native SDK, or a cloud vision API. FaceLandmarker turns "where is the face, and what expression is it making?" into a local function call in any browser β private, offline, and fast enough for a live camera on a phone. The blendshapes are the real prize: 52 ready-made expression channels you can drive anything with.
Mesh a sample face and read its landmark coordinates and head pose β feel what the model returns.
An attention / drowsiness monitor: blink, yawn, and look-away cues from the blendshapes, live.
An emoji that mirrors your face β a live puppet driven entirely by your blendshapes.
Face + Hands together: full-expression mesh with detailed finger tracking on one canvas.
MediaPipe Tasks loads a .task bundle and gives you a landmarker you call per image or per video frame:
import { FilesetResolver, FaceLandmarker } from "@mediapipe/tasks-vision";
const vision = await FilesetResolver.forVisionTasks(".../wasm");
const face = await FaceLandmarker.createFromOptions(vision, {
baseOptions: {
modelAssetPath: ".../face_landmarker.task", // ~4 MB
delegate: "GPU", // or "CPU"
},
numFaces: 1,
outputFaceBlendshapes: true, // the 52 expression channels
outputFacialTransformationMatrixes: true, // head-pose matrix
runningMode: "IMAGE", // or "VIDEO"
});
const result = face.detect(imageElement);
// result.faceLandmarks β [ [ {x,y,z} Γ 478 ], β¦ ] (normalized 0β1)
// result.faceBlendshapes β [ { categories:[ {categoryName,score} Γ 52 ] }, β¦ ]
// result.facialTransformationMatrixes β [ { data:[16 floats] }, β¦ ]
This page loads the model through the showcase's shared auto-init loader and draws the mesh on a canvas at the image's natural resolution; for the webcam it switches the task to VIDEO mode and calls detectForVideo each frame.