TadasBaltrusaitis / OpenFace

OpenFace – a state-of-the art tool intended for facial landmark detection, head pose estimation, facial action unit recognition, and eye-gaze estimation.
Other
6.98k stars 1.85k forks source link

Possible Bug in DetectLandmarksInImage() #226

Closed CMoench closed 7 years ago

CMoench commented 7 years ago

Dear Tadas, I encountered a problem in LandmarkDetector::DetectLandmarksInImage(). If MultiView is enabled, the for loop in line 500 takes all parts of the hierarchical model in the first hypothesis-iteration as the best hierarchical model. That's alright. But after that, best_likelihood is compared with clnf_model.hierarchical_models[part].model_likelihood and best_likelihood is set in the if-block before. This leads to the following: If we are in the second hypothesis-iteration best_likelihood could be higher as the current clnf_model.hierarchical_models[part].model_likelihood -> The "best" hierarchical model is still the one of the first iteration. -> The CLNF-Model could consist of a model from the second iteration and a hierarchical model from the first iteration. If you have a frontal face picture, and two rotation hypothesis (0,-45°,0) and (0,0,0) we end up with something like this: grafik The landmarks and head pose are alright, but the eye gaze estimations are wrong. They seem to be based on the hierarchical_model. If I do not have the first hypothesis everything is alright.

I would fix this by removing the if in line 502 and putting the for loop of line 500 in the if-block of line 490. This would prevent having a model and a hierarchical model from two different hypothesis. What do you think?

Thanks! Christoph

TadasBaltrusaitis commented 7 years ago

Thanks for pointing this out Christoph! This is definitely an issue, I will fix it once I get a free moment.

Thanks, Tadas

TadasBaltrusaitis commented 7 years ago

The bug should be fixed now.