Giter Site home page Giter Site logo

lilincmu / babysleepcoach Goto Github PK

View Code? Open in Web Editor NEW

This project forked from calebolson123/babysleepcoach

0.0 0.0 0.0 1019 KB

DIY Baby Sleep Tracking

Home Page: https://calebolson.com

License: Other

JavaScript 3.11% Python 5.78% CSS 0.20% HTML 0.31% Jupyter Notebook 90.60%

babysleepcoach's Introduction

The Baby Sleep Coach

Shield: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

CC BY-NC-SA 4.0


This repo contains code to run the AI Baby Sleep Tracking service as well as a web application which provides the user with analysis and charts based on the recorded sleep data.

Pre-requisites

  • Camera which supports RTSP
  • Compute accessible via HTTP requests (I used a Raspberry Pi, but you can use any computer)
  • Python 3.10 or lower (3.11 is not supported by MediaPipe [see])

Setup

There are two components to configure:

  1. A sleep tracking python script
  2. A web application

Warning: jank ahead

I don't treat these projects as I would in industry. The result is a very monolithic and duct-tapey project.

If there is a desire, I will refactor and make this more repeatable and easy to use.

Part 1: Sleep Tracking Script

Install requirements: pip install -r requirements.txt

Run: python main.py

That's it. Except this is where the fun starts.

Most of the dependencies are self explanatory, the only issue I had was installing MediaPipe on Raspbian. I believe I used https://pypi.org/project/mediapipe-rpi4/, but I ran into a number of other issues I won't document here. glhf

There are number of environment variables and holes you'll need to fill with info about your environment. Instead of fixing things, I left a lot of comments.

Alternatively you can touch .env and then copy and paste the contents of .env_sample into it. Then fill in the blanks.

The sleep data is written to sleep_logs.csv. I primed this file with a few rows as an example. Feel free to remove these and start from scratch.

Part 2: The Web App

This one is more straight forward. Just make sure you have yarn.

Execute the following commands:

cd webapp; yarn install; yarn start;

And you'll probably get a warning about the app trying to boot on port 80. You can change it to whatever you want in the package.json.

You'll need to update some paths and IPs in the code.

Someone send me proof you got it all running.

babysleepcoach's People

Contributors

calebolson123 avatar bckelly1 avatar chris-alexiuk avatar ido1990 avatar vanseforge avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.