A web application that allows users to draw in the air using hand gestures, captured by their webcam. This app uses computer vision for hand tracking, real-time drawing capabilities, and AI-powered analysis of drawings.
You can see a live demo Here but most propbaly it will be choppy as its a free server. For better experiance host it yourself.
- ✨ Air Drawing: Draw using only hand gestures (thumb and index finger pinch)
- 🎨 Drawing Controls: Customize line thickness, color, and pinch sensitivity
- 🔍 AI Analysis: Drawings are analyzed by Google's Gemini AI (when an API key is provided)
- 🔐 User Accounts: Register, login, and manage your API key securely
- 📱 Responsive Design: Works on desktop and mobile devices with cameras
- 📊 Library: View and manage your saved drawings
The application uses:
- MediaPipe for hand tracking and gesture recognition
- Flask and Socket.IO for real-time communication
- Google's Gemini AI for drawing analysis
- Modern security practices for user authentication and data protection
- Python 3.8+
- Webcam
- (Optional) Gemini API key from Google AI Studio
-
Clone the repository:
git clone https://github.com/anishgowda21/Air-Draw.git cd Air-Draw -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Create a
.envfile in the project root (optional):SECRET_KEY=your_secure_random_key -
Run the application:
python app.py
-
Open your browser and navigate to:
http://localhost:5001
- Register or Login: Create an account to save drawings and add your Gemini API key(which will be encrypted and stored only decrypted by your password)
- Drawing:
- Allow camera access when prompted
- Pinch your thumb and index finger together to start drawing
- Move your hand while maintaining the pinch to draw
- Release the pinch to stop drawing
- Controls:
- Adjust line thickness and color using the controls panel
- Use the 'Min Pinch Distance' slider to adjust sensitivity
- Click 'Save Drawing' to save your creation
- View Drawings:
- Navigate to the drawings page to see your saved drawings
- Click on any drawing to view details and AI analysis (if available)
- This is a demonstration application and uses SQLite for data storage
- SQLite database may be reset: If you cannot login, simply register again with the same username
- Backend: Flask, Socket.IO, SQLite, MediaPipe
- Frontend: HTML5, CSS3, JavaScript, Bootstrap 5
- AI: Google Gemini API for image analysis
- Security: Cryptography, PBKDF2, Fernet encryption
- MediaPipe by Google for hand tracking capabilities
- Flask for the web framework
- Socket.IO for real-time communication
- Google Gemini for AI-powered analysis
Contributions are welcome! Please feel free to submit a Pull Request.
This application is for educational and demonstration purposes only. The drawing analysis is powered by Google's Gemini API and requires users to supply their own API key for full functionality.