Skip to content

Lab · Applied ML

Face mesh, live in your browser

A small experiment in on-device machine learning: real-time face landmark detection with nothing sent to a server. The model, the inference and the rendering all run on your machine.

See a live 478-point face mesh

Everything runs on your device — no video or images ever leave the browser.

MediaPipe FaceLandmarker · WebAssembly · idle

How it works

  1. 01

    Capture

    getUserMedia streams webcam frames into a hidden-or-visible <video>; a requestAnimationFrame loop picks up each new frame exactly once.

  2. 02

    Infer on-device

    MediaPipe's FaceLandmarker runs as WebAssembly with a GPU (WebGL) delegate and CPU fallback, predicting 478 3D landmarks per face per frame.

  3. 03

    Render

    Landmarks are drawn as a tessellated mesh plus eye, brow, lip and iris contours on a mirrored <canvas> overlay, with a live FPS counter.

Engineering note: the first version used TensorFlow.js and the deprecated facemesh model, loaded on every page view. It now uses MediaPipe Tasks, which is maintained, GPU-accelerated and only downloaded when you press “Start camera” — so the rest of the site stays fast.

  • MediaPipe Tasks Vision
  • WebAssembly
  • WebGL
  • Canvas 2D
  • React 19
  • TypeScript