Git Product home page Git Product logo

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 The Baby Sleep Coach. The Baby Sleep Coach provides sleep analysis of your baby, using only a video feed. You can access the sleep analysis via a locally hosted web app, which runs on launch.

Pre-requisites

  • Docker
  • USB webcam or camera which supports RTSP
  • Computer accessible via HTTP requests (I used a Raspberry Pi, but you can use any computer)

tl;dr Run it with Docker

Copy the .env_sample template into .env

cp .env_sample .env

Configure .env file:

CAM_URL URL of your camera. Likely rtsp://admin:[email protected]_IP:554/h264Preview_01_sub or /dev/video0 for a webcam

PORT Port for accessing web app

REACT_APP_BACKEND_IP IP of backend/api layer. Likely 192.168.COMPUTER_IP:8001

REACT_APP_RESOURCE_SERVER_IP IP of resource server (runs on launch) Likely 192.168.COMPUTER_IP:8000

HATCH_IP (optional) IP of your hatch for wake light

VIDEO_PATH (optional) use to set path to recorded footage for debugging

Remarks:

  • instead of 192.168.COMPUTER_IP you can use raspberrypi.local (or whatever name you gave when setting up your Raspberry Pi)
  • when using /dev/video0 (for USB webcam), also uncomment corresponding lines in docker-compose.yml

Run it

docker compose up

babysleepcoach's People

Contributors

bbjay avatar bckelly1 avatar calebolson123 avatar chris-alexiuk avatar ido1990 avatar ifross89 avatar romainreignier avatar vanseforge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

babysleepcoach's Issues

Help for a fellow maker dad / newbie to flask?

Hey Caleb, awesome project! I have been trying to set it up but cant figure out the last step or two, and I was hoping you could give me a pointer or two. So far I have:

-> I set up the rtsp stream using some rapberry pi and a camera. I know the stream works because I can read it and display it from another device.

-> I configured the .env file in the cloned repo accordingly.

-> I installed docker, and built the container (no errors)

-> I installed node.js and yarn, upgrading them to the latest version (>12), and ran "yarn install" and "yarn start" from the webapp directory. **to make this work I changed line 25 in the package.json file from "start&" tpo "start" (not shure this ws a typo).

=> everything appears to build successfully, a new webpage pops up at port 3000 and the blue GUI appears, but as soon as it looks like it will start working the screen turns red and the following error apperars:

Failed to fetch
TypeError: Failed to fetch
at getSleepNotificationsEnabled (http://localhost:3000/static/js/bundle.js:1023:34)
at Settings (http://localhost:3000/static/js/bundle.js:1027:36)
at renderWithHooks (http://localhost:3000/static/js/bundle.js:79874:22)
at mountIndeterminateComponent (http://localhost:3000/static/js/bundle.js:83160:17)
at beginWork (http://localhost:3000/static/js/bundle.js:84456:20)
at beginWork$1 (http://localhost:3000/static/js/bundle.js:89419:18)
at performUnitOfWork (http://localhost:3000/static/js/bundle.js:88688:16)
at workLoopSync (http://localhost:3000/static/js/bundle.js:88611:9)
at renderRootSync (http://localhost:3000/static/js/bundle.js:88584:11)
at performConcurrentWorkOnRoot (http://localhost:3000/static/js/bundle.js:87978:78)

So it looks like its not being able to grab the frames from the stream? Any idea what might be wrong or what am I missing? I have tried both from my pc and the raspberry pi4 with identical results (by the way, were you actually able to run this in a raspberry pi 4?)

Thanks for your help and for setting this up, its really cool!

Seeking hardware recommendations

This is not a burning issue, so feel free to deprioritize! Expecting father and tech enthusiast myself so I'm definitely going to give this project a try! Do you have any camera recommendations? Preferably WiFi but I could also run a POE camera pretty easily if it makes sense.

Error creating logs?

Hi Caleb!

I saw your youtube video and been wanting to give this a spin! Today i was attempting to set it up however i am running into an issiue.

Using the docker method; Altered the .env and the image spins up however i cant access the webpage. Would love some help! Thanks in advance!

The logs show me this:

/usr/app/babysleepcoach/main.py:71: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if focusRegionArr[0] is '':
WARNING: No module named 'pexpect'
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
(node:37) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:37) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
Traceback (most recent call last):
  File "/usr/app/babysleepcoach/main.py", line 48, in <module>
    logging.basicConfig(filename=logfile,
  File "/usr/lib/python3.11/logging/__init__.py", line 2050, in basicConfig
    h = FileHandler(filename, mode,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/logging/__init__.py", line 1181, in __init__
    StreamHandler.__init__(self, self._open())
                                 ^^^^^^^^^^^^
  File "/usr/lib/python3.11/logging/__init__.py", line 1213, in _open
    return open_func(self.baseFilename, self.mode,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/usr/app/babysleepcoach/babysleepcoach/sleepy_logs.log'

My docker-compose:

services:

  baby-sleep-coach:
    build:
      dockerfile: ./Dockerfile
      context: .
    ports:
      - "0.0.0.0:${PORT}:80"
      - "0.0.0.0:8000:8000"
      - "0.0.0.0:8001:8001"
    env_file:
      - .env
    volumes:
      - .:/usr/app/babysleepcoach
      - /usr/app/babysleepcoach/webapp/node_modules
    # To use a webcam, uncomment these lines
    # devices:
    #   - /dev/video0

And my .env (without camera URL on purpose):

APP_DIR=./babysleepcoach # location of app root, primarily used for docker
DEBUG=False
OWL=False # lol
VIDEO_PATH=./babysleepcoach/video # for debugging & testing
HATCH_IP=192.168.1.50 # optional
REACT_APP_BACKEND_IP=192.168.1.50:8001 # ip of flask server. Probably just localhost
REACT_APP_RESOURCE_SERVER_IP=192.168.1.50:8000 # ip of resource server
PORT=8070 # port web app serves assets from

docker-compose.yml

Might have missed something, but seems to be missing the docker-compose.yml file?

Can't see video feed on webapp.

I know the rtsp link is working because I can see it via VLC media player. I ran docker logs and came up with a bunch of errors I don't really understand. The webapp UI is visible, just no video feed.
image

image

image

image

Refactor of code

Hello @calebolson123 ,
I spent some time to refactor the code (my branch dev) in order to split code in different files for a better integration for other users. https://github.com/nos86/BabySleepCoach/tree/dev

Not all functions are currently re-implemented, but I need some support for debug.
Do you have some time to test my code and provide me some feedbacks on it?

currently env variable has not been reimplemented, so please change manually the VideoCapture string (main.py:105).

As soon as the debug is completed, I'll complete the implementation of missing functions and comment the code.
Feel free to reply to this topic listing all bugs / missing functions

Thanks in advance for your support,
Salvo

Connection to camera not taking into account port and path

I could be mistaken but shouldn't line 552 in main.py be:

c = cv2.VideoCapture(connect_str2)

(changed from: c = cv2.VideoCapture(connect_str))

I'm not much of a coder but I can fumble my way through and making that change allowed the code to run for me, it would error out prior to the change.

Problems with webapp connection

For some reason I can't connect to :
example: 192.xx.xxx.x:80 shows this below
image

whereas 192.xx.xxx.x:8000 shows this
image

These pictures are from my desktop browser. When I try connecting to these addresses on mobile, none of them work. Just "site can't be reached"
I'm totally lost here. Any help is appreciated.

Running this on my desktop, firewalls are deactivated, Docker has been put on the Allow list for windows security. Getting the same issue

Idea for new feature

The idea was to expand the baby sleep monitor with some sort of automatism to activate a heating device for the feeding bottles during the night when the baby wakes up (maybe with some sort of WiFi plug). So you can stand up, grab the bottle, feed the baby, put a new bottle into the heating device, and go back to sleep ๐Ÿ˜„

Adding to Unraid community apps store?

Just wondering if you thought of maybe adding to the community apps of Unraid because will definitely help adoption! If it really is the case of just providing the web feed, I know at least 5 people who could use this immediately. They just aren't tech savvy enough for rasperrypi. One quick way might be to add the image to docker-hub.

Great project!

bodyFound is undefined error on Docker on ubuntu server VM

Hi!
I'm trying to get this running on a brand new ubuntu server virtual machine. I've managed to solve some errors that I run into (didn't document that unfortunately), but I can't figure out a way around this one. Am I doing something dumb to produce this error somehow?

Full error message:

bodyFound is undefined ./src/VideoFeed.tsx/VideoFeed/</intervalId<@http://192.168.1.93/static/js/bundle.js:1616:20

image

Things I've done so far:

  • docker exec bash in the container for cd webapp && yarn install

    • This fixed an earlier error
  • Changes in main.py:

    • Disabled the "Bounds not set...." printout
    • Added cv2.imwrite to line 1010 to check that the camera is available and script can fetch images.
      • This results in a continuously updated jpeg that I can check and verify that the camera is working (it is).
  • in webapp/package.json as per previous issue

    • added to devDependencies:
      "@babel/plugin-proposal-private-property-in-object": "^7.16.0"
    • changed "start": "react-scripts start&", to "start": "react-scripts start",
  • Modified start_docker.sh:

    #!/bin/bash
    yarn --cwd webapp start &
    python3 main.py
    

I guess I could have skipped the start& -> start modification and not changed the start_docker.sh file at all, but I reached the point of just throwing everything at the problem.

docker-compose.yml:

services:
  baby-sleep-coach:
    build:
      dockerfile: ./Dockerfile
      context: .
    ports:
      - "0.0.0.0:${PORT}:80"
      - "0.0.0.0:8000:8000"
      - "0.0.0.0:8001:8001"
    env_file:
      - .env
    volumes:
      - type: bind
        source: /home/kamms/babysleepcoach
        target: "${APP_DIR}"

.env:

CAM_URL=rtsp://user:[email protected]:554/h264Preview_01_sub # full url of the baby camera
APP_DIR=/usr/app/babysleepcoach # location of app root, primarily used for docker
DEBUG=False
OWL=False # lol
VIDEO_PATH=/usr/app/babysleepcoach # for debugging & testing
#HATCH_IP=192.168.HATCH.IP # optional
REACT_APP_BACKEND_IP=192.168.1.93:8001#.0.206:8001 # ip of flask server. This is the ip of "this" machine running the system
REACT_APP_RESOURCE_SERVER_IP=192.168.1.93:8000#0.206:8000 # ip of resource server (TODO: align to 1 server). This is the ip of "this" machine running the system
PORT=80 # port web app serves assets from

Docker logs:

babysleepcoach-baby-sleep-coach-1  | yarn run v1.22.19
babysleepcoach-baby-sleep-coach-1  | $ react-scripts start
babysleepcoach-baby-sleep-coach-1  | WARNING: No module named 'pexpect'
babysleepcoach-baby-sleep-coach-1  | reading focusRegionArr:  ['']
babysleepcoach-baby-sleep-coach-1  | Initializing...
babysleepcoach-baby-sleep-coach-1  | 
babysleepcoach-baby-sleep-coach-1  | Initialization complete.
babysleepcoach-baby-sleep-coach-1  | Start receiving frames.
babysleepcoach-baby-sleep-coach-1  | Connecting to camera at: rtsp://user:[email protected]:554/h264Preview_01_sub
babysleepcoach-baby-sleep-coach-1  |  * Serving Flask app 'main'
babysleepcoach-baby-sleep-coach-1  |  * Debug mode: on
babysleepcoach-baby-sleep-coach-1  | INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
babysleepcoach-baby-sleep-coach-1  | (node:48) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
babysleepcoach-baby-sleep-coach-1  | (Use `node --trace-deprecation ...` to show where the warning was created)
babysleepcoach-baby-sleep-coach-1  | (node:48) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
babysleepcoach-baby-sleep-coach-1  | Starting the development server...
babysleepcoach-baby-sleep-coach-1  | 
babysleepcoach-baby-sleep-coach-1  | Compiled successfully!
babysleepcoach-baby-sleep-coach-1  | 
babysleepcoach-baby-sleep-coach-1  | You can now view baby-sleep-tracker in the browser.
babysleepcoach-baby-sleep-coach-1  | 
babysleepcoach-baby-sleep-coach-1  |   Local:            http://localhost:80
babysleepcoach-baby-sleep-coach-1  |   On Your Network:  http://172.18.0.2:80
babysleepcoach-baby-sleep-coach-1  | 
babysleepcoach-baby-sleep-coach-1  | Note that the development build is not optimized.
babysleepcoach-baby-sleep-coach-1  | To create a production build, use yarn build.
babysleepcoach-baby-sleep-coach-1  | 
babysleepcoach-baby-sleep-coach-1  | webpack compiled successfully
babysleepcoach-baby-sleep-coach-1  | Files successfully emitted, waiting for typecheck results...
babysleepcoach-baby-sleep-coach-1  | Issues checking in progress...
babysleepcoach-baby-sleep-coach-1  | No issues found.
babysleepcoach-baby-sleep-coach-1  | 192.168.1.46 - - [02/Jan/2024 13:55:04] "GET / HTTP/1.1" 200 -

Ports seem to be fine at least. Netstat -tuln in the container:

root@6941ba7bce4d:/usr/app/babysleepcoach# netstat -tuln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:8000            0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:8001            0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.11:41407        0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN     
udp        0      0 127.0.0.11:45988        0.0.0.0:*                   

How to reposition the cropped image?

I probably could figure this out, but it has taken me a while to make it this far. In the screenshot below, I'm simply trying to reposition the cropped frame to be in the center.

image

baby on the side, face isn't found

Hey,

I started to play with your repo yesterday, it's a lot of fun!
I have one problem though, the face is never found... Especially when on the side. Here the kid sleeps (trust me ๐Ÿ˜…), but log says

No face found, depreciate queue
Not voting on eyes, eye queue too short.

image

Any idea how to improve this? Does it have anything to do with the landmarks for instance? I'm very new to this...

Cheers!

Cant seem to get it started; Services not available?

Hi all! Been dying to try this out but cant get it running for now. Used the method in the readme with as little adjustments as possible (change port IP and backand tot my IP adress 192.168.1.50). After various attempts i get this:

Bounds not set, not running AI logic.
Compiled with warnings.

[eslint]
src/Charts.js
  Line 2:8:     'eventsWithinRange' is defined but never used                                                              no-unused-vars
  Line 3:10:    'FontAwesomeIcon' is defined but never used                                                                no-unused-vars
  Line 4:10:    'faSeedling' is defined but never used                                                                     no-unused-vars
  Line 4:22:    'faTree' is defined but never used                                                                         no-unused-vars
  Line 100:11:  'offset' is assigned a value but never used                                                                no-unused-vars
  Line 102:9:   'dayCount' is assigned a value but never used                                                              no-unused-vars
  Line 131:19:  'timeDiff' is assigned a value but never used                                                              no-unused-vars
  Line 168:3:   Date prototype is read only, properties should not be added                                                no-extend-native
  Line 198:34:  Expected '===' and instead saw '=='                                                                        eqeqeq
  Line 233:8:   React Hook useMemo has a missing dependency: 'forecast'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

src/CroppableVideoFeed.tsx
  Line 74:11:  'result' is assigned a value but never used                                                                @typescript-eslint/no-unused-vars
  Line 81:11:  'result' is assigned a value but never used                                                                @typescript-eslint/no-unused-vars
  Line 89:9:   img elements must have an alt prop, either with meaningful text, or an empty string for decorative images  jsx-a11y/alt-text

src/Settings.tsx
  Line 31:73:  Expected '===' and instead saw '=='  eqeqeq

src/SleepStats.js
  Line 3:73:    'faSeedling' is defined but never used  no-unused-vars
  Line 3:85:    'faTree' is defined but never used      no-unused-vars
  Line 111:22:  Expected '===' and instead saw '=='     eqeqeq
  Line 140:22:  Expected '===' and instead saw '=='     eqeqeq

src/VideoFeed.tsx
  Line 56:30:   '_notPresentProba' is assigned a value but never used                                                                                                                                                                                      @typescript-eslint/no-unused-vars
  Line 56:48:   '_time' is assigned a value but never used                                                                                                                                                                                                 @typescript-eslint/no-unused-vars
  Line 66:6:    React Hook useEffect has a missing dependency: 'setModelProba'. Either include it or remove the dependency array. If 'setModelProba' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps
  Line 94:63:   Unexpected mix of '&&' and '||'. Use parentheses to clarify the intended order of operations                                                                                                                                               no-mixed-operators
  Line 94:104:  Unexpected mix of '&&' and '||'. Use parentheses to clarify the intended order of operations                                                                                                                                               no-mixed-operators
  Line 97:42:   img elements must have an alt prop, either with meaningful text, or an empty string for decorative images                                                                                                                                  jsx-a11y/alt-text

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

WARNING in [eslint]
src/Charts.js
  Line 2:8:     'eventsWithinRange' is defined but never used                                                              no-unused-vars
  Line 3:10:    'FontAwesomeIcon' is defined but never used                                                                no-unused-vars
  Line 4:10:    'faSeedling' is defined but never used                                                                     no-unused-vars
  Line 4:22:    'faTree' is defined but never used                                                                         no-unused-vars
  Line 100:11:  'offset' is assigned a value but never used                                                                no-unused-vars
  Line 102:9:   'dayCount' is assigned a value but never used                                                              no-unused-vars
  Line 131:19:  'timeDiff' is assigned a value but never used                                                              no-unused-vars
  Line 168:3:   Date prototype is read only, properties should not be added                                                no-extend-native
  Line 198:34:  Expected '===' and instead saw '=='                                                                        eqeqeq
  Line 233:8:   React Hook useMemo has a missing dependency: 'forecast'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

src/CroppableVideoFeed.tsx
  Line 74:11:  'result' is assigned a value but never used                                                                @typescript-eslint/no-unused-vars
  Line 81:11:  'result' is assigned a value but never used                                                                @typescript-eslint/no-unused-vars
  Line 89:9:   img elements must have an alt prop, either with meaningful text, or an empty string for decorative images  jsx-a11y/alt-text

src/Settings.tsx
  Line 31:73:  Expected '===' and instead saw '=='  eqeqeq

src/SleepStats.js
  Line 3:73:    'faSeedling' is defined but never used  no-unused-vars
  Line 3:85:    'faTree' is defined but never used      no-unused-vars
  Line 111:22:  Expected '===' and instead saw '=='     eqeqeq
  Line 140:22:  Expected '===' and instead saw '=='     eqeqeq

src/VideoFeed.tsx
  Line 56:30:   '_notPresentProba' is assigned a value but never used                                                                                                                                                                                      @typescript-eslint/no-unused-vars
  Line 56:48:   '_time' is assigned a value but never used                                                                                                                                                                                                 @typescript-eslint/no-unused-vars
  Line 66:6:    React Hook useEffect has a missing dependency: 'setModelProba'. Either include it or remove the dependency array. If 'setModelProba' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps
  Line 94:63:   Unexpected mix of '&&' and '||'. Use parentheses to clarify the intended order of operations                                                                                                                                               no-mixed-operators
  Line 94:104:  Unexpected mix of '&&' and '||'. Use parentheses to clarify the intended order of operations                                                                                                                                               no-mixed-operators
  Line 97:42:   img elements must have an alt prop, either with meaningful text, or an empty string for decorative images                                                                                                                                  jsx-a11y/alt-text

webpack compiled with 1 warning
No issues found.
Bounds not set, not running AI logic.

I continue to receive the "bounds not set.." message after this.

Even tried to get it started with:
docker-compose up --build -d baby-sleep-coach

Any advice is well appreciated!

[h264 @ 0x7f500d2fe0] error while decoding MB 1 45, bytestream -6

Hey there,
has anyone had a similar issue? I believe it has to do with ffmpeg. I could be mistaken but I think it happens more often when things inside the crib are being moved. (Blankets moving, teddy bear leaves the crib etc.) At this point, my baby's body is not being recognized by the script but one of our teddy bears is. :-D So I'm testing with him a bit. I'm using a Reolink E1 Pro Camera

No body found, vote awake No face found, depreciate queue Not voting on eyes, eye queue too short. No body found, depreciate movement queue. [h264 @ 0x7f500d2fe0] error while decoding MB 1 45, bytestream -6 No body found, vote awake No face found, depreciate queue Not voting on eyes, eye queue too short. No body found, depreciate movement queue.

"ffprobe -rtsp_transport tcp rtsp://admin:[email protected]:554/h264Preview_01_main"

gives me this output:

Input #0, rtsp, from 'rtsp://admin:[email protected]:554/h264Preview_01_main': Metadata: title : Session streamed by "preview" comment : h264Preview_01_main Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: h264 (High), yuv420p(progressive), 1920x1080, 25 fps, 25 tbr, 90k tbn Stream #0:1: Audio: aac (LC), 16000 Hz, mono, fltp

I tried to favour tcp over udp but it makes no difference.
Here someone suggests to increase the shm-size but I dont know what that is or how to crank it up. blakeblackshear/frigate#1403 (comment)

I'm on a Raspberry Pi 4 running Raspberry Pi OS (64 bit)

This right here could be another solution: https://stackoverflow.com/questions/49233433/opencv-read-errorh264-0x8f915e0-error-while-decoding-mb-53-20-bytestream

@calebolson123 Does the code use multithreading?

qt.qpa.xcb: could not connect to display

I don't believe this issue has to do with the code, but I'm opening this just in case if anyone has faced this problem.

If I run main.py or debug it in VS Code I receive the below,

qt.qpa.xcb: could not connect to display

Need some help with this error when testing out this project with recorded video. I'm pretty certain I have all the correct dependencies in place. I believe this part of the reason why I been having problems viewing the stream?

Docker volume overrides node_modules

During the build step of the Docker image, yarn install is called and generates a node_modules directory in webapp.
This operation installs react-scripts used to start the web app.
But by mounting the current host dir in the container overrides the /usr/app/babysleepcoach directory content and the webapp/node_modules is not present anymore, resulting in the error on docker-compose up:

baby-sleep-coach    | yarn run v1.22.19
baby-sleep-coach    | $ react-scripts start&
baby-sleep-coach    | /bin/sh: 1: react-scripts: not found
baby-sleep-coach    | Done in 0.07s.

Only mounting single files is working but tedious:

    volumes:
      - ./main.py:/usr/app/babysleepcoach/main.py
      - ./sleep_logs.csv:/usr/app/babysleepcoach/sleep_logs.csv
      - ./user_defined_crop_area.txt:/usr/app/babysleepcoach/user_defined_crop_area.txt

Trouble properly configuring

Hey Caleb, I posted a question on your video about properly configuring my IPs. Here's the content of my .env file:

CAM_IP=rtsp://192.168.1.1:7447/8atQnRUSpjunlkbS
CAM_PW=temp
APP_DIR=/usr/app/babysleepcoach
DEBUG=True
OWL=False
VIDEO_PATH=/usr/app/babysleepcoach/video 
HATCH_IP=192.168.HATCH.IP
REACT_APP_BACKEND_IP=192.168.1.209:8001
REACT_APP_RESOURCE_SERVER_IP=192.168.1.209:8000
PORT=80

Error while running on Raspberry Pi

I am a newbie in SW and been having trouble getting this up. I am running "docker compose up" but end up with the following error message -

> [baby-sleep-coach 6/8] RUN pip3 install -r requirements.txt:
2.105 ERROR: Could not find a version that satisfies the requirement mediapipe==0.9.1.0 (from versions: 0.10.3, 0.10.5, 0.10.7, 0.10.8)
2.107 ERROR: No matching distribution found for mediapipe==0.9.1.0
failed to solve: process "bin/sh -c pip3 install -r requirements.txt" did not completed successfully: exit code: 1

I am running RaspberryOS 64-bit on RPi4b. Can anyone please help me with the above error.

python script infinite loop

Screenshot from 2023-04-17 23-01-08

Hi, I really like your work man! When I'm running the main.py script I get an infinite loop trying to find the body.
Any solutions?

Thanks!

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.