Skip to content

Hand Gesture Recognition

Hand gesture recognition

Recognise hand signs and hand movements from a webcam, using hand tracking that runs in your browser.

Try it in Studio
On this page

What is a Hands project?

A Hands project teaches a model to recognise what one hand is doing in front of a camera. You show a gesture to your webcam, Studio tracks the hand and records the positions of its joints, and the model learns which pattern belongs to which gesture. For example:

  • hand signs such as fist, open palm, thumbs up or peace,
  • counting fingers from one to five,
  • movements such as a wave, a swipe left or a pinch,
  • touch-free controls for a kiosk, a lab instrument or a presentation.

In Studio it is a Motion: Gesture Recognition project with the Camera input source and Hands selected under What will you track?

How hand tracking works

Studio does not learn from the camera picture itself. Instead, a hand tracking model finds the hand in each video frame and marks 21 hand landmarks: the wrist and four points along each finger.

  1. 1Camera frameYour webcam, in the browser
  2. 2Hand trackingFinds one hand
  3. 321 hand landmarksx, y and depth for each point
  4. 4Landmarks blockCentres and scales the hand
  5. 5Your modelPicks the gesture
From camera to prediction

While the camera is on, you see the landmarks drawn over the video as a thin white skeleton. When tracking is weak, the skeleton fades.

Before the model sees the landmarks, the Landmarks processing block centres the hand on the wrist and scales it to the size of the palm. That is why it does not matter where your hand is in the picture, or how far it is from the camera, as long as it is clearly visible.

Held poses and movements

Decide early which kind of gesture you want to recognise, because you record and train them differently:

A held poseA movement
What it isA hand shape you hold stillSomething your hand does over time
Examplesfist, thumbs up, three fingerswave, swipe left, pinch
Capture intent when recordingHold pose (3 s takes by default)Movement (5 s takes by default)
Impulse choiceA held pose (Dense learning block)A movement (Conv1D learning block)
Extra labelAn other label for shapes you don't want recognisedAn idle label for a resting hand

You can use the same project for either kind, but one impulse recognises one kind.

What the data looks like

Each recording is called a take. A take is a table with one row every 33 ms (30 rows per second), and one column per landmark coordinate:

timestamphand_00_xhand_00_yhand_00_z…hand_20_zhand_side
00.5120.6340.000…-0.0411
33.330.5150.6300.000…-0.0431
  • x and y are positions in the camera picture, from 0 (left or top) to 1 (right or bottom).
  • z is an estimate of depth. A single camera measures depth poorly, so Studio leaves it out unless you turn on Use depth (z).
  • hand_side is the side the tracker reports for the hand: 1 for right, 0 for left. By default Studio treats a left hand as a right hand, so one model works for both.

Good gestures to start with

  • Pick gestures that look clearly different from each other. Fist and open palm are easy; three fingers and four fingers need more takes.
  • Start with 3 to 5 labels, and record at least 10 takes per label. Studio needs at least 3 takes per label to train, validate and test.
  • Ask a few different people, and record in a couple of different places or lighting conditions.
  • Keep one hand in view. Studio tracks one hand at a time.

Technical details

  • Tracking uses the hand landmark model from Google's MediaPipe, running in the browser on the GPU when it can and on the CPU otherwise. The status chip on the capture page shows its version.
  • Each frame gives 21 landmarks × 3 coordinates + the reported hand side = 64 channels.
  • Takes are trimmed, short gaps of up to 3 frames are filled in, and the take is resampled to 30 Hz before it is saved.
  • A deployed model takes a window of prepared landmarks as input, not camera frames. See Hand gesture workflow.

What next?