This document describes the end-to-end pipeline for real-time gaze tracking with the ThirdEye Chrome extension.
- gaze2 (Python) – Computer vision model estimates gaze position on screen
- WebSocket server (ws://127.0.0.1:8765) – Streams gaze coordinates at ~60 FPS
- Chrome extension – Receives gaze, shows red overlay, captures gaze-centered screenshots
cd gaze2
pip install -r requirements.txt
pip install -r GazeFollower/requirements.txt
cd GazeFollower && pip install . && cd ..
# Run gaze cursor with API + WebSocket (requires webcam)
python gaze_cursor.py --apiThis will:
- Show camera preview and calibration
- Display a red circle at your gaze position (pygame fullscreen)
- Start Flask API at http://127.0.0.1:5000/gaze
- Start WebSocket server at ws://127.0.0.1:8765
- Open Chrome →
chrome://extensions - Enable Developer mode
- Click Load unpacked
- Select the
contentGrabberfolder
- Navigate to any webpage (http/https)
- Click the ThirdEye extension icon to enable
- With gaze_cursor running, you should see a red dot following your gaze
- When you dwell (gaze at one spot for ~2 seconds), the extension captures a 200×200 px screenshot centered on the gaze point and processes it
| Component | Port | Purpose |
|---|---|---|
| Gaze cursor | — | Fullscreen pygame window, calibration, gaze estimation |
| Flask API | 5000 | HTTP GET /gaze (fallback for polling) |
| WebSocket | 8765 | Real-time gaze stream (~60 FPS) |
| Chrome extension | — | Red overlay, dwell detection, screenshot capture |
- Extension disabled – Red overlay hidden
- CV offline – Extension falls back to mouse cursor for dwell
- Page reload – Overlay recreated when GAZE_UPDATE arrives
- Gaze near screen edges – Coordinates clamped to viewport
- No red dot:
- Make sure you're on a normal webpage (http/https) — the content script doesn't run on chrome:// pages
- Click the ThirdEye extension icon to ensure it's enabled (green badge)
- Run
python gaze_cursor.py --apiand complete calibration - Keep your face visible to the camera — gaze data only streams when the model detects your face
- Check the extension's background: chrome://extensions → find ThirdEye → click "Service worker" → look for "Gaze WebSocket connected" or "Gaze HTTP polling started"
- The extension uses HTTP polling (every 200ms) as fallback when WebSocket is not connected
- Red dot in wrong place: Browser window position affects mapping; try fullscreen browser for best accuracy
- Screenshot not capturing: Click the extension icon first to grant activeTab permission