Hand Gesture Recognition
Hand gesture workflow
Every step of a Hands project in Studio, from turning on the camera to a deployed gesture model.
Try it in StudioOn this page
- 1Create projectMotion → Camera → Hands
- 2Connect cameraAllow camera access
- 3Collect dataRecord takes
- 4Label classesCheck labels and split
- 5Create impulseHeld pose or movement
- 6TrainGenerate features, then train
- 7EvaluateScores on unseen takes
- 8Test liveYour webcam, in real time
- 9DeployTFLite package
This page uses a three-gesture example: fist, open palm and thumbs up, plus an other label. Each heading below matches a step in Studio.
1. Create the project
- Open the menu under your profile picture and choose Create new project.
- Type a Project name, for example Desk gestures.
- Choose Motion: Gesture Recognition.
- Under Input source, choose Camera. You cannot change the input source later.
- Under What will you track?, choose Hands.
- Select Create Project.
Studio opens the project on its dashboard. Camera projects have no Devices step: everything is recorded in the browser.
2. Connect the camera
- Open Data acquisition. The page is called Capture: Hands.
- The first time, Studio explains what is saved. Read it and select Got it.
- Select Start camera, and allow camera access when your browser asks.
- Wait for the tracking model to load. This can take a few seconds the first time.
- Hold one hand up to the camera. When the skeleton appears on your hand and the status reads Hand tracked., you are ready.
If you have more than one camera, choose one from the Camera list.
3. Collect data
Each recording is a take. Record many short takes per gesture.
- Under Take setup, type a Label, for example
fist. Studio suggests labels you have used before. - Choose the Capture intent: Hold pose for a hand shape, or Movement for something like a wave.
- Check the Take length: 3 s for a hold and 5 s for a movement by default. Any length from 2 to 20 s works.
- Select Record take, or press Space. After a 3-second countdown (Get ready), Studio records.
- Hold the gesture until the take ends. Select Stop to end it early.
Each take appears in the takes list with its duration, Valid frames and Frame rate. A good take is saved automatically. A take with a problem waits for you: select Save, Discard or Record again.
Repeat for every label. Aim for at least 10 takes each, and vary your hand a little between takes: turn it slightly, move it around the picture, and try the other hand.
Sessions and the test split
Takes are grouped into sessions. Takes from one sitting look alike, so for a fair test:
- Record every label in your first session with Split on Auto. Studio puts about one take in five of each label into the testing set.
- Later, select New session, change something (the time of day, the light, the person or the position), set Split to Testing, and record each label a few more times.
Import landmark CSVs instead
If you already have takes from another PetalEdge project, open Data labeling, type a Label for imported CSV and select Import landmark CSVs. The files must use the same columns as Studio's takes: timestamp, then hand_00_x to hand_20_z, then hand_side, at 30 rows per second, with at least 15 rows. Video files can't be imported.
4. Label classes
Open Data labeling (the Dataset: Hands page) to check your data:
- Class distribution shows how many takes each label has. Keep the labels roughly balanced.
- The Recording sessions table lists every take, on a Training tab and a Testing tab. Select a take to replay its skeleton and check it.
- To fix a label, choose a different one for that take. To remove a bad take, delete it.
- Takes move between Training and Testing a whole session at a time, with Move session to Training/Testing. Rebalance train / test moves takes until each label is about 80 % training and 20 % testing.
Every label needs at least 3 takes so it can be trained, validated and tested. Studio tells you which labels need more.
5. Create impulse
Open Create impulse. A Hands impulse always has the same shape: camera landmarks in, a Landmarks processing block, and a learning block.
- Under What do you want to recognize?, choose:
- A held pose for hand shapes. Studio uses a Dense learning block and a 1000 ms window.
- A movement for gestures over time. Studio uses a Conv1D learning block and sets the window to the typical length of your movement takes.
- Check Window and Stride. The window must be at least 500 ms. Takes shorter than one window are skipped.
- Select Save Impulse.
Then open the Landmarks block in the menu:
| Setting | What it does | Default |
|---|---|---|
| Summary of the window | Averages the landmarks over the window, optionally with how much they jitter | Average |
| Frames per window | How many moments of a movement the model sees (movement only) | 20 |
| Include velocity | Adds how fast each point moves (movement only) | Off |
| Use depth (z) | Adds the depth estimate. It is noisy from one camera | Off |
| Treat a left hand as a right hand | Mirrors left hands, so one model handles both | On |
Select Save parameters, then on Generate features select Generate features.
6. Train
Open the learning block in the menu, check the training settings, and select Start training. Studio holds back whole takes for validation, so the scores show how the model handles takes it has never seen.
7. Evaluate
Open Evaluation. Next to the usual scores and confusion matrix, the card How these scores were measured tells you whether the model was Tested on unseen takes, and shows accuracy per label and per test session.
Watch for these warnings:
- No testing data: the scores were measured on training data. Record more takes and move a session to Testing.
- Only one test take for a label: record more takes of that label.
- Capture sessions in both training and testing: the score may be too optimistic. Test on a separate session.
Model testing runs the model on every take in the testing set.
8. Test live
- Open Live classification and select Start live classification.
- Show your gestures to the camera. The panel shows each label's share of recent windows, plus Unknown.
- The Latest window card shows whether the gesture was Recognized, Uncertain or Unknown, and the model's best guess.
- Use Minimum confidence to make the model stricter (higher) or more willing to answer (lower). It starts at a value Studio calibrated during training.
A held pose only changes after several windows agree, so the answer is steady rather than flickering. A movement is reported once most recent windows agree on it.
9. Deploy
Open Deployment. A Hands model is built as a Generic TFLite .pe package.
The package expects prepared landmark windows as input, not camera frames. Your app runs hand tracking itself, prepares the landmarks the same way Studio does (30 rows per second, 64 values per row), and passes each window to the package, which returns the gesture. The package includes the normalisation and the unknown rule.