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

Difficulty detecting faces #1

Open
granteagon opened this issue Oct 12, 2015 · 21 comments
Open

Difficulty detecting faces #1

granteagon opened this issue Oct 12, 2015 · 21 comments

Comments

@granteagon
Copy link

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.

@pyskell
Copy link
Owner

pyskell commented Oct 12, 2015

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" [email protected] 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
#1.

@pyskell pyskell self-assigned this Oct 12, 2015
@pyskell pyskell changed the title Install fails on configparser Difficulty detecting faces Oct 12, 2015
@13rac1
Copy link

13rac1 commented Oct 13, 2015

Same as above, but it seems like a hardware inter_face_ 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

@13rac1
Copy link

13rac1 commented Oct 13, 2015

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.

@psihonavt
Copy link

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" (lolcommits/lolcommits#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!

@pyskell
Copy link
Owner

pyskell commented Oct 13, 2015

Thank you all for the input and feedback.

There are two possible issues here:

  1. Your system did not have the necessary cascade file. I have adjusted the config to use the local copy. Please repull and test without making a change.
  2. If you're still having issues in a well and evenly lit area then please try adjusting camera_delay in slouchy.ini and let me know if that fixes the issue.

@Outridair
Copy link

Working on Mac OSX, setting the Camera deley to 15 did it for me :)

@granteagon
Copy link
Author

@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.

@Outridair
Copy link

@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?)

@pyskell
Copy link
Owner

pyskell commented Oct 13, 2015

@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.

@Outridair
Copy link

screen shot 2015-10-13 at 9 22 18 am Here's the debug i'm currently getting, and this is the initial setup when I execute the program.

@Outridair
Copy link

And then actual slouching after setup
screen shot 2015-10-13 at 9 23 39 am

@pyskell
Copy link
Owner

pyskell commented Oct 13, 2015

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.

@granteagon
Copy link
Author

@The-Outrider that was it.. Weird. I cloned yesterday. I just deleted the repo and re-cloned and it worked! Awesome.

@Outridair
Copy link

Oh and that data is after upping the variance to .1 (forgot to mention I did as you requested ;))

@pyskell
Copy link
Owner

pyskell commented Oct 13, 2015

OK cool, btw a temporary fix right now is probably setting the variance to about 4.5

@pyskell
Copy link
Owner

pyskell commented Oct 13, 2015

@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.

@Outridair
Copy link

Tested, here's the output. Used a variance of .02. Sat up straight the first time, and slouched the second.
screen shot 2015-10-13 at 12 09 45 pm

@pyskell
Copy link
Owner

pyskell commented Oct 13, 2015

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" [email protected] 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
#1 (comment).

@pyskell
Copy link
Owner

pyskell commented Oct 13, 2015

Sorry... 0.015...
On Oct 13, 2015 3:26 PM, "Anthony Lusardi" [email protected] 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" [email protected]
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
#1 (comment).

@Outridair
Copy link

Makes sense, :). Will tweak the variance.

screen shot 2015-10-13 at 1 10 34 pm

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.

screen shot 2015-10-13 at 1 13 17 pm

@granteagon
Copy link
Author

@pyskell This could help with face detection possibly. https://developers.google.com/vision/

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

No branches or pull requests

5 participants