A lightweight, robust Python eye tracker
This repository is packaged as a single command-line tool: gazecli.
Install (recommended: editable):
pip install -e .Commands:
gazecli pupil
gazecli pupil-lite
gazecli pupil-rpi
gazecli 3d
gazecli head
gazecli head-cursor
gazecli webcam3dNote: Some commands require extra dependencies:
pip install -e ".[head]"
pip install -e ".[webcam3d]"
pip install -e ".[three_d]"Python application code lives under:
src/gazecli/apps/
Unity integration:
integrations/unity/GazeFollower.cs(reads a gaze vector file and drives an object)
Run:
gazecli 3dWhat it does:
- Detects the pupil in each frame, fits an ellipse, and estimates a 3D gaze direction vector.
- (Optional) Renders a 3D visualization window.
Output:
gaze_vector.txt: continuously updated with origin (x,y,z) and direction (x,y,z).integrations/unity/GazeFollower.cscan read this file in Unity.
Run:
gazecli headWhat it does:
- Uses webcam + MediaPipe Face Mesh to estimate head pose (yaw/pitch).
- Moves the mouse cursor based on head orientation.
Hotkeys:
F7: toggle mouse controlc: calibrate (look at screen center)q: quit
Optional cursor overlay:
A lightweight, robust Python eye tracking CLI.
pip install -e .gazecli pupil
gazecli pupil-lite
gazecli pupil-rpi
gazecli 3d
gazecli head
gazecli head-cursor
gazecli webcam3dOptional dependencies:
pip install -e ".[head]"
pip install -e ".[webcam3d]"
pip install -e ".[three_d]"src/gazecli/apps/: application modulesintegrations/unity/GazeFollower.cs: Unity example that readsgaze_vector.txt
gazecli 3dOutput:
gaze_vector.txt: origin (x,y,z) and direction (x,y,z)
gazecli headHotkeys:
F7: toggle mouse controlc: calibrate (look at screen center)q: quit
Cursor overlay:
gazecli head-cursorgazecli webcam3dHotkeys (summary):
c: calibrate (screen center)F7: toggle mouse controlj/l,i/k: orbit yaw/pitch[ / ]: zoomr: reset orbitx: stamp a marker on the virtual monitorq: quit
- NumPy 2.0.0 may cause issues; use 1.26.x if needed.
- Works best with 640x480 input and a full-eye frame.