← All models

gesture-recognition Β· vision Β· MediaPipe Β· ~8 MB

GestureRecognizer β€” name the gesture

MediaPipe's GestureRecognizer finds a hand and classifies it into one of eight built-in gestures β€” πŸ‘ Thumb_Up, πŸ‘Ž Thumb_Down, ✌️ Victory, ✊ Closed_Fist, βœ‹ Open_Palm, ☝️ Pointing_Up, 🀟 ILoveYou, or None β€” with a confidence score, and hands you the 21 hand landmarks too. 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.

At a glance

ModelMediaPipe GestureRecognizer (Google)
RuntimeMediaPipe Tasks Vision (@mediapipe/tasks-vision) β€” .task bundle
OutputTop gesture + score per hand, 8 classes, plus 21 hand landmarks & handedness
Hands1 by default (configurable via numHands)
DelegateGPU when a WebGPU/WebGL adapter exists, otherwise CPU (XNNPACK)
Download~8 MB .task file, cached by the browser after first load
LicenseApache-2.0 (Google MediaPipe)
Web APIsWebAssembly, Canvas, getUserMedia β€” all Baseline widely available

Run it

Pick a sample hand, drop your own photo, or use your webcam. The recognised gesture and its score show up big; the 21 landmarks are drawn on the canvas.

Drop a hand photo here, or click to choose
A thumbs up A peace / victory sign Two open hands
Gesture
β€”
show a hand…

See inside

The model returns a ranked list of gesture scores for each hand, plus which hand it is (handedness) and how confident that call is. Below is the full ranking for the first detected hand β€” every class the model scored, highest first, exactly as returned.

Recognise a gesture to see the full score ranking.

Why it matters

A named gesture is a ready-made button. GestureRecognizer turns "what is the hand doing?" into a single local call β€” no training data, no depth camera, no cloud. Eight canonical gestures cover a surprising amount of UI: yes/no, next/back, select, stop.

Use cases

Basics

Name the gesture in a sample photo and read the full class ranking β€” feel what the model returns.

Practical

A gesture remote: map πŸ‘ ✊ βœ‹ ✌️ to real UI actions and watch the app respond, live.

Wild

Rock-paper-scissors against the computer β€” throw a gesture and it plays back.

Multi-model

Gesture + Face: a reaction cam that names your gesture while it tracks your expression.

How the API works

MediaPipe Tasks loads a .task bundle and gives you a recognizer you call per image or per video frame:

import { FilesetResolver, GestureRecognizer } from "@mediapipe/tasks-vision";

const vision = await FilesetResolver.forVisionTasks(".../wasm");
const rec = await GestureRecognizer.createFromOptions(vision, {
  baseOptions: {
    modelAssetPath: ".../gesture_recognizer.task",  // ~8 MB
    delegate: "GPU",                                 // or "CPU"
  },
  numHands: 1,
  runningMode: "IMAGE",                              // or "VIDEO"
});

const result = rec.recognize(imageElement);
// result.gestures  β†’ [ [ { categoryName:"Thumb_Up", score } , … ] , … ]  (ranked per hand)
// result.landmarks β†’ [ [ {x,y,z} Γ— 21 ], … ]  (normalized 0–1)
// result.handedness β†’ [ [ { categoryName:"Right", score } ], … ]

This page loads the model through the showcase's shared auto-init loader and draws the landmarks on a canvas; for the webcam it switches the task to VIDEO mode and calls recognizeForVideo each frame.

References