GestureInteraction is a high-performance, Web-based AR hand gesture particle interaction system powered by Flask, MediaPipe, and Three.js.
GestureInteraction is a web-based Augmented Reality (AR) hand gesture particle interaction system.
The system uses MediaPipe Hands for real-time hand gesture recognition and Three.js + WebGL for rendering interactive 3D particle animations. It enables natural and smooth visual interactions driven entirely by hand gestures.
The project runs purely in the browser and does not require any native applications, making it suitable for desktop and mobile devices.
- Real-time hand tracking powered by MediaPipe Hands
- Multiple gesture modes (open palm, fist, V-sign, single finger, thumb, three fingers)
- Gesture stability processing to reduce jitter and false recognition
- Three.jsโbased 3D particle system
- Multiple particle shapes (sphere, ring, star, text, heart, dragon)
- Physics-based following with damping and inertia for natural motion
- WebGL hardware-accelerated rendering
- Adaptive particle count based on device performance
- Basic depth perception and occlusion simulation
- HTTPS secure access using self-signed certificates
- Automatic detection and switching of front/rear cameras
- Automatic demo mode when no camera is available
- Responsive layout for desktop, tablet, and mobile screens
- Flask โ Python web framework
- SSL/TLS โ HTTPS support required for browser camera access
- MediaPipe Hands โ Real-time hand gesture recognition
- Three.js โ 3D scene and particle rendering
- WebGL โ GPU-accelerated graphics
- MediaDevices API โ Camera access and stream management
- ES6+ JavaScript โ Modular frontend architecture
- Python 3.8 or later
- A modern browser with WebGL support
- Camera device (optional; demo mode will be enabled if unavailable)
-
Install dependencies:
pip install -r requirements.txt
-
Run the server:
python app.py
-
Open the application in your browser: Access the URL displayed in the terminal:
https://<your-local-ip>:5001[!IMPORTANT] On first access, you must install the self-signed HTTPS certificate; otherwise, the browser will block camera access.
| Gesture | Particle Effect |
|---|---|
| Open palm | Sphere |
| Fist | Ring |
| V-sign | Text particles |
| Single finger | Star |
| Thumb | Heart |
| Three fingers | Dragon |
Place your hand in front of the camera. The system will automatically recognize the gesture and switch to the corresponding particle shape.
GestureInteraction/
โโโ app.py # Main Flask backend
โโโ tools/ # Utility tools
โ โโโ utils.py
โ โโโ gsignature.py
โโโ requirements.txt # Project dependencies
โโโ README.md # Entry documentation
โโโ README_en.md # English documentation
โโโ README_zh.md # Chinese documentation
โโโ ssl/ # SSL certificates
โ โโโ server.crt
โ โโโ server.key
โโโ static/ # Static assets
โ โโโ gicss/ # Stylesheets
โ โโโ gijss/ # Core logic
โ โโโ giresource/ # Textures and resources
โโโ templates/ # HTML templates
โโโ index.html
The default port is 5001 and can be modified in app.py.
Particle count, size, and physics parameters are configured in the frontend static/gijss/config.js file and can be adjusted based on performance requirements.
Gesture stability frames, smoothing factors, and follow strength can be tuned to better match different devices and environments.
Camera access is blocked
- Ensure the application is accessed via HTTPS.
- Check browser permission settings.
- Make sure the camera is not being used by another application.
Low performance or frame drops
- Reduce the particle count in
config.js. - Close other resource-intensive applications.
- Use a device with better GPU performance.
This project is licensed under the MIT License.
