Skip to content

cy-xu/open_baby_monitor

Repository files navigation

Open Baby Monitor

My passion project as a new parent! Rather than buying more gear, why not repurpose old tech into a baby monitor that fits my needs? Here's the scoop:

  • Web Access: Keep an eye on her crib from anywhere, on any device.
  • Sleep Tracker: A deep-learning model checks whether she is in the crib and tracks her sleep quality.
  • Camera Control: Swap video feeds for different lighting conditions, or even flash on some light.
  • Secure: Password-protected.
  • Wallet-friendly: All you need is an old Android phone and a computer.

Demo video

web interface

Goals:

  • A password protected live video feed of the baby's crib
  • Detects the baby's movement using temporal information
  • Simple camera control, like auto-focus, toggle flashlight, save image.
  • Detects if the baby is in the crib
  • Automatically logs her sleep duration and quality
  • Detects if the baby's airway is obstructed (face down or covered)
  • Tracks the room temperature and humidity, so I can analyze any correlation with the baby's sleep quality
  • Detects the baby's movement using depth information

Setup

Install requirements

python -m pip install -r requirements.txt

Run

python streaming_server.py
# ./ngrok http 5000
# gunicorn --workers 1 --threads 1 --bind 0.0.0.0:5000 streaming_server:app

TODO:

  • Password protect the web app (flask_httpauth)
  • Broadcast to the internet with ngrok
  • Multi-camera switching
  • Use uuid to store session specific data like selected camera
  • Support Android phone's better low-light camear via IP Webcam
  • Now handles disconnection and automatic reconnection
  • Image data collection now works
  • Add a button to take a picture
  • "baby in crib" detection model via Google's Teachable Machine
  • The light now turns off after 10 seconds
  • Add a button to record a video
  • An infrared camera for the dark would be nice

References:

License

Notes:

  • The OAK-D stereo camera is nice to have, but the depth info is too noisy in the dark. My old Pixel 2, on the other hand, provides a much better low-light performance, so I switched.

  • user name and pin are saved in the environment variables (.env), add this file to .gitignore to avoid saving sensitive information in the code repository

  • Mac OS Catalina ssh issue: https://discussions.apple.com/thread/253932000. In Terminal, type in and execute the following: sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published