A React-based visual tool for selecting, grouping, and exporting MediaPipe Face Mesh landmarks on custom images.
This app lets you interactively pick from the 468 FaceMesh points, organize them into reusable groups, and export clean JSON configurations for use in masks, filters, AR effects, or face analysis pipelines.
👉 Try it live: https://robertobalestri.github.io/FaceMesh-Landmark-Selector/
Detailed documentation is available in the docs folder:
- User Manual (how_to_use.md): A complete walkthrough of controls, canvas navigation, selection tools, and the new interactive Transform (Drag) Mode.
- Data Export Guide (export.md): Details the structure, mathematics, and code formats for exported indices and modified coordinates (normalized and pixel spaces).
If you’ve worked with MediaPipe FaceMesh, you already know the pain:
- The face mesh has 468 landmarks
- The official diagrams are static and hard to interpret
- Selecting landmark indices usually means:
- Trial-and-error
- Printing reference images
- Guessing numbers
- Writing temporary debug overlays
- Repeating the process every time
Want to build:
- Lipstick masks
- Eye shadow regions
- Face paint
- Beard or makeup filters
You need exact landmark indices for lips, eyelids, cheeks, and jawlines.
This tool lets you paint regions directly on the face and export them as JSON.
Perfect for:
- Emotion detection
- Facial symmetry analysis
- Region-based metrics
- Custom landmark clustering
Create named, reusable landmark groups with visual verification.
Select landmarks for:
- Face-attached meshes
- Deformation zones
- UV mapping
- Face-following geometry
Export clean data ready for rendering pipelines.
Stop guessing landmark numbers.
See exactly what each index represents, instantly.
- Automatically detects 468 MediaPipe Face Mesh landmarks
- Works with custom uploaded images
- Create unlimited groups
- Rename, delete, customize color
- Toggle visibility per group to isolate selections
- Brush Select: Click & drag to select points, or right-click to subtract.
- Transform (Drag) Mode: Directly drag points on the canvas to adjust coordinates.
- 🪞 Symmetric Drag Toggle: Mirror landmark adjustments on the opposite side of the face topologically.
- ✨ Smart Presets: Instantly load points for Eyes, Lips, Eyebrows, and Face Oval.
- 🔄 Undo/Redo: Full history support for selection changes.
- Zoom & Pan: Smooth scroll wheel zoom and click-and-drag panning.
- Mesh Wireframe Toggle: Overlay the FaceMesh triangulation grid.
- Hover Tooltip: Inspect landmark index numbers under the mouse instantly.
- Specular Mirroring & Inverse Selection: One-click actions on selection groups.
- Automatically saves all groups, active selections, visibility, colors, and coordinates to the browser's
localStoragein real time. - Recover your editor state instantly upon browser refresh.
- Indices-Only: Export groups as JSON, CSV, or TXT.
-
Coordinates (Includes Offset Nudges): Export absolute pixel coordinates (
$x, y, z$ ) or normalized coordinates ($x, y, z$ ) as JSON or CSV. - JSON Import: Reload previous configurations directly back into the editor.
- Upload custom images
- Default image included for testing
The exported JSON is a dictionary where keys are group names and values are arrays of landmark indices.
{
"Upper Lip": [61, 185, 40, 39, 37, 0, 267, 269, 270, 409, 291],
"Lower Lip": [146, 91, 181, 84, 17, 314, 405, 321, 375, 291],
"Left Eye": [33, 246, 161, 160, 159, 158, 157, 173, 133, 155, 154, 153],
"Nose Tip": [1]
}- Framework: React 19 + Vite
- Language: TypeScript
- Face Detection: MediaPipe Face Mesh
- Styling: CSS Modules + Tailwind
- Icons: Lucide React
- Node.js v18+
- npm or yarn
git clone https://github.com/robertobalestri/FaceMesh-Landmark-Selector.git
cd FaceMesh-Landmark-Selector
npm installnpm run dev- Upload an image
- Create selection groups
- Brush-select landmarks
- Refine with symmetry and visibility
- Export JSON
- Undo/Redo History: Robust state management for selection changes.
- Smart Presets: Quickly select common regions (Lips, Eyes, Eyebrows, Face Oval).
- Wireframe Mode: Visualize the face mesh triangulation connections.
- Local Storage Auto-Save: Workspace session auto-save and restore.
- Direct Landmark Warping: Mouse drag-and-drop point translation.
- Symmetric Specular Drag: Anatomically exact topological mirroring.
- Split-screen WebGL 3D View: Live Three.js head mesh projection viewport.
- AR Export Profiles: Engine-specific configurations (Spark AR, Lens Studio, TikTok).
- 478 Attention Mesh: High-resolution iris and pupil landmarks.
- Lasso Selection: Freeform select grouping.
MIT
