Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bodypix scaling breaks fake.py (?) #7

Closed
liske opened this issue Apr 19, 2020 · 7 comments
Closed

Bodypix scaling breaks fake.py (?) #7

liske opened this issue Apr 19, 2020 · 7 comments

Comments

@liske
Copy link
Contributor

liske commented Apr 19, 2020

Is it possible that c156ee9 had broken fake.py? I'm not sure if it is related to my docker setup, does it work for you @fangfufu ?

fakecam_1  | Running...
fakecam_1  | Please press CTRL-\ to exit.
fakecam_1  | Please CTRL-C to reload the background image
fakecam_1  | Traceback (most recent call last):
fakecam_1  |   File "fake.py", line 85, in <module>
fakecam_1  |     frame = get_frame(cap, background)
fakecam_1  |   File "fake.py", line 75, in get_frame
fakecam_1  |     frame[:,:,c] = frame[:,:,c]*mask + background[:,:,c]*inv_mask
fakecam_1  | ValueError: operands could not be broadcast together with shapes (720,1280) (360,640) 
@fangfufu
Copy link
Owner

It works for me. Are you using Python 3?

@fangfufu
Copy link
Owner

Ah, do note that bodypix_url='http://127.0.0.1:9000'. Previously bodypix_url='http://fakecam:9000'.

@liske
Copy link
Contributor Author

liske commented Apr 19, 2020

I used the updated Dockerfile using python3 and native Debian packages for the requirements (only pyfakecam is installed using pip).

There was some more errors before which was scrolled out of my terminal:

fakecam_1  | [ WARN:0] global ../modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
fakecam_1  | [ERROR:0] global ../modules/videoio/src/cap.cpp (116) open VIDEOIO(GSTREAMER): raised OpenCV exception:
fakecam_1  | 
fakecam_1  | OpenCV(4.2.0) ../modules/videoio/src/cap_gstreamer.cpp:743: error: (-215:Assertion failed) uridecodebin in function 'open'

Since it use network_mode: host the new bodypix_url is working (there is no more docker network around for the containers).

If it is working for you it is related to the dockered stuff... so I need to review it.

@fangfufu
Copy link
Owner

I can't really tell if it failed to open the real webcam or the virtual webcam.

@liske
Copy link
Contributor Author

liske commented Apr 19, 2020

It was nothing docker related. I'm using my Android phone as webcam (using adb-ffmpeg-v4l2loopback) and I've just used the wrong resolution of 640x360 instead of 1280x720 (pick the wrong line from my bash history).

Now it is working again, although the following messages are still there:

fakecam_1  | [ WARN:0] global ../modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
fakecam_1  | [ERROR:0] global ../modules/videoio/src/cap.cpp (116) open VIDEOIO(GSTREAMER): raised OpenCV exception:
fakecam_1  | 
fakecam_1  | OpenCV(4.2.0) ../modules/videoio/src/cap_gstreamer.cpp:743: error: (-215:Assertion failed) uridecodebin in function 'open'
fakecam_1  | 
fakecam_1  | 
fakecam_1  | Running...
fakecam_1  | Please press CTRL-\ to exit.
fakecam_1  | Please CTRL-C to reload the background image

@liske liske closed this as completed Apr 19, 2020
@fangfufu
Copy link
Owner

Glad that you got it sorted.

On a side note, I do have needrestart installed on my machines. It works great. I feel this is my 5 mins of fame. ;)

@exussum12
Copy link

@liske Im getting the same issue, but dont think I put anything in to bash for it ? Im using driodcam so maybe something which that is doing ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants