tomasz-lewicki / ai-thermometer

Fever screening with IR & RGB cameras and Deep CNNs
148 stars 39 forks source link

UVC error #11

Closed razilla closed 3 years ago

razilla commented 3 years ago

Hey Tomasz

Thanks for putting this out for people its a really cool project bro. I'm having trouble finding the video; I get the following error. Any idea trouble where I messed up? I'm thinking it may be how cameras are lined up. I 3d printed the case you gave but I noticed its slightly different than what you showed in the blog post. I attached a picture of how it look on my end was hoping if you thought that was maybe the problem. Also I 3d printed an Iron Man Helmet as a case I think you would appreciate. I attached that as well.

Thanks again, Raza

IMG-0399 IMG-0400 IMG-0398

/ai-thermometer$ python3 main.py Loading weights from file... Weights loaded! Running first net inference... Detector initialized! GST_ARGUS: Creating output stream CONSUMER: Waiting until producer is connected... GST_ARGUS: Available Sensor modes : GST_ARGUS: 3264 x 2464 FR = 21.000000 fps Duration = 47619048 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 3264 x 1848 FR = 28.000001 fps Duration = 35714284 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1920 x 1080 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 120.000005 fps Duration = 8333333 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings: Camera index = 0 Camera mode = 0 Output Stream W = 3264 H = 2464 seconds to Run = 0 Frame Rate = 21.000000 GST_ARGUS: Setup Complete, Starting captures for 0 seconds GST_ARGUS: Starting repeat capture requests. CONSUMER: Producer has connected; continuing. [ WARN:0] global /tmp/build_opencv/opencv/modules/videoio/src/cap_gstreamer.cpp (935) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1 uvc_open error -3

glbt commented 3 years ago

This is permissions on the camera I believe, try it with sudo and see if it works :)

razilla commented 3 years ago

Not getting the frames

raza@raza-desktop:~/ai-thermometer$ sudo python3 main.py Loading weights from file... Weights loaded! Running first net inference... Detector initialized! GST_ARGUS: Creating output stream CONSUMER: Waiting until producer is connected... GST_ARGUS: Available Sensor modes : GST_ARGUS: 3264 x 2464 FR = 21.000000 fps Duration = 47619048 ; Analog Gain rang e min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 3264 x 1848 FR = 28.000001 fps Duration = 35714284 ; Analog Gain rang e min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1920 x 1080 FR = 29.999999 fps Duration = 33333334 ; Analog Gain rang e min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 120.000005 fps Duration = 8333333 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings: Camera index = 0 Camera mode = 0 Output Stream W = 3264 H = 2464 seconds to Run = 0 Frame Rate = 21.000000 GST_ARGUS: Setup Complete, Starting captures for 0 seconds GST_ARGUS: Starting repeat capture requests. CONSUMER: Producer has connected; continuing. [ WARN:0] global /tmp/build_opencv/opencv/modules/videoio/src/cap_gstreamer.cpp (935) open OpenCV | GStreamer warning: Cannot query video position: status=0, va lue=-1, duration=-1 device opened! Version gpp: 0.0.0 dsp: 0.0.0 FLIR part #: b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' FLIR serial #: b'\x00\x00\x00\x00\x00\x00\x00\x00' format: b'UYVY' frame 80x60 @ 9fps format: b'Y16 ' frame 80x60 @ 9fps frame 80x63 @ 9fps format: b'Y8 ' frame 80x60 @ 9fps format: b'RGBP' frame 80x60 @ 9fps format: b'}\xeb6\xe4' frame 80x60 @ 9fps Estimated / selected altsetting bandwith : 13 / 642. No protocol specified Unable to init server: Could not connect: Connection refused

(python3:8113): Gtk-WARNING **: 11:53:00.221: cannot open display: :0 CONSUMER: Done Success WARN: no frame WARN: no frame WARN: no frame WARN: no frame WARN: no frame WARN: no frame WARN: no frame WARN: no frame WARN: no frame WARN: no frame WARN: no frame WARNING Argus: 5 client objects still exist during shutdown: 547884820536 (0x7f04003b88) 547891253568 (0x7f040018c0) 547891253728 (0x7f04001960) 547891258416 (0x7f04001ac0) 547891259712 (0x7f04003a70)

tomasz-lewicki commented 3 years ago

Hi @razilla !

As @glbt said, It looks like an issue with r/w permissions for the USB device.

I posted a solution in readme under "Common Issues"

If you do the following, you should be able to run this code without sudo.

echo 'SUBSYSTEM=="usb",  ENV{DEVTYPE}=="usb_device", GROUP="plugdev", MODE="0664"' | sudo tee /etc/udev/rules.d/10-libuvc.rules 
sudo udevadm trigger

Let me know if the other issue persists with the new udev rules & without sudo :slightly_smiling_face:

tomasz-lewicki commented 3 years ago

If you refer to the post on hackster.io, I posted it a while back and probably updated the enclosure design since then :) Also, cool mask! :smile:

deantheiceman commented 3 years ago

Hi @tomek-l reallly nice work. I have the same problem, getting

Loading weights from file... Weights loaded! Running first net inference... Detector initialized! Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:568 Failed to create CaptureSession [ WARN:0] global /tmp/build_opencv/opencv/modules/videoio/src/cap_gstreamer.cpp (935) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1 WARN: no frame device opened! Version gpp: 3.3.26 dsp: 3.3.26 FLIR part #: b'500-0771-01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' FLIR serial #: b'\x08d7\x01\x00\x00\x00\x00' format: b'UYVY' frame 160x120 @ 9fps format: b'Y16 ' frame 160x120 @ 9fps frame 160x122 @ 9fps format: b'Y8 ' frame 160x120 @ 9fps format: b'RGBP' frame 160x120 @ 9fps format: b'}\xeb6\xe4' frame 160x120 @ 9fps Estimated / selected altsetting bandwith : 18 / 642. WARN: Using $DISPLAY from environment, not from config Waiting for RGB frames WARN: no frame Waiting for RGB frames WARN: no frame Waiting for RGB frames WARN: no frame Waiting for RGB frames WARN: no frame Waiting for RGB frames WARN: no frame Waiting for RGB frames WARN: no frame Waiting for RGB frames WARN: no frame Waiting for RGB frames WARN: no frame Waiting for RGB frames WARN: no frame Waiting for RGB frames WARN: no frame Waiting for RGB frames WARN: no frame Waiting for RGB frames WARN: no frame Waiting for RGB frames WARN: no frame Waiting for RGB frames WARN: no frame Waiting for RGB frames

I also tried running as root still got the same problem

Any suggestions?

tomasz-lewicki commented 3 years ago

Hi @deantheiceman !

Looks like the gstreamer pipeline got initialized correctly, but we're not getting any RGB frames upon .read().

This can occur if something crashes on nvargus side. Most of the time restarting it should solve the problem:

sudo systemctl restart nvargus-daemon

Let me know if this helped! :slightly_smiling_face:

deantheiceman commented 3 years ago

Hi @tomek-l thanks for the reply. I tried rebooting and also restarting the service with no luck,

CONSUMER: Producer has connected; continuing.
[ WARN:0] global /tmp/build_opencv/opencv/modules/videoio/src/cap_gstreamer.cpp (935) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
uvc_open error -3

Although the error message seems to be slightly different

EDIT: Got it working, thanks so much

nanogear commented 3 years ago

Hey Tomasz

Thanks for putting this out for people its a really cool project bro. I'm having trouble finding the video; I get the following error. Any idea trouble where I messed up? I'm thinking it may be how cameras are lined up. I 3d printed the case you gave but I noticed its slightly different than what you showed in the blog post. I attached a picture of how it look on my end was hoping if you thought that was maybe the problem. Also I 3d printed an Iron Man Helmet as a case I think you would appreciate. I attached that as well.

Thanks again, Raza

So, just to get this clear...the position of the cameras as Razilla have them are ok to work with?

razilla commented 3 years ago

@nanogear Yes the positions work where I put them. You should see two different screens when you get it running so the positioning can vary slightly is what I've noticed. The screens actually seem to operate independently from one another. i.e. you can have two people in infrared and only one in the RGB or vice versa but you really have to be trying to do that.

Image from iOS