Notice: For the latest v2.6 Desktop Application, please navigate to the
TrackerModeDesktopdirectory instead!
AI-powered focus tracking with real-time eye tracking, active window title monitoring, and AI session analysis.
TrackerMode monitors your focus during study or work sessions using your webcam (MediaPipe FaceLandmarker), keyboard/mouse activity, and active window title detection. It does not capture, record, or monitor your screen in any way β it only reads the window title text to detect distraction apps. When your focus drops or you open a distraction app, it alerts you with visual warnings and audio alarms.
TrackerMode is a self-discipline tool, not a surveillance app. You choose to use it.
| What we access | Why | Stored? |
|---|---|---|
| Webcam | Eye tracking (gaze, blink, head pose) | β Never saved |
| Keyboard/Mouse | Detect inactivity | β Never saved |
| Active Window Title | Detect distraction apps | β Never saved |
What we DON'T do:
- β No screen monitoring β we do NOT capture, record, or view your screen at all
- β No screenshots β we never take screenshots or screen recordings
- β No screen content reading β we only read the window title bar text (e.g. "Google Chrome"), never your screen content
- β No data sent externally β all processing is local on your machine
- β No browsing history β we don't track URLs or web content
- β No keystroke logging β we only detect if you're typing, not what
The AI Analysis feature (optional) sends only session statistics (duration, focus score, alert count) to OpenAI β never webcam data, window titles, or personal content.
- Eye Tracking β MediaPipe 478-landmark face detection with iris tracking
- Gaze Direction β Detects center/left/right gaze from iris position
- Head Pose β Estimates forward/down/up/left/right head orientation
- Blink Rate β Real-time blink detection via Eye Aspect Ratio (EAR)
- Drowsiness Detection β Detects drowsy (3s+), microsleep (15s+), and deep sleep (60s+) states
- Smart Scoring β Combined attention score (0β100) from eyes, gaze, head pose, face position, and blink rate
- Window Title Detection β Reads the active window title via
pygetwindow - Distraction Detection β Flags known distraction apps (WhatsApp, Instagram, TikTok, Steam, etc.)
- Custom Distractions β User can add their own app keywords to block
- Confirmation Prompt β "Is this for studying?" instead of assuming. Whitelists per session
- No Screen Capture β Only reads window title text, never captures screen content
- Focus Score Ring β Large circular gauge with color-coded score
- Focus Timeline β Real-time chart showing score over time
- Activity Log β Timestamped events with color-coded status
- Floating Metrics Bar β Compact gauges for gaze, eyes, head, mouse, keyboard
- Pop-out Metrics (PiP) β Separate small window visible across all tabs
- Visual Alerts β PiP-style alert bar for focus warnings
- Toast Notifications β Pop-up messages for events
- Browser Push Notifications β Visible even when minimized
- Audio Alarm β Loops alarm sound when focus drops severely (3+ consecutive alerts)
- "I'm Back" Overlay β Fullscreen dismiss button to acknowledge and resume
- Drowsiness Tolerance β Allows 3 episodes before first warning (human-friendly)
- Smart Alert Cooldown β 30s between alerts with escalating severity
- Video Mode β Pauses activity tracking when watching a video
- Post-Session Analysis β Click "Analisis dengan AI" to get AI feedback
- Powered by GPT-4o-mini β Casual & supportive tone
- API Credit Friendly β Only triggered on button click, not automatic
- Mouse Tracking β Detects mouse movement and idle time (30s threshold)
- Keyboard Tracking β Monitors keypress activity (60s threshold)
- Quiz System β Random focus check quizzes on severe distraction
- Pomodoro Timer β Automatic cycles with break duration mapped to session length
- Webcam Fallback β Auto keyboard/mouse-only mode if webcam disconnects
TrackerMode/
βββ TrackerModeDesktop/ # βοΈ Version 2.5 Native Desktop App with PyInstaller
βββ TrackerMode/ # Legacy v2.4 web-based server
βββ server.py # FastAPI backend + MediaPipe + WebSocket + pygetwindow
βββ main.py # Standalone Python tracker (v1.0, Haar Cascades + dlib)
βββ requirements.txt # Python dependencies
βββ .env # OpenAI API key
βββ face_landmarker.task # MediaPipe model (auto-downloaded)
β
βββ static/
βββ index.html # Main app UI
βββ pip.html # Pop-out metrics window
βββ favicon.svg # App icon
β
βββ css/
β βββ style.css # All styles
β
βββ js/
β βββ main.js # App entry point & orchestration
β βββ session.js # Session timer & focus scoring
β βββ tracker.js # Mouse/keyboard activity tracker
β βββ webcam.js # Webcam + WebSocket to MediaPipe
β βββ dashboard.js # Focus timeline chart & activity log
β βββ quiz.js # Focus check quiz system
β βββ pip.js # Pop-out metrics window manager
β βββ screencapture.js # Screen capture utilities
β
βββ icon/ # SVG/PNG icons for UI elements
β βββ logo.svg # App logo
β βββ logo.png # App logo (raster)
β βββ eye.svg # Eye tracking icon
β βββ keyboard.svg # Keyboard activity icon
β βββ mouse.svg # Mouse activity icon
β βββ screen.svg # Screen monitor icon
β βββ alert.svg # Alert notification icon
β βββ warning.svg # Warning icon
β βββ check.svg # Success/check icon
β βββ play.svg # Play button icon
β βββ pause.svg # Pause button icon
β βββ bar_avg.svg # Average bar icon
β
βββ audio/
βββ mixkit-urgent-simple-tone-loop-2976.mp3 # Alarm sound
| Component | Technology |
|---|---|
| Backend | FastAPI + Uvicorn |
| Face Detection | MediaPipe FaceLandmarker (Tasks API) |
| Fallback | Haar Cascades (OpenCV) |
| Window Monitor | pygetwindow (OS-level window title) |
| Input Tracking | pynput (system-wide mouse/keyboard) |
| AI Analysis | OpenAI |
| Frontend | Vanilla HTML/CSS/JS |
| Communication | WebSocket (real-time frames) |
| PiP Window | window.open() popup |
| Audio | HTML5 Audio API |
| Image Processing | Pillow + NumPy |
| Method | Endpoint | Description |
|---|---|---|
| WebSocket | /ws/attention |
Real-time webcam frame analysis |
| POST | /api/analyze |
AI-powered session analysis |
| GET | /api/stats |
Get attention score statistics |
| GET | /api/input-status |
Mouse/keyboard + active window status |
| POST | /api/distractions |
Add custom distraction keywords |
| GET | /api/health |
Health check + service status |
- π‘οΈ General/Strict Mode β Two distraction modes at session start:
- General Mode: Block specific distraction apps (existing behavior)
- Strict Mode: Only allow listed apps β everything else triggers alerts
- βοΈ Writing/Watching Detection β Every 5 minutes, asks if you're writing or watching/reading
- Writing mode relaxes gaze tracking (looking down at keyboard is expected)
- Watching mode keeps normal face/gaze metrics active
- π Mode-aware Motivation Modal β Updated promise screen shows mode context
- π¦ Backend Mode Support β API
/api/distractionsnow acceptsmodeparameter
- π₯οΈ Active App Monitor β replaced Screen Capture with
pygetwindowwindow title detection- Detects distraction apps (WhatsApp, Instagram, TikTok, Steam, etc.)
- User-customizable distraction list via setup screen input
- Confirmation prompt: "Is this for studying?" with per-session whitelisting
- No screenshots, no screen recording β privacy-first approach
- π΄ Drowsiness Detection β eye-closed duration tracking with human-friendly tolerance
- 3s+ = drowsy, 15s+ = microsleep, 60s+ = deep sleep alarm
- 3-episode tolerance before first warning, 60s cooldown between alerts
- πΊ Video Mode β detects video watching (screen focus + no input) and asks for confirmation
- π Smart Alarm β every alarm now sends visual notification + push notification alongside sound
- β° Pomodoro System β automatic cycles with break duration mapped to session length
- π Browser push notifications (visible even when minimized)
- β±οΈ Smart alert cooldown (30s between alerts, escalating severity)
- π· Webcam fallback β auto keyboard/mouse-only mode if webcam disconnects
- π Reorganized folder structure (
css/,js/,audio/) - π Fixed audio alarm (MP3 format, correct paths)
- π§ Fixed metrics logic β gauges properly drop when no face detected
- Added floating metrics bar with gauges
- MediaPipe FaceLandmarker with VIDEO mode
- PiP alert bar for focus warnings
- AI analysis button (saves API credits)
- Full web-based tracker with dashboard
- Focus timeline chart, quiz system
- Standalone Python tracker (main.py)
- Basic Haar Cascade face/eye detection
AndreasJeno β Built for learning and productivity.