FocusBuddy: Smart Distraction Detection System
Inspiration
As students and remote workers, we found ourselves constantly battling distractions — whether it was zoning out, closing our eyes during long study sessions, or stepping away from the screen without realizing how much time we were losing. We realized that while there are many apps for blocking websites, there aren't many that offer real-time accountability in a subtle, non-intrusive way. This inspired us to build FocusBuddy — a webcam-powered focus assistant that helps you stay attentive during deep work sessions using intelligent visual detection and timely reminders.
What We Built
FocusBuddy is a Python-based tool that uses your webcam to monitor facial and eye presence in real time. If it detects that you're either missing from the frame for more than 10 seconds, it gently nudges you back to focus with an audio alert. The system resets the timers when it detects focus again, avoiding repeated alerts and ensuring a smooth experience.
Core Features:
- Real-time face and eye detection using OpenCV and Haar Cascades
- Distraction threshold and recovery logic
- Google Text-to-Speech-based audio reminders
- Threading for non-blocking alert playback
- Mode system to support multiple focus styles (Default mode active now, and Silent mode)
What We Learned
Throughout this project, we deepened our knowledge in computer vision, understanding how Haar cascades work, and tuning detection parameters. We also learned how to manage multithreading in Python, create responsive real-time systems, and deal with cross-platform compatibility issues. Additionally, we got hands-on experience using gTTS for generating audio alerts and playsound for playback.
How We Built It
We used Python 3, OpenCV for frame capture and facial/eye detection, Haar cascades for pre-trained classifiers, gTTS and playsound for generating and playing spoken reminders, tkinter for UI (planned for expansion), and the threading module to keep the app responsive.
Challenges We Faced
We ran into threading and GUI issues on macOS, especially with tkinter needing to run on the main thread. Detection accuracy was also sensitive to lighting and camera angles, requiring careful tuning. We implemented smart alert throttling to avoid spamming users, and ensuring compatibility across platforms like macOS and Windows was challenging due to differences in how certain Python libraries behave.
Final Thought
FocusBuddy is a simple yet powerful tool that acts like your digital accountability partner — helping you stay focused not by force, but by friendly reminders. We're excited about what this could grow into with more intelligent feedback and deeper insights.
Log in or sign up for Devpost to join the conversation.