Draw through a webcam-tracked marker and recognize hand gestures directly in the browser.
- Python 3.11
- Flask
- OpenCV
- MediaPipe Gesture Recognizer
- NumPy
- HTML, CSS, and JavaScript
- MJPEG video streaming
- 64-bit Python 3.11
- Git
- A working webcam
- Internet access while installing Python packages
git clone https://github.com/randomchips/Sketch-In-Air.git
cd Sketch-In-Air
py -3.11 -m venv .venv
.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python app.pyIf PowerShell blocks virtual-environment activation, run this once in the same terminal and activate again:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSignedgit clone https://github.com/randomchips/Sketch-In-Air.git
cd Sketch-In-Air
python3.11 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python app.pyOpen http://127.0.0.1:5000 after Flask reports that it is running. Stop the server with Ctrl+C.
- Open Air drawing from the home page.
- Hold a blue marker or blue object in view of the webcam.
- Move it through the drawing area to create strokes.
- Move it over the on-screen controls to change color, undo, clear, pause, or switch between pen and eraser.
- Use Save frame to download the current camera-and-canvas image.
- Open Hand gestures from the home page.
- Show one or two complete hands to the webcam with the fingers visible.
- The stream displays 21 landmarks per hand, handedness, finger count, gesture name, confidence when available, and a matching emoji.
- Supported named gestures include closed fist, open palm, pointing up, thumbs up/down, victory, I love you, OK, and call me. Other poses fall back to finger counting.
- Close other applications using the webcam before opening a studio.
- Allow camera access for Python in the operating-system privacy settings.
- Use front lighting and keep the whole hand inside the frame for best gesture recognition.
- Drawing is calibrated for a blue marker through
penval.npy. - The webcam is opened by the computer running Flask; another device on the network only receives the video stream.
- If port
5000is busy, run:
python -m flask --app app run --port 5001 --with-threadsThen open http://127.0.0.1:5001.