Open granteagon opened 8 years ago
Face detection can always be improved but for the most part this will require a fully lit face.
Going to investigate cascade settings to improve face detection in poor lighting conditions. On Oct 12, 2015 12:19 PM, "Grant Eagon" notifications@github.com wrote:
When I hit setup I get:
('Error:', 'Expected 1 face, found 0 faces. Please make sure your face is in frame, and remove any other things detected as a face from the frame.')
I checked FaceTime to see what's up and half of my face is in shadow from the window next to me. I quit it and relauched, this time facing the window and still got the same error. Looks like face detection needs some work.
— Reply to this email directly or view it on GitHub https://github.com/pyskell/slouchy/issues/1.
Same as above, but it seems like a hardware interface issue. The webcam is started and quickly shut off. The green light next to the webcam flashes on momentarily, then I get the above error. Output from the program as it attempts to run:
$ python slouchy.py
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
"sni-qt/5194" WARN 17:46:07.952 void StatusNotifierItemFactory::connectToSnw() Invalid interface to SNW_SERVICE
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
('Error:', 'Expected 1 face, found 0 faces. Please make sure your face is in frame, and remove any other things detected as a face from the frame.')
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
I'm using the Ubuntu provided package as described in #5. Should OpenCV be compiled?
This stackoverflow says the issue is related to older versions of OpenCV. I am installing the compiled version now.
While using https://github.com/mroth/lolcommits faced with the same issue on MBP (too dark images from webcam). Issue was resolved using delay before taking screenshot ... like giving time for webcam to "warm up" (https://github.com/mroth/lolcommits/issues/222). Lolcommits uses some external tool for taking images from webcam, but I'm pretty sure that cv2 also can do the trick. Hope it will help!
Thank you all for the input and feedback.
There are two possible issues here:
camera_delay
in slouchy.ini
and let me know if that fixes the issue.Working on Mac OSX, setting the Camera deley to 15 did it for me :)
@The-Outrider don't see camera delay as an option in the .ini. If you're talking about check_frequency
, that didn't work for me.
@granteagon did you git pull recently? (side note, I'm getting a lot of false positives, or my posture is really super bad... maybe because I have my laptop not at a 90 degree angle?)
@The-Outrider try adjusting the allowed_variance
setting in slouchy.ini
The default is set to only allow about 4% variance. Maybe around 0.1 will work for you.
Here's the debug i'm currently getting, and this is the initial setup when I execute the program.
And then actual slouching after setup
I see, your webcam is much higher resolution than mine. So the math is thrown off.
I'm going to try a different way of calculating that is independent of webcam resolution.
@The-Outrider that was it.. Weird. I cloned yesterday. I just deleted the repo and re-cloned and it worked! Awesome.
Oh and that data is after upping the variance to .1 (forgot to mention I did as you requested ;))
OK cool, btw a temporary fix right now is probably setting the variance to about 4.5
@The-Outrider I've created a new testing branch, can you switch to that branch and let me know if it works better for you now? And provide the output?
For this one you should be able to set variance pretty low (0.02 to 0.1). You'll need to re-run Setup as well.
I've tested this on a 480p and 720p webcam, so hopefully it scales for other resolutions.
Tested, here's the output. Used a variance of .02. Sat up straight the first time, and slouched the second.
Looks like it's working alright for you now. Just need to tweak the variance so it's a little more sensitive for you. Maybe 0.15 or so.
That part is more up to the user because everyone has a different point they'd consider slouching.
One last question. I see an Exception was thrown at the end. Do you have the full text of it and know if anything you did (such as Ctrl+C) caused it? Or did it just happen while the program was running? On Oct 13, 2015 3:10 PM, "David Rynearson" notifications@github.com wrote:
Tested, here's the output. Used a variance of .02. Sat up straight the first time, and slouched the second. [image: screen shot 2015-10-13 at 12 09 45 pm] https://cloud.githubusercontent.com/assets/6240904/10465374/6e0402bc-71a3-11e5-9dd2-13f9f0604ef5.png
— Reply to this email directly or view it on GitHub https://github.com/pyskell/slouchy/issues/1#issuecomment-147817734.
Sorry... 0.015... On Oct 13, 2015 3:26 PM, "Anthony Lusardi" ajlusardi@gmail.com wrote:
Looks like it's working alright for you now. Just need to tweak the variance so it's a little more sensitive for you. Maybe 0.15 or so.
That part is more up to the user because everyone has a different point they'd consider slouching.
One last question. I see an Exception was thrown at the end. Do you have the full text of it and know if anything you did (such as Ctrl+C) caused it? Or did it just happen while the program was running? On Oct 13, 2015 3:10 PM, "David Rynearson" notifications@github.com wrote:
Tested, here's the output. Used a variance of .02. Sat up straight the first time, and slouched the second. [image: screen shot 2015-10-13 at 12 09 45 pm] https://cloud.githubusercontent.com/assets/6240904/10465374/6e0402bc-71a3-11e5-9dd2-13f9f0604ef5.png
— Reply to this email directly or view it on GitHub https://github.com/pyskell/slouchy/issues/1#issuecomment-147817734.
Makes sense, :). Will tweak the variance.
There's the screenshot of the exception. With Terminal/Macbook if I use Ctrl+Z to close the app down (Ctrl+C doesn't work in this case like it might in linux :)). Sometimes the program doesn't quit cleanly and I have to grab a process ID and kill -9 it.
So instead an icon appears in the top corner of the macbook, and I just quit the app from there.
@pyskell This could help with face detection possibly. https://developers.google.com/vision/
When I hit setup I get:
I checked FaceTime to see what's up and half of my face is in shadow from the window next to me. I quit it and relauched, this time facing the window and still got the same error. Looks like face detection needs some work.