{"id":29804452,"url":"https://github.com/ayotomi-de/focuscam","last_synced_at":"2026-04-14T04:31:32.011Z","repository":{"id":302648483,"uuid":"1009546566","full_name":"Ayotomi-de/FocusCam","owner":"Ayotomi-de","description":"FocusCam is a lightweight desktop app that uses your webcam to track focus by detecting facial landmarks and eye visibility. It’s your mini assistant to know when you're not paying attention. 😉","archived":false,"fork":false,"pushed_at":"2025-07-26T22:14:45.000Z","size":212,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-27T01:23:33.899Z","etag":null,"topics":["distraction","face-detection","haar-cascade","mediapipe","mysql","object-detection","opencv","pillow","python","tkinter-gui"],"latest_commit_sha":null,"homepage":"","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/Ayotomi-de.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,"zenodo":null}},"created_at":"2025-06-27T10:00:33.000Z","updated_at":"2025-07-26T22:14:48.000Z","dependencies_parsed_at":"2025-07-03T14:26:39.444Z","dependency_job_id":"176abddb-c214-425c-8b40-0a50ff6cb459","html_url":"https://github.com/Ayotomi-de/FocusCam","commit_stats":null,"previous_names":["ayotomi-de/focuscam"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Ayotomi-de/FocusCam","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ayotomi-de%2FFocusCam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ayotomi-de%2FFocusCam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ayotomi-de%2FFocusCam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ayotomi-de%2FFocusCam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ayotomi-de","download_url":"https://codeload.github.com/Ayotomi-de/FocusCam/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ayotomi-de%2FFocusCam/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267520406,"owners_count":24100830,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"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":["distraction","face-detection","haar-cascade","mediapipe","mysql","object-detection","opencv","pillow","python","tkinter-gui"],"created_at":"2025-07-28T13:01:03.338Z","updated_at":"2026-04-14T04:31:31.992Z","avatar_url":"https://github.com/Ayotomi-de.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎯 FocusCam: Distraction Detection App \n\nFocusCam is a lightweight desktop app that uses your webcam to track focus by detecting facial landmarks and eye visibility. Built with **OpenCV**, **MediaPipe**, and **Tkinter**, it’s your mini assistant to know when you're not paying attention. \n\n## Features\n- Real-time face \u0026 eye detection using MediaPipe FaceMesh.\n- Logs moments of distraction to a CSV file.\n- Simple and clean GUI using Tkinter.\n- Real-time video display using your webcam.\n- Beginner-friendly codebase to learn from.\n- Designed with students and focus-lovers in mind.\n\n## 🧠 What I’m Learning\nThis is my first full solo computer vision project after lots of tutorials!  \nI'm learning to:\n- Use GUI frameworks (like Tkinter)\n- Integrate MediaPipe for face \u0026 eye tracking\n- Build real-time applications\n- Handle logic for motion/distraction detection\n- Log events to external files\n- Debug Python library issues\n- Save photos to database.\n\n## 💻 Tech Stack\n- Python \n- OpenCV\n- MediaPipe\n- Tkinter\n- PIL (Pillow)\n- CSV Logging\n- MySQL\n\n## 🛠️ How to Run\n1. Clone this repo  \n   `git clone https://github.com/\u003cyour-username\u003e/FocusCam.git`\n\n2. Install dependencies  \n   `pip install opencv-python mediapipe Pillow`\n\n3. Run the app  \n   `python focuscam.py`\n\n| Error                                  | Fix                                                          |\n| -------------------------------------- | ------------------------------------------------------------ |\n| `OSError: could not get source code` | MediaPipe doesn’t support Python 3.12 — I downgraded to 3.10 |\n| Haarcascade not detecting eyes       | Switched to MediaPipe FaceMesh for better accuracy           |\n\n## 📂 Project Files\n- `focuscam.py` – Main app file\n- `distraction_log.csv` – Log file for distractions\n- `README.md` – This doc\n- `haarcascade_frontalface_default.xml` – (Optional backup if you use it)\n- `haarcascade_eye.xml`\n- `database.py` - Mysql database connection code\n- `test_db_connection` - To test if Mysql runs smoothly\n- `focuscam.sql` - The SQL query of the Mysql databse which I created in phpMyAdmin using XAMPP.\n- `banner.png` - (Coming soon: project thumbnail!)\n\n## Planned Improvements\n- [x] Real-time face detection using FaceMesh\n- [x] Distraction logging to CSV\n- [x] Start/Stop detection button\n- [x] Clean exit button\n- [x] Saving users faces and username in a Mysql database\n- [x] Storing users info in a Mysql \n- [x] Notification system (e.g. sound or pop-up)\n- [ ] Face recognition\n- [ ] Export logs as summary report (particluarly as pdf files)\n\n## Planned Updates and Upcoming Changes\nAfter some deep thinking, i've decided to change focuscam to something else that can be implemented in the real-word usage, it can be a whole different logic or maybe a web app, who knows? However, I'll continue working on the logic of focuscam so stay tunded 😉.\n \n## Let's Connect\n👩🏽‍💻 About Me \u003cbr\u003e\nHi, I’m **Ayotomide** — a passionate learner, tech enthusiast, and now a proud builder of FocusCam!\nThis project is part of my journey into computer vision and software engineering.\n\nGot ideas? Want to contribute or learn together? Let’s connect: \u003cbr\u003e\n📧 [My email](mailto:ayotomide.toluwani@gmail.com) \u003cbr\u003e\n🐦 [Ayotomide Ogunsami](www.linkedin.com/in/ayotomide-ogunsami-93aa61312)\n\n\u003e “Focus is the key to finishing. Let your camera catch what your brain might miss.”\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayotomi-de%2Ffocuscam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayotomi-de%2Ffocuscam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayotomi-de%2Ffocuscam/lists"}