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

Doesn't detect faces in most images - matlab code does #20

Open
sivavenkatay opened this issue Apr 13, 2013 · 17 comments
Open

Doesn't detect faces in most images - matlab code does #20

sivavenkatay opened this issue Apr 13, 2013 · 17 comments

Comments

@sivavenkatay
Copy link

I am testing this with a bunch of images with the Face_small_146filters.xml but am getting poor results.

However, the same images work well with the original matlab code at http://www.ics.uci.edu/~xzhu/face/ (face_p146_small.mat). I am not sure if the difference is in the models or the implementation.

Has anyone encountered this before?

Sample test: http://www.pwc.com/us/en/careers/campus/assets/img/homepage/hero-people.jpg

@sivavenkatay
Copy link
Author

I tried compiling with cvmatio to read the original model (face_p146_small.mat) and it fails to read because the model doesn't contain fields "biasid" for the components.

I am guessing the original matlab implementation at http://www.ics.uci.edu/~xzhu/face/ and the C++ version are not equivalent in performance.

As is, with the provided xml models, the detection is rate is very low and not usable. Am I missing something or the C++ demo, as is, hasn't even been tested with some images?

@ankitsingh
Copy link

@sivavenkatay I am having the same problem. Did you figure out the solution?

@adtadhikari
Copy link

I am having the same problem. Anyone able to get the solution?

@ankitsingh
Copy link

@adtadhikari The issue seems to be with the threshold values. I don't know the reason as to why same threshold values are behaving differently in the matlab code and the c++ code (after having compared both codes line by line to find no difference). However, for now, try changing the thresholds in the xml files to a large negative value (something like -5.9 ).
Let me know if it works or if you find something more "intelligent" to do.

@adtadhikari
Copy link

Ok thanks. I will try.

@adtadhikari
Copy link

Still it doesn't work for me. Did changing the threshold value gave you the same result?

@ankitsingh
Copy link

What is the threshold value and the xml file you are using? Try experimenting with the threshold eg. give a ridiculously large negative value (like -100), see if it works. Change it to -10, and similarly change threshold values based on your observation.
@hbristow can you shed some light on this, based on your observation, as to why are the same thresholds not working similarly in the matlab and the c++ code?

@adtadhikari
Copy link

I tried giving large negative values but it does not seem to affect the output.The threshold value does not seem to affect the output strange. I am using the Person_26parts model.

@adtadhikari
Copy link

The threshold didn't affect my output but when I change the interval it did. So may me adjusting the interval will help?Not sure as how it changes but still.

@ankitsingh
Copy link

oh. I assumed you are using the face detection. For me person_26parts was
working as is.

On Wed, Oct 16, 2013 at 2:20 PM, adtadhikari [email protected]:

The threshold didn't affect my output but when I change the interval it
did. So may me adjusting the interval will help?Not sure as how it changes
but still.


Reply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-26401819
.

Regards,
Ankit Singh

@adtadhikari
Copy link

You didn't had to change anything to run the person_26parts is it? Can you send me a sample image for which it works for you?

@ankitsingh
Copy link

hi @adtadhikari, please take the discussion to my email id. Let us not flood the comment section.

@keithzhou
Copy link

hi @ankitsingh @AASanchezA and @hbristow, Sorry to bother you guys on this old issue. I am wondering if PartsBasedDetector is equivalent to Zhu's algorithm after modelTransfer ? (i.e do they give the same results? ignoring rounding errors etc)

@ankitsingh
Copy link

Hi,
I am not sure if i understood you correctly, but if you are talking about
http://www.ics.uci.edu/~xzhu/face/ and the corresponding matlab code, I
have found two differences:

  1. Using the same threshold in the trained models, they don't work
    similarly. However, after playing around with the thresholds, you can get
    almost the same result as the matlab code for face detection.
  2. The memory management in the matlab code is way better than here, so you
    might need a 16GB machine to run this code on a sufficiently large machine.

On Thu, Nov 21, 2013 at 10:31 AM, keithzhou [email protected]:

hi @ankitsingh https://github.com/ankitsingh and @hbristowhttps://github.com/hbristow,
Sorry to bother you guys on this old issue. I am wondering is
PartsBasedDetector equivalent to Zhu's algorithm after modelTransfer ? (i.e
do they give the same results? ignoring rounding errors etc)


Reply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-28958331
.

Regards,
Ankit Singh

@keithzhou
Copy link

Thank you @ankitsingh ! yes, that is my question.

So I guess there is currently no known direct port of of the matlab code at "http://www.ics.uci.edu/~xzhu/face/ " to c++ implementation?

@dmaniry
Copy link

dmaniry commented Apr 11, 2014

The demo of the matlab version contains the following lines:

% set up the threshold
model.thresh = min(-0.65, model.thresh);

demo.cpp in this implementation does not change the threshold.
the original threshold in the model files Face_small_146filters.xml and face_p146_small.mat is 0.99543047
I think the authors didn't care too much about the threshold in the models because they were making precision-recall-curves anyway and they chose -0.65 as a sane value for the demo. It does indeed work fine with the image provided in the top post.

@gopi1989
Copy link

Any one of you executed this code successfully in C++.

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

6 participants