A face-powered productivity tracker that measures actual focus time and generates AI-powered productivity reports.
Instead of tracking applications or screen activity, this tracker monitors whether you are physically present and working using real-time face detection.
- Detects your presence using MediaPipe Face Detection
- Automatically starts productivity timer when you are present
- Automatically pauses when you leave
When no face is detected for a configurable amount of time:
- Productivity timer pauses automatically
- Junk time begins tracking
Keyboard shortcuts allow manual breaks:
- Pause session
- Resume session
- Track total break duration
- Count total breaks
Tracks:
- Total Productivity Time
- Total Junk Time
- Total Break Time
- Number of Breaks
- Session Start Time
- Session End Time
Every completed session is saved to:
- TXT file
- JSON database
The JSON database automatically keeps only the latest 10 sessions:
- Oldest session removed
- Newest session added
This creates a rolling productivity history for AI analysis.
Using OpenRouter API:
The tracker sends recent session history to an AI model which:
- Detects productivity patterns
- Finds weaknesses
- Identifies improvements
- Generates personalized recommendations
- Compares recent performance with older sessions
After analysis, the AI generates a complete productivity report in HTML format.
Reports include:
- Productivity Score
- Trend Analysis
- Performance Summary
- Positive Improvements
- Problems Detected
- Actionable Suggestions
- Behavioral Insights
All settings are managed through:
{
"stopwatch_starts_after": 2,
"stopwatch_pause_after": 10,
"session_storage_path_txt": "",
"session_storage_path_html": ""
}| Setting | Description |
|---|---|
| stopwatch_starts_after | Seconds face must remain visible before timer starts |
| stopwatch_pause_after | Seconds face can disappear before auto-pause |
| session_storage_path_txt | Location of session log file |
| session_storage_path_html | Location of generated HTML reports |
| Shortcut | Action |
|---|---|
| CTRL + SHIFT + ALT + P | Manual Pause |
| CTRL + SHIFT + ALT + R | Resume |
| CTRL + SHIFT + ALT + S | Reset Session |
| CTRL + SHIFT + ALT + Q | End Session |
Clone repository:
git clone https://github.com/raghav-mendiratta/Focus-Tracker
cd Focus-TrackerInstall dependencies:
pip install -r requirements.txtCreate environment file:
OPENROUTER_API_KEY=your_api_key_here
AI_MODEL=your_ai_model_nameRun:
python focus_tracker.pyOR
start.batfocus-tracker/
│
├── main.py
├── settings.json
├── sessions.json
├── requirements.txt
├── README.md
├── .env
│
├── Generated Reports/
│ └── *.html
│
└── Session Logs/
└── track.txt
I originally built this project for myself.
I used to track my work sessions using a normal stopwatch, but there was a problem:
- Sometimes I would take an unexpected break and forget to pause the timer.
- Sometimes I would leave my desk for a few minutes and the stopwatch would keep running.
- At the end of the day, my productivity numbers looked good, but they weren't always accurate.
In short, I was measuring time, not actual focus.
To solve that problem, I built Focus Tracker.
Instead of relying on manual tracking, it automatically detects whether I'm physically present and working. If I leave my desk, the timer pauses. If I return, it resumes automatically.
After using it myself, I realized that many people struggle with the same issue: fake productivity caused by inaccurate tracking.
So I kept improving it and turned it into a complete productivity analysis tool with session history, AI-powered insights, and automated reports.
- Productivity charts
- Weekly reports
- Monthly reports
- PDF export
- Productivity scoring engine
- GUI dashboard (PySide6)
- Cloud synchronization
- Multi-user support
- Python
- MediaPipe
- OpenCV
- OpenRouter API
- Requests
- JSON
- HTML/CSS
MIT License
Built by Raghav Mendiratta