L1 Robotics

Build Logs · Aug 16, 2026 · 3

I made Anime Hand-Signs Control My Lights

I made Anime Hand-Signs Control My Lights

I made Anime Hand-Signs Control My Lights

Anime Hand Sign Gesture Recognition

Real-time hand gesture recognition using MediaPipe hand landmarks and a scikit-learn classifier, trained on custom anime-style hand signs for triggering device actions.

Files

FilePurpose
trainer.pyCollects labeled hand landmark data via webcam → saves to gesture_landmarks.csv
Anime_Handsigns.ipynbTrains a classifier on the CSV data → outputs gesture_classifier.joblib
sign_recognizer.pyRuns real-time inference using the trained classifier
gesture_classifier.joblibPre-trained model (included)

Quick Start & Setup

1. Environment & Dependencies

Windows Command Prompt / PowerShell:

cmd
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt

2. Download the Hand Landmarker Model

Windows (PowerShell):

powershell
curl -o hand_landmarker.task https://storage.googleapis.com/mediapipe-models/hand_landmarker/hand_landmarker/float16/1/hand_landmarker.task

macOS / Linux:

bash
wget -q https://storage.googleapis.com/mediapipe-models/hand_landmarker/hand_landmarker/float16/1/hand_landmarker.task

Usage

Option A — Use the pre-trained classifier

bash
python sign_recognizer.py

⚠️ Works best on front-facing shots where the camera sees the full hand and fingers — not trained on all angles.

Press q or ESC to quit.

Option B — Collect your own data & retrain

  1. Collect landmark data:
bash
   python trainer.py

Press number keys (18) to toggle recording for each gesture, 0 for "none". Landmarks are appended live to gesture_landmarks.csv. Press q or ESC when done.

Default gesture map (edit GESTURE_KEYS in trainer.py to customize):

KeyLabel
1simple_jutsu
2spider_man
3pinky_promise
4fist
5kon
6knife
7O
8call
0none
  1. Train the classifier: Open Anime_Handsigns.ipynb and run all cells. Outputs a new gesture_classifier.joblib.

  2. Run inference:

bash
   python sign_recognizer.py

Optional: Sample training data

📁 Training data (Google Drive)

How It Works

  • Landmark normalization: wrist-relative coordinates scaled by the farthest landmark distance, so gestures are recognized regardless of hand position or distance from camera.
  • Confidence threshold: predictions below CONFIDENCE_THRESHOLD (default 0.65) are treated as "unsure."
  • Hold-to-confirm: a gesture must hold for HOLD_FRAMES_REQUIRED (default 3) frames before triggering on_gesture_confirmed() in sign_recognizer.py — wire your device action there.