{"id":51543944,"url":"https://github.com/izadoesdev/afk-tracker","last_synced_at":"2026-07-09T16:01:21.348Z","repository":{"id":283876308,"uuid":"953165864","full_name":"izadoesdev/afk-tracker","owner":"izadoesdev","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-22T18:08:29.000Z","size":46843,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-07-07T13:29:16.465Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/izadoesdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-22T18:07:20.000Z","updated_at":"2026-06-23T10:08:26.000Z","dependencies_parsed_at":"2025-03-22T19:31:33.886Z","dependency_job_id":null,"html_url":"https://github.com/izadoesdev/afk-tracker","commit_stats":null,"previous_names":["izadoesdev/afk-tracker"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/izadoesdev/afk-tracker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izadoesdev%2Fafk-tracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izadoesdev%2Fafk-tracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izadoesdev%2Fafk-tracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izadoesdev%2Fafk-tracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/izadoesdev","download_url":"https://codeload.github.com/izadoesdev/afk-tracker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izadoesdev%2Fafk-tracker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35304875,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-09T02:00:07.329Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-07-09T16:01:20.467Z","updated_at":"2026-07-09T16:01:21.339Z","avatar_url":"https://github.com/izadoesdev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AFK Tracker\n\nA Python application that uses your webcam to detect when you're away from your keyboard (AFK) by tracking face presence and eye visibility.\n\n## Features\n\n- Face detection to determine presence at the computer\n- Eye detection to determine if you're looking away \n- Blink detection to avoid false AFK triggers during normal blinking\n- Glasses detection for improved eye tracking with eyewear\n- AFK status tracking with timestamps\n- Statistical summaries of AFK sessions\n- Real-time visualization with status indicators\n\n### Debug Menu Features\n\nThe debug menu adds:\n- Visualization of the face detection process\n- Ability to toggle between different view modes (raw camera, grayscale, thresholded)\n- Face detection heatmap showing historical detections\n- Real-time adjustment of detection parameters\n- Detailed eye detection visualization\n- Blink detection visualization with history\n- Glasses detection status and confidence\n- Face detection confidence metrics\n- Blink counter with estimated blink rate \n\n## Requirements\n\n- Python 3.7+\n- Webcam\n- OpenCV with Haar Cascades\n\n## Installation\n\n1. Clone this repository:\n   ```\n   git clone https://github.com/izadoesdev/afk-tracker.git\n   cd afk-tracker\n   ```\n\n2. Install the required dependencies:\n   ```\n   pip install -r requirements.txt\n   ```\n\n3. Run the application launcher:\n   - Windows: `run.bat`\n   - Linux/Mac: `./run.sh`\n\n## Usage\n\n### Basic Detector\n\nRun the basic application:\n\n```\npython run.py\n```\n\nOptions:\n- `--camera` - Camera index to use (default: 0)\n- `--threshold` - Time in seconds without face to consider AFK (default: 3.0)\n- `--history` - Frames to use for detection smoothing (default: 30)\n\n### Debug Menu\n\nRun the application with debug menu:\n\n```\npython run.py --debug\n```\n\nDebug menu options:\n- `1` - Toggle Raw Camera View\n- `2` - Toggle Grayscale View\n- `3` - Toggle Thresholded View\n- `4` - Toggle Face Detection Visualization\n- `5` - Toggle Eye Detection Visualization\n- `6` - Toggle Blink Detection Visualization \n- `7` - Toggle Glasses Detection Visualization\n- `8` - Toggle Stats Display\n- `9` - Reset History\n- `0` - Reset Blink Counter\n- Use the threshold sliders to adjust detection sensitivity\n\n### Controls\n- Press 'q' to quit the application\n\n### Display Information\n- Green \"Status: Present\" - You are detected at your computer\n- Red \"Status: AFK\" - You are detected as away from keyboard\n- Blue rectangle - Face detected\n- Red rectangle - Face detected but looking away\n- Green rectangle - Eyes detected within face region\n- Purple \"Blinking\" label - Detected blink in progress\n- Yellow \"Glasses: Detected/Not Detected\" - Current glasses detection status\n- Red \"No face\" timer - How long since a face was last detected\n- Total AFK time - Cumulative time spent away from keyboard\n\n## How it Works\n\n### Detection Process\nThe application uses Haar Cascade classifiers to detect faces and eyes:\n1. Captures video from your webcam\n2. Converts frames to grayscale for processing\n3. Applies face detection algorithms to find faces\n4. For each detected face, searches for eyes (using both regular and glasses-specific eye detection)\n5. Differentiates between blinking and looking away based on detection patterns\n6. Considers user AFK if no face is detected for the threshold time\n7. Tracks statistics about AFK sessions\n8. Provides visual feedback about detection status\n\n### Intelligent Blink Detection\nThe application can distinguish between normal blinking and looking away:\n1. Tracks the duration of eye disappearance\n2. Short durations (\u003c 0.5 seconds) are classified as blinks\n3. Longer durations are classified as looking away\n4. A history buffer smooths detection to prevent false triggers\n5. Looking away must persist for 8 seconds (configurable) before triggering AFK status\n\n### Glasses Detection\nThe system automatically detects if you're wearing glasses:\n1. Uses specialized Haar cascade for detecting eyes with glasses\n2. Dynamically switches between regular and glasses-specific eye detection\n3. Maintains a confidence score for glasses detection\n4. Automatically adapts detection parameters based on eyewear\n\n### Debug Visualization\nThe debug menu provides insights into how the detection works:\n1. Face detection history displayed as a heatmap overlay\n2. Different view modes to see each processing step\n3. Real-time statistics about detection confidence\n4. Visual elements showing exactly which features are being detected\n5. Blink history visualization showing recent blink pattern\n6. Confidence metrics for all detection aspects (face, eyes, blinks, glasses)\n\n## Customization\n\nYou can modify the detector parameters to adjust sensitivity and behavior:\n- Adjust the threshold sliders in the debug menu:\n  - Blink Duration - How long an eye disappearance is considered a blink vs. looking away\n  - Looking Away Threshold - How long you must look away before triggering AFK\n  - Face/Eye Scale Factors - Detection sensitivity for faces and eyes\n  - Min Neighbors - Filtering for detection quality (higher = fewer false positives)\n- Change command line parameters for AFK threshold and history size\n\n## License\n\nMIT ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fizadoesdev%2Fafk-tracker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fizadoesdev%2Fafk-tracker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fizadoesdev%2Fafk-tracker/lists"}