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 StudioOn 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.
- 1Camera frameYour webcam, in the browser
- 2Hand trackingFinds one hand
- 321 hand landmarksx, y and depth for each point
- 4Landmarks blockCentres and scales the hand
- 5Your modelPicks the gesture
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 pose | A movement | |
|---|---|---|
| What it is | A hand shape you hold still | Something your hand does over time |
| Examples | fist, thumbs up, three fingers | wave, swipe left, pinch |
| Capture intent when recording | Hold pose (3 s takes by default) | Movement (5 s takes by default) |
| Impulse choice | A held pose (Dense learning block) | A movement (Conv1D learning block) |
| Extra label | An other label for shapes you don't want recognised | An 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:
| timestamp | hand_00_x | hand_00_y | hand_00_z | … | hand_20_z | hand_side |
|---|---|---|---|---|---|---|
| 0 | 0.512 | 0.634 | 0.000 | … | -0.041 | 1 |
| 33.33 | 0.515 | 0.630 | 0.000 | … | -0.043 | 1 |
xandyare positions in the camera picture, from 0 (left or top) to 1 (right or bottom).zis an estimate of depth. A single camera measures depth poorly, so Studio leaves it out unless you turn on Use depth (z).hand_sideis 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.