Open zhuhaozh opened 4 years ago
Hi, 1) kp2gaussian(gaussian2kp(x)) != x, is this is what are you asking? This is the case because, gaussian2kp produce unormalized heatmaps. E.g. The heatmaps that does not sum to one, while kp2gaussian requires maps like this. Why do you need to invert it? 2) This operation is called soft-argmax, and it computes the weighted mean of the coordinate grid. More formally heatmap defines a probability distribution over the image coordinates, and we compute the mean coordinate given this probability distribution. 3) Do you have a pytorch landmark detector? In that case follow these steps:
If you don't have acces to the architecrure of detector or it is complicated, you can do the following:
Put the keypoints in the out dict under the key 'kp'.
Hi, Thanks for your interesting work! I have some questions about the kp2gaussian and gaussian2kp in keypoint_detector.py
To calculate the mean of heatmap, why apply "sum" function on it?
mean = (heatmap * grid).sum(dim=(3, 4))
If I have use pretrained landmark detector, for example, facial landmark detector, how should I modify the code?