An interactive experimental webpage using TensorFlow.js Handpose model to detect hand gestures for on-page interactions.
Mostly vibe coded using Gemini.
- Hand Tracking: Real-time multi-hand detection using
@tensorflow-models/hand-pose-detection. - Pinch-to-Click: Detects when your thumb and index finger meet to trigger a "click" or "grab".
- Drag & Drop: Move physical-style blocks around the screen using natural hand gestures.
- Visual Debugging: Optional hand skeleton visualization and performance (FPS) monitor.
- Auto-Pause: Intelligently pauses webcam processing when the tab is inactive to save system resources.
- Safe Zone Mapping: Optimized control area that maps a reliable central camera zone to the full screen.
- Node.js: Version 22.12.0 or higher.
- Webcam: A functioning camera for hand detection.
- Modern Browser: Chrome, Edge, or Firefox (with webcam permissions granted).
-
Install Dependencies:
npm install
-
Start the Development Server:
npm run dev
-
Open the App: Navigate to
http://localhost:7900(or the port specified in your console).
- Initialize: Wait for the model to load (check the status bar at the bottom left).
- Move: Watch the cursor follow your hand.
- Pinch: Bring your thumb and index finger together. The cursor will change color, and the hand skeleton will highlight.
- Drag: Pinch over a colored box (Red, Green, or Blue) and move your hand to relocate it.
- Drop: Release the pinch to drop the object.
You can tune the experience in src/scripts/main.js and src/styles/main.css:
- Smoothing: Adjust
SMOOTHING_FACTORinmain.jsfor more fluid or snappier movement. - Visuals: Change
HAND_TRACK_OPACITYorHAND_LINE_WIDTHto customize the debug skeleton. - Video Blur: Modify
--video-blurinmain.cssto adjust the background clarity.
MIT