patrikhuber / superviseddescent

C++11 implementation of the supervised descent optimisation method
http://patrikhuber.github.io/superviseddescent/
Apache License 2.0
402 stars 188 forks source link

Inter-eye Distance Normalization #56

Closed ericBiagiotti closed 6 years ago

ericBiagiotti commented 6 years ago

Hi Patrik,

I am currently trying to train a model for detecting facial profiles using the CFPW dataset (www.cfpw.io). If I understand correctly, you are using the inter-eye distance to derive the patch size based on the scale of the face, as opposed to image resolution or just the face detection bounding box. In my case, where I do not have the IED, I am not sure which landmarks would be best to use. I understand that the distance should grow and shrink consistently with the scale of the face, but does the distance matter in-terms of the overall size of the head. For example, in the image attached, should I favor using the distance between landmarks 28-32 or something larger like 21-11.

Thanks for your time and all that you have provided to the open-source community!

cfp_right_30_numbered

patrikhuber commented 6 years ago

Hi Eric,

Thanks for your interest, and very interesting what you're doing.

Yes, that's correct. If all your images are profile faces, you could just use (from the picture you posted) the landmarks 11 and 21 or so instead of the IED. If you've got all sorts of poses, you could use the maximum of the IED and this distance. Alternatively you can also just define your own distance-normalisation function, it's very easy to do and plug in. See here https://github.com/patrikhuber/superviseddescent/blob/dddd03335f8cc5e649277ec6e9baa3dfa296e5ac/include/rcr/model.hpp#L84 for how the IED normalisation is implemented, and then you could just use the bounding box to compute the normalisation instead, or even just always return a constant value of 1.0 if you don't want any normalisation.

Hope that helps.

ericBiagiotti commented 6 years ago

That helps a lot. Thanks so much for your quick reply! I'll be trying to incorporate profile landmarks into EOS at some point to try and capture more facial details. Hopefully, I can post some results if I am successful.

Best, Eric

patrikhuber commented 6 years ago

Cool! I'll close this then.