Inspiration!

We figured it was going to be a long night of coding. After all, we only had 24 hours to build a super cool project worthy of being on my almost empty Github (and on HackMIT’s gallery, of course). We worried that late into the night, we would find ourselves dozing off as we fought battles against our own exhaustion…until we realized: What if we just built something that would keep us awake and alert while we worked?

What it does

sleepy.py is designed to keep you productive when you need it most. This AI-powered software analyzes life footage from your computer’s very own camera to see whether you are awake and alert or falling asleep. If it’s the latter, well…let’s just say that the program does not appreciate that.

How we built it

We mostly relied on Flask and Python for the backend, which ended up being the bulk of the project. We used Python’s cv2 library to capture live footage from the camera’s webcam. We then trained a custom yolov8 detection model to recognize whether a person was awake or asleep. We had a great time taking pictures of each other sleeping to collect images for the dataset. Finally, we used the results from the model and the Python playsound library to play “mystery” audios until the individual was back on track.

Challenges we ran into

We struggled a lot with coming up with an idea. We spent hours trying to find an idea that was both challenging and doable given our combined skill sets. We also struggled a lot with implementing hte frontend due to our lack of experience with React.js. Although we were unable to finish the frontend in time for submission, we saved the React.js file to Github so we could experiment more with it in our spare time.

Accomplishments that we're proud of

We were able to train, validate, and predict with a custom trained object detection model. This was a really cool accomplishment, as we were able to see machine learning in action. I am also very proud of my team’s communication. We were able to divide up tasks based on everyone’s strengths and adapted to any hiccups or unforeseen circumstances.

What we learned

We learned that even if the end product isn’t exactly what we envisioned, we could still be super proud of the project we did complete. Even without the fully functioning frontend, I am proud of how much we were able to accomplish in so little time.

What's next for sleepy.py

We hope to implement a more functional frontend that will allow you to access the webcam through a website rather than through the program. We also hope to expand our number of “consequences” for falling asleep.

Built With

Share this project:

Updates