Focus Tracker

An object detection model that screams at you when you’re on your phone

This is a fun project that “punishes” users for using their phone when they’re supposed to be working.

I developed it with a partner as a final project for the UCSD SPIS program.

Here’s a broad overview of how it works:

  1. Using a custom dataset of 827 photos we generated using OpenCV, we trained a YOLOv5 object detection model
  2. Using this custom trained model, we analyze images from a live webcam feed via OpenCV
  3. If a cell phone is detected, three punishments will occur:
    • The device will raise the volume to 100%, play an audio file that says “get off of your phone”, and adjust volume to the original level (os and playsound modules)
    • The device will open up a new browser window containing the link to our Github repository (webbrowser module)
    • A text will be sent to your phone (using Twilio API)

Challenges I faced:

  1. Collecting and processing the data took a while. I used Roboflow to draw bounding boxes over cell phones in our custom dataset, and it took me a couple of hours to process all of the images.
  2. Attempting to deploy the project to the web. Initially, me and my partner wanted to deploy it to the web. After discussing it with our mentors and spending hours trying everything we could, we decided we were no longer going to pursue this option. We kept on getting security errors during our attempts (likely due to our desire to access the user’s webcam and run our script).

Overall, this was a fun project and I enjoyed learning about object detection and convolutional neural networks.