Everyone struggles with paying attention while working long hours at their screen. By giving continuous feedback on how drowsy someone is, they can better schedule when to take breaks and find their most/least productive hours.

What it does

Time4Break is a web app that detects drowsiness in an individual. This is done by analyzing the characteristics of the eyes and mouth. If drowsiness is detected, it will give an audio and visual notification to alert the user when it detects that they are feeling drowsy.

How we built it

The main detection was done using OpenCV and the MediaPipe framework. To detect drowsiness in the eyes, multiple points reference points are placed on the eyes. A ratio is then calculated using the location of those said points. The ratio will increase as the eyes close. Once the ratio reaches a certain point, it sets the state in the Firebase database to be drowsy. The database and video feed (Integrated with Flask) is then connected to a web page which includes user authentication. The webpage is created using JavaScript, HTML, and CSS.

Challenges we ran into

This was the first time any of us has used firebase to allow for user authentication and this ended up being more challenging than we expected. After trying out various solutions, we finally got it working and were satisfied with the login. Similarly, we've all worked with databases frequently, but not firebase's real-time database system. With some playing around we got it working as we wanted and everything worked out!

Accomplishments that we're proud of

It was our first time using Firebase as a database so we are proud to get it working correctly though after some difficulties that we had to overcome. We are also glad that we were able to use MediaPipe effortlessly as it allowed us to efficiently implement our own specific face detecting algorithms.

What we learned

We learned how to effectively use Firebase as a database and how to add user authentication to a web app. It was our first time using MediaPipe so we had to learn how to integrate that into our program.

What's next for Time4Break

In the future, we can deploy the application so people can use it in their daily lives. We may also implement it as a chrome extension to work in the background. An additional feature that may be implemented is access to data that the user can analyze to analyze their own drowsiness patterns. Suggestions can be implemented so users can change their behavior based on what the app detects.

+ 1 more
Share this project: