A gesture-based file transfer system — no wires, no taps, just air. This project was inspired by Huawei's gesture-based file transfer mechanism.
Air Flick is a system that allows users to transfer images between two devices using simple hand gestures. With a swipe of your hand, files are lifted into the "air", and with another gesture, they are delivered to a nearby device — completely touchless.
Air Flick redefines the concept of file sharing by combining:
- Machine Learning gesture detection
- Peer-to-peer communication
- Real-time WebSocket connections
- REST API-based communication
All within a shared local network (subnet).
-
Pull Gesture 🤲
The user performs a pull gesture, recognized using MediaPipe, triggering the system to select and lift a file (image) into the air (internal buffer or shared state). -
Push Gesture ✋➡️
The user then performs a push gesture toward a nearby device. The system detects the nearest peer (based on ping response time) and drops the file into that device. -
Communication
- Zeroconf for peer discovery within subnet
- WebSockets for real-time gesture triggers
- REST API to send and receive images
Component | Technology |
---|---|
Gesture Detection | MediaPipe, OpenCV, Custom ML pipeline |
Networking | Zeroconf, WebSockets, HTTP (FastAPI) |
Frontend | HTML, JS (with dynamic image rendering) |
Backend | FastAPI (Python) |
Communication | Peer-to-peer within same subnet |
git clone https://github.com/macromrit/Air-Flick.git
cd Air-Flick
pip install -r requirements.txt
Open your terminal and navigate to the p2p
folder:
cd p2p
python advertiser.py
This script uses Zeroconf to broadcast your device's availability to other devices on the same subnet.
Open a new terminal window, go to the app folder, and run the FastAPI server:
cd ../app
uvicorn main:app --host 0.0.0.0 --reload
The backend will be available at: http://<your-ip>:8000
Open webpage/index.html
in a web browser (on the same subnet as the other devices):
# For example, on most systems
open webpage/index.html # macOS
start webpage/index.html # Windows
xdg-open webpage/index.html # Linux
This UI allows you to perform gesture-based file transfers.
If communication issues occur on Windows OS (e.g., peer not detected or ping failing), follow these steps:
- Open Windows Defender Firewall.
- Click on Advanced Settings.
- Go to Inbound Rules.
- Find the rule:
File and Printer Sharing (Echo Request - ICMPv4-In). - Right-click on it and enable the rule.
✅ This allows ping (ICMP) messages required for peer ranking via latency.
This project is licensed under the MIT License. See the LICENSE file for details.
- ❤️ FastAPI
- 👋 MediaPipe
- 📡 Zeroconf
- 🌐 WebSockets
- 🎯 OpenCV
Want to improve Air Flick or add more gesture actions and file types? Feel free to fork and open a PR. Let's make file transfers cooler than ever.