1adrianb / face-alignment

:fire: 2D and 3D Face alignment library build using pytorch
https://www.adrianbulat.com
BSD 3-Clause "New" or "Revised" License
7.05k stars 1.34k forks source link

How can you get a confidence value out of the heatmaps? #152

Closed analogously closed 5 years ago

analogously commented 5 years ago

Hi! I believe you can obtain a confidence value for the keypoints out of the heatmap value, but the inner code for heatmaps in get_preds_fromhm is dark, and I can't find any good explanation on how this works, might someone please explain? Thank you, Ana

1adrianb commented 5 years ago

Hi @analogously, Typically the confidence corresponds to the value of the peak. get_preds_fromhm simple takes the location at the max, applies some heuristics to improve the accuracy and maps the points back to the image space. If you also want the confidence you can simply return also the value of the max.

analogously commented 5 years ago

Thank you! What a fast answer! I didn't know how the heatmap tensor was structured but I didn't need to know it because you already obtained the max. Keep up all that cool research :) Ana