A desktop "focus pet" that helps you stay on task. It combines:
- An animated desktop pet (
app/desktop_pet.py). - A Pomodoro-style scheduler and timer UI (
app/focus_pet_scheduler.py,app/focus_pet_timer.py). - A presence detector using MediaPipe + OpenCV (
app/presence_detector.py). - Local Flask servers for content-checking and browser-extension control (
server/focus_server.py,server/control_server.py). - A small Tkinter launcher UI to start/stop modules (
app/gui_launcher.py).
- Create and activate a virtual environment (Windows PowerShell):
python -m venv .venv
.\.venv\Scripts\Activate.ps1- Install dependencies:
python -m pip install -r requirements.txt- Additional steps:
- Download a MediaPipe FaceLandmarker
.taskmodel and place it atapp/data/face_landmarker.task, or updateMODEL_PATHinapp/presence_detector.pyto point to your model file. - (Optional) Set
OPENROUTER_API_KEYin your environment if you want thefocus_serverto call the OpenRouter API for page classification.
$env:OPENROUTER_API_KEY = "your_api_key_here"- Start the Launcher GUI (recommended):
python -m app.gui_launcher- Run modules directly:
python -m server.control_server
python -m server.focus_server
python -m app.presence_detector
python -m app.focus_pet_timer
python -m app.desktop_petapp/desktop_pet.pyexpects GIFs underapp/assets/gifs/and will raise an error if missing.app/presence_detector.pyrequires a FaceLandmarker.taskmodel and a working camera.server/focus_server.pyuses an external API (OpenRouter) — setOPENROUTER_API_KEYor the server will fallback to a permissive default.- There is no exhaustive
requirements.txtlockfile — the providedrequirements.txtlists packages inferred from the code; you may need to adjust package versions for your environment.
- (Optional) I can patch
presence_detector.pyto look for a relative model path automatically. - Add a small PowerShell dev-run script to start the control server, focus server, and launcher in a predictable order.
If you want, I can now try to run a quick smoke-check (compile the Python files to check syntax).