facebookresearch / facebookresearch/detectron2
Making sense of confidence score in pred_keypoints
- Dominant language
- Python
- Stars
- 34.7k
- Forks
- 7.9k
- PR merge metrics
- No merged PRs in 30d
Description
## 📚 Documentation Issue
* Provide a link to an existing documentation/comment/tutorial:
In the documentation the only thing stated about confidence score for predicted keypoints is that they're greate than zero ([source](https://detectron2.readthedocs.io/en/latest/tutorials/models.html#model-output-format)). I investigated and found that for visualization the [default threshold is 0.05](https://github.com/facebookresearch/detectron2/blob/224cd2318fdb45b5e22bbb861ee9711ee52c8b75/detectron2/utils/visualizer.py#L33), which would be rather low for a probability. So I tried to find where did this number came from, and I found a [weird code snippet](https://github.com/facebookresearch/detectron2/blob/224cd2318fdb45b5e22bbb861ee9711ee52c8b75/detectron2/structures/keypoints.py#L204-L237) where it seems that the 56x56 heatmap is upsampled to the box shape and then we do the division of the upsampled map to the sum of the 56x56 map (?). I think it's clear that the score would be 1 if and only if the heatmap was an one-hot encoding, but I was expecting some form of local maxima aggregation.
* How should the above documentation/comment/tutorial improve:
I really would like to understand the reasoning behind these operations, since I tried to simple get the argmax of the logits but it led to poor results. It would be great to add an explanation, even a comment in the code, since for some applications the interpretability of the threshold is valuable.
Thanks in advance.
Contributor guide
Assessment
This issue has not been assessed yet.