- About
- Features
- System Architecture
- Tech Stack
- Project Structure
- Getting Started
- How to Use
- Training Custom Gestures
- Configuration
- Roadmap
- Author
AirControl Pro is a real-time, AI-powered desktop control system that lets you interact with your computer entirely through hand gestures, voice commands, and facial recognition โ no physical input device required.
Built from scratch using Python and computer vision, it goes beyond basic gesture detection by layering multiple AI systems together:
- A face authentication gate that locks the system to the registered user
- A multi-mode gesture engine powered by MediaPipe's 21-point hand landmark model
- A trainable custom gesture AI using RandomForest that learns your own gestures
- A live emotion detector that adapts the UI theme based on your expression
- A background voice engine that accepts spoken commands alongside gestures
This project was designed and built as a real-world application of computer vision, machine learning, and human-computer interaction concepts.
|
|
|
|
| Gesture | Mode Activated |
|---|---|
| โ๏ธ Peace sign (2 fingers) | ๐ต Media Mode |
| ๐ค Hang Loose | ๐ฅ๏ธ System Mode |
| ๐ 3 Fingers | ๐จ Draw Mode |
| ๐ค Hang Loose (inside Draw) | โฌ ๏ธ Exit Draw Mode |
| Gesture | Action |
|---|---|
| ๐ Thumb + Index pinch | Volume control (distance-based) |
| โ Open Palm | Play / Pause |
| โ Fist | Previous Track |
| ๐ค Pinky only | Next Track |
| Gesture | Action |
|---|---|
| โ Open Palm | Take Screenshot |
| ๐ Thumb + Index pinch | Brightness control |
| โ Fist | Alt + Tab |
| ๐ 3 Fingers | Show Desktop |
| Gesture | Action |
|---|---|
| โ๏ธ 1 Finger | Draw on canvas |
| โ Fist | Erase |
| โ Open Palm | Clear entire canvas |
| Emotion | HUD Color | Detection Logic |
|---|---|---|
| Happy ๐ | Green | Smile + eyes open |
| Neutral ๐ | Grey | No smile, normal eyes |
| Focused ๐ฏ | Blue | Both eyes open, no smile |
| Surprised ๐ฎ | Cyan | Wide eyes detected |
| Tired ๐ด | Purple | Eyes closed / drooping |
| Say | Action |
|---|---|
"media" |
Switch to Media Mode |
"system" |
Switch to System Mode |
"draw" |
Switch to Draw Mode |
"youtube" |
Open YouTube in browser |
"screenshot" |
Capture screenshot |
"clear" |
Clear drawing canvas |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Camera Input โ
โโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโผโโโโโโโโโโโโโโ
โผ โผ โผ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ Face Engine โ โ Emotion โ โ Voice Engine โ
โ (LBPH) โ โ Detector โ โ (Thread) โ
โโโโโโโโฌโโโโโโโ โโโโโโฌโโโโโโ โโโโโโโโฌโโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโ
โ Hand Tracker โ
โ (MediaPipe 21-pt) โ
โโโโโโโโโโโโโฌโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโ
โ Gesture Classifier โ
โ Rule-based + AI (RF) โ
โโโโโโโโโโโโโฌโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโ
โ Mode Engine โ
โ MediaโSystemโDraw โ
โโโโโโโโโโโโโฌโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโ
โ HUD Overlay โ
โ Emotion-themed UI โ
โโโโโโโโโโโโโโโโโโโโโโโโโ
| Technology | Version | Purpose |
|---|---|---|
| Python | 3.11 | Core language |
| OpenCV | 4.10 | Camera, image processing, face auth, emotion |
| MediaPipe | 0.10 | 21-point hand landmark detection |
| scikit-learn | 1.3 | Custom gesture RandomForest classifier |
| PyAutoGUI | latest | Keyboard & mouse automation |
| pycaw | latest | Windows audio/volume control |
| SpeechRecognition | latest | Voice command processing |
| NumPy | 2.x | Numerical computations |
| joblib | latest | Model persistence |
AirControl-Pro/
โ
โโโ main.py # Entry point, main loop
โโโ gesture_detector.py # MediaPipe hand tracking
โโโ gesture_classifier.py # Rule-based gesture logic
โโโ config.py # All settings & constants
โ
โโโ ai/
โ โโโ __init__.py
โ โโโ custom_gesture_ai.py # Trainable RandomForest AI
โ โโโ emotion_detector.py # Facial emotion detection
โ
โโโ auth/
โ โโโ __init__.py
โ โโโ face_auth.py # LBPH face authentication
โ
โโโ voice/
โ โโโ __init__.py
โ โโโ voice_engine.py # Threaded speech recognition
โ
โโโ modes/
โ โโโ __init__.py
โ โโโ media_mode.py # Volume, play/pause, tracks
โ โโโ system_mode.py # Screenshot, brightness, apps
โ โโโ draw_mode.py # Air drawing canvas
โ
โโโ hud/
โ โโโ __init__.py
โ โโโ overlay.py # Emotion-themed HUD display
โ
โโโ utils/
โ โโโ __init__.py
โ โโโ finger_counter.py # Per-finger state detection
โ โโโ velocity_tracker.py # Gesture speed tracking
โ
โโโ data/
โโโ known_faces/
โ โโโ README.txt
โโโ gesture_samples.json # Recorded training data (auto)
โโโ gesture_model.pkl # Trained model (auto)
- Windows 10 or 11
- Python 3.11
- Webcam (built-in or external)
- Microphone (for voice commands)
1. Clone the repository
git clone https://github.com/rafiul254/AirControl-Pro.git
cd AirControl-Pro2. Create and activate virtual environment
python -m venv venv
.\venv\Scripts\Activate.ps13. Install all dependencies
pip install numpy
pip install opencv-contrib-python --only-binary=:all:
pip install mediapipe --only-binary=:all:
pip install protobuf --only-binary=:all:
pip install scikit-learn joblib
pip install pyautogui
pip install pycaw comtypes
pip install screen-brightness-control
pip install SpeechRecognition pyaudio4. Register your face
Add a clear, front-facing photo of yourself:
data/known_faces/YourName.jpg
5. Run
python main.py| Key | Action |
|---|---|
Q |
Quit |
F |
Toggle fullscreen |
R |
Start recording a custom gesture |
T |
Train the custom gesture AI |
โ
Stay 30โ60 cm from the camera
โ
Keep your hand fully visible in frame
โ
Use in a well-lit environment
โ
Keep hand to the side โ not in front of your face
โ
Hold gestures steady for ~1 second to trigger
You can teach AirControl Pro any hand sign you want:
Step 1 โ Run the app: python main.py
Step 2 โ Press R
Step 3 โ Type a name for your gesture (e.g. "thumbs_up")
Step 4 โ Hold the gesture in front of the camera
(50 samples will be captured automatically)
Step 5 โ Repeat for at least 2 different gestures
Step 6 โ Press T to train the AI
Step 7 โ Your model saves to data/gesture_model.pkl
and auto-loads next time you run the app
Edit config.py to customize behavior:
CAMERA_ID = 0 # Change if using external camera
FRAME_WIDTH = 640
FRAME_HEIGHT = 480
DETECTION_CONFIDENCE = 0.5 # Lower = detects more, less accurate
GESTURE_HOLD_TIME = 0.8 # Seconds to confirm a gesture
MODE_SWITCH_COOLDOWN = 1.5 # Seconds between mode switches
MAX_HANDS = 1- [complete] Multi-mode gesture control (Media, System, Draw)
- [complete] Face authentication with LBPH
- [complete] Emotion-aware adaptive UI
- [complete] Custom gesture AI (RandomForest)
- [complete] Threaded voice command engine
- [complete] Live HUD with FPS, mode, emotion display
- [In future] Browser control mode (scroll, tab switch)
- [In future] Virtual air keyboard
- [In future] IoT integration via MQTT (GestureBot)
- [In future] Multi-user face profile support
- [In future] Gesture macro recorder
This project is licensed under the MIT License โ see LICENSE for details.