Inspiration
My inspiration for this project was wanting to automate a process that is carried out daily in my house with the care of the baby (my niece) and that is that we constantly make video calls to monitor her. Although it can work, it is not optimal, since it depends on the help of someone else to watch over it, which is not always possible and may be subject to distractions from that person. As in my case, there are many people with limited resources who cannot afford to buy a surveillance camera, but who can have a cell phone and a computer at home in some way. I wanted to help all those people with a free and accessible alternative for everyone. This represents one of the 17 UN objectives: HEALTH AND WELL-BEING. Well, the project seeks to prioritize the care of the little ones in the house. Additionally, the project is designed to be lightweight and run smoothly on low-resource computers.
What it does
The program uses artificial intelligence (AI) to detect if a baby is sleeping or has woken up, notifying parents through an alert on their devices, such as a smartwatch or any other default device. The project is designed to be lightweight and run smoothly on low-resource computers.
The central idea is that anyone who needs it can download and run the project at home, within a local network. Once activated, the program will be ready for use on any device in your home. Users can access the website, activate the camera and, using artificial intelligence, the program will detect the baby's eyes to check if she is awake or still asleep. In case the baby wakes up, an SMS will be automatically sent to the mother's phone. It is recommended that the mother have a smartwatch to receive notifications via vibration on her arm when the SMS arrives.
The program uses the Mediapipe library, which uses a mesh model to locate points on the face. Then, it retrieves the points corresponding to the eyes and performs calculations to determine eye movement, thus allowing real-time detection of the opening and closing of the eyes, triggering the corresponding actions.
How we built it
First, I made a list of steps for the build and listed all the tools I would need. I used several tools that I already knew, and here is the summary:
- Backend: In developing the server part, I used Python along with Flask. In this implementation, I made use of Mediapipe for precise selection of the points corresponding to the eyes on the face, within a provided mesh. This choice is based on my experience, as I consider it to be a safer option compared to using OpenCV for eye detection.
- Database: Implemented SQLite3 to manage the data related to the project.
- HTML, CSS and JS code optimization: To save space and improve the readability of the code, I used Jinja in creating the web pages.
- Real-time video transmission: I implemented websockets for efficient transmission of video frames from the client. This combination of technologies allowed the creation of an effective and efficient solution for the project.
Challenges we ran into
During the first attempts to capture live camera frames, I faced a significant problem: the computer was constantly becoming slow and overheating. This challenge led me to make several mindset changes, which are detailed in the README.md of the project's GitHub repository. After various iterations and adjustments, I finally managed to implement functional live video tracking. The key solution was to use a single loop and an image that is constantly updated. This strategy significantly reduced the storage required to run the program and significantly improved execution speed. This approach not only optimizes computer resources, but also makes the program more accessible, requiring less storage and computational effort.
Accomplishments that we're proud of
I feel incredibly proud to have created an alternative for people with limited resources that allows them to care for their babies. I firmly believe that this solution can be of great help to many communities and represents an excellent alternative to purchasing commercial devices. This project is something I deeply believe in, and I feel like I am contributing to making the world a better place by using my knowledge to help others.
What we learned
I have learned that nothing is impossible if you have enough time and patience. Constant effort pays off, and sometimes it is just necessary to take a breath and see the problem from another perspective to be able to successfully advance in what we propose.
What's next for SleepWatch Alert
I think this project could be a valuable contribution as an open source project to our society. Without a doubt, it makes me extremely proud. I plan to continue improving it in the future and perhaps it's time to seek help from other fellow programmers to further expand and enrich the project.

Log in or sign up for Devpost to join the conversation.