For both students and workers, it can be very challenging to get through an assignment or task when fatigue/boredom begins to set in. This is why the YouTuber known as Neuralalgorithmic decided to create a smart device, which can monitor a user for perhaps the most common distractions: looking at a smartphone. By tracking when this devious object comes into view, the subject can then be nudged back onto task by blaring loud music and blinding them with light until focus is achieved once more.
The first challenge that had to be overcome was figuring out how to determine if a phone is being held. To accomplish this, Neuralalgorithmic ran some initial experiments using OpenCV and the SSD MobileNet neural network trained on the COCO dataset. This allowed him to set up a webcam and track where various objects appear on the screen in real-time.
Once this crucial step had been figured out, he set to work writing a Python script that could turn the mere presence of a phone into some kind of action. Within an infinite loop, the latest frame is read from the camera and passed to the neural network where it is then labeled with every detected object. If any are detected that match the ID for a cell phone, then a Firebase database is updated with the value
1, otherwise it remains
A mobile app was also created that controls a phone's flashlight functionality, thereby enabling it to receive information from the Firebase service and react whenever the value changes. A set of speakers were also connected so that blaring loud noise could be played for an added level of motivation. To see this project in action and watch how Neuralalgorithmic built this system, you can view his video here on YouTube.