IoT project leveraging computer vision and data analytics to monitor baby sleeping position and sleeping patterns.
SlumberWatch utilizes IoT technology and artificial intelligence to offer real-time monitoring and alerts for sleeping baby posture, the sleeping environment, and analytics of baby's sleeping patterns. It incorporates a variety of sensors such as gyroscope, pressure, image and ultrasonic distance to collect data on your baby's movements and sleeping patterns. Through the power of computer vision, data analytics, and supervised machine learning, the system can accurately detect when infant is at risk of rolling over and generate a real-time alarm to alert you to the danger.
Please perform the following set up
- All development is done using virtual env. Please install virtualenv if you have not done so.
pip3 install virtualenv
which virtualenv -- verify installation
virtualenv venv -- create env called venv
source venv/bin/activate -- activate venv
pip install -r requirements.txt -- install packages to the virtual env
deactivate -- deactivate venv
sudo rm -rf venv -- remove env
- Installation
2.1. To install the opencv model, you need to install the following packages
Please follow https://stackoverflow.com/questions/48734119/git-lfs-is-not-a-git-command-unclear
then
# Install git-lfs from https://git-lfs.github.com/
git clone https://github.com/opencv/opencv_zoo && cd opencv_zoo
git lfs install
git lfs pull
2.2. For detection of eye open/close, please download and unzip the following file, and place it under dir ml
http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2
This is used in ml > face_detection_model.detect_eye_in_image
2.3. Install Cmake
for windows: install from https://cmake.org/download/ for mac:
brew install cmake
- Set up description
3.1 Microbit set up
- transfer r-controller to one microbit
- transfer rnode-baby to one microbit
- transfer rnode-environment1 to one microbit
- transfer rnode-environment2 to one microbit
3.2 Raspberry pi set up
- install packages listed in requirements.txt, note that virtual env is not needed
- run ./reset_db.sh to create the database tables
- update the IP addresses in fog_processor.py
3.3 Cloud set up
- create virtual env venv
- install packages listed in requirements.txt
- activate venv
- run ./reset_db.sh to create the database tables
- update the IP addresses in cloud_processor.py
3.4 FE set up
- ensure that node is installed
- go to frontend/my-app
- run npm i
To run
- in Raspberry pi, run fog_processor -> this will run all the programs
- in local computer, run cloud_processor -> this will run all the programs
- go to frontend/my-app and run npm run dev -> this will start frontend