Skip to content

FocusTrack is a smart productivity companion that uses real-time computer vision and behavioral analytics to monitor user attention, screen time, and focus patterns. By leveraging facial landmark detection, head pose estimation, and eye-blink/mouth movement analysis, FocusTrack detects signs of distraction, drowsiness, and cognitive fatigue.

License

Notifications You must be signed in to change notification settings

anshhhcodes/FocusTrack

Repository files navigation

🎯 FocusTrack – Real-Time Attention Monitoring System

FocusTrack is a real-time facial behavior analysis tool that tracks attention, blink rate, yawns, and head pose using webcam video. Built on computer vision and deep learning, it’s perfect for online learning, productivity tracking, and ergonomic monitoring.

🧠 Features

  • ✅ Real-time face detection and tracking
  • 👁️ Blink detection using Eye Aspect Ratio (EAR)
  • 😮 Yawn detection using Mouth Aspect Ratio (MAR)
  • 🧭 Head pose estimation with 3D axis overlay
  • 🧑‍💻 Lost focus tracking (based on head orientation)
  • 🚫 Face-not-present detection
  • 🎞️ FPS counter to track system performance

🎥 Demo

FocusTrack Demo


📸 How It Works

  • Uses facial landmarks to calculate eye/mouth openness
  • Determines attention based on head direction
  • Logs blink, yawn, distraction stats in real-time

🛠️ Requirements

  • Python 3.10+
  • OpenCV
  • Dlib
  • imutils
  • NumPy
  • Pillow
  • SciPy
  • torch (for Hopenet head pose estimation)

Getting Started

To get started with the code on this repo, you need to either clone or download this repo into your machine

https://github.com/anshhhcodes/FocusTrack

Dependencies

Before you begin playing with the source code, you might need to install dependencies

pip install -r requirements.txt

Running the Code

When you run the script, it will automatically load all the models in models folder

python main.py

📚 References

  • Hopenet – Head pose prediction model by Nataniel Ruiz

🤝 Want to Contribute?

If you'd like to add a new feature or contribute improvements, you're absolutely welcome to do so!
Feel free to fork the repo, open a pull request, or raise an issue — contributions are encouraged!

About

FocusTrack is a smart productivity companion that uses real-time computer vision and behavioral analytics to monitor user attention, screen time, and focus patterns. By leveraging facial landmark detection, head pose estimation, and eye-blink/mouth movement analysis, FocusTrack detects signs of distraction, drowsiness, and cognitive fatigue.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages