Hands-free computer control through eye-blink detection.
An assistive-technology experiment — interact with a computer using only your eyes.
Some people can't use a mouse or keyboard. Eye-Tracker turns a plain webcam into an input device: it watches your eyes in real time and converts deliberate blinks into clicks and key presses — no hardware beyond the camera you already have. It grew out of my work on Vision Voice Assist, where accessibility is the whole point.
It runs dlib's 68-point facial-landmark detector on each frame, isolates the six landmarks around each eye, and computes the Eye Aspect Ratio (EAR) — a value that drops sharply when the eye closes:
‖p2 - p6‖ + ‖p3 - p5‖
EAR = ───────────────────────
2 · ‖p1 - p4‖
When the EAR stays below a threshold for a few frames, that's a blink. Blink timing is then mapped to actions:
| Gesture | Action |
|---|---|
| 👁️ single deliberate blink | left mouse click |
| 👁️👁️ quick double blink | Enter key |
| EAR / blink count overlay | live on-screen feedback |
pip install -r requirements.txt
# download dlib's landmark model (once):
# http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2# full mode (sends real clicks / Enter)
python eye_tracker.py --predictor shape_predictor_68_face_landmarks.dat
# safe mode — detect & display only, no input sent
python eye_tracker.py --detect-only
# tune sensitivity
python eye_tracker.py --threshold 0.23 --frames 3Press q in the preview window to quit.
- The landmark model (
.dat, ~68 MB) and other large binaries are not committed — download them separately (see Install). - Blink-to-input is intentionally conservative to avoid accidental clicks; tune
--threshold/--framesfor your lighting and camera. - Gaze-to-cursor movement is on the roadmap.
- Smooth gaze-based cursor movement with calibration
- On-screen keyboard mode for full hands-free typing
- Dwell-click (look-and-hold) as an alternative to blink-click
Əliəsgər Fətullayev (Orest) · 📫 eliesgerfetullayev@gmail.com
Technology should meet people where they are.