Skip to content

AlphsX/AirTouch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AirTouch: Magical Hand Tracking Control

Swift Python Platform License

AirTouch is a sophisticated, native macOS menu bar application that transforms your hand into a high-precision neural interface. 🧠✨

By bridging a robust Swift IP (Interface Presentation) layer with a state-of-the-art Python Inference Engine, AirTouch delivers a Vision Pro-like interaction paradigm directly to your Mac. We leverage Google MediaPipe for sub-millisecond hand landmark detection and advanced Kalman Filtering for butter-smooth cursor control. 🧈🚀


✨ Features

  • High-Fidelity Cursor Control 👆 - Sub-pixel precision using weighted landmark fusion.
  • Smart Gestures 🤏 - Intuitive Pinch-to-Click and Hold-to-Drag mechanics.
  • Native Integration 🖥️ - Lives quietly in your menu bar with full Apple Security compliance.
  • Performance First ⚡️ - 60+ FPS tracking pipeline optimized for Apple Silicon.
  • Privacy by Design 🔒 - 100% on-device inference. No video data ever leaves your machine.
  • Advanced Neural Controls:
    • Right Click ✌️ - Pinch with middle finger.
    • Spatial Swipe 🖖 - Swift hand movements to switch Desktop Spaces.
    • Virtual Volume Dial 🔊 - Rotary hand gesture for precise audio control.
    • Media Skip ⏭️ - Thumb flick gesture for track control.

🤖 Interaction Engine

AirTouch isn't just a wrapper; it's a carefully tuned Intent Engine. We mitigate the inherent jitter of computer vision using a dual-stage Kalman Filter, ensuring the cursor feels like a natural extension of your body, not a jittery pointer. 📉✨

# 🧠 The engine intelligently blends landmarks for biomechanical stability
INDEX_LANDMARKS = [5, 6, 7, 8]  # MCP, PIP, DIP, TIP
INDEX_WEIGHTS = [0.15, 0.25, 0.25, 0.35]  # Weighted for fingertip precision

# 🎛️ Kalman Filter Configuration (Tuned for "Vision Pro" feel)
KF_PROCESS_NOISE = 1e-5     # High trust in model physics for smoothness
KF_MEASUREMENT_NOISE = 1e-4 # Aggressive filtering of camera sensor noise
KF_PREDICTION_TIME = 0.040  # 40ms look-ahead neural latency compensation

🏗️ Architecture

We employ a Hybrid Microservices Architecture to maximize performance and native OS integration:

  1. Swift (AppKit/SwiftUI) 🍎: Orchestrates the macOS UI, manages System Permissions (Accessibility, Camera), and handles the process lifecycle.
  2. Python (OpenCV/MediaPipe) 🐍: Executes the heavy-duty Computer Vision pipeline, landmark extraction, and heuristic gesture logic.

The two systems communicate via optimized Standard I/O Pipes, ensuring a clean separation of concerns and crash resilience. 🛡️

📦 Requirements

Platform Minimum Version Core Stack / Dependencies
macOS 14.0+ (Sonoma) SwiftUI, AppKit, ApplicationServices
Python 3.9 - 3.12 opencv-python (4.13+), mediapipe (0.10+), pynput (1.8+)

🚀 Installation

1. Clone the Repository 🧬

git clone https://github.com/AlphsX/AirTouch.git
cd airtouch

2. Hydrate Python Environment 🐍

AirTouch requires specific CV and ML libraries. We recommend a virtual environment.

pip install -r requirements.txt

Note: Ensure python3 is in your $PATH. The Swift app auto-detects your Python runtime. 🕵️‍♂️

3. Build the Swift Binary 🔨

  1. Open AirTouchApp/AirTouchApp.xcodeproj.
  2. check Signing & Capabilities to ensure you have a valid Team selected.
  3. Build and Run (CMD+R).

🕹️ Usage

Once launched, look for the magical hand icon ✋ in your menu bar.

  1. Enable AirTouch via the dropdown menu. ✅
  2. Grant Accessibility Permissions (Required for cursor injection). 🔓
  3. Grant Camera Permissions (Required for vision pipeline). 📷

Neural Gesture Mapping

  • Navigation: Raise hand & move Index Finger 👆
  • Left Click: Pinch Index & Thumb 🤏
  • Drag: Pinch, Hold & Move 🤏➡️
  • Right Click: Pinch Middle Finger & Thumb 🖕 (Kindly!)
  • Spaces: Quick Swipe Left/Right 👋
  • Volume: Rotate hand like a physical dial 🎛️

🤝 Contributing

We welcome fellow engineers! If you have ideas for optimization or new gesture heuristics:

  1. Fork the Project 🍴
  2. Create your Feature Branch (git checkout -b feature/NeuralNetUpgrade)
  3. Commit your Changes (git commit -m 'Add: Next-gen gesture recognition')
  4. Push to the Branch (git push origin feature/NeuralNetUpgrade)
  5. Open a Pull Request 📩

📄 License

Distributed under the MIT License. See LICENSE for more information.

About

✨ Magical, high-fidelity neural cursor for macOS • Sub-millisecond hand tracking powered by Swift, MediaPipe & Kalman filters

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors