cocodataset / cocoapi

COCO API - Dataset @ http://cocodataset.org/
Other
6.08k stars 3.75k forks source link

Why is the OKS calculation code like this? #447

Open yshrkume opened 4 years ago

yshrkume commented 4 years ago

The page states that the formula for OKS is given as follows

OKS = Σi[exp(-di^2 / (2 * s^2 * ki^2))δ(vi>0)] / Σi[δ(vi>0)]

https://cocodataset.org/#keypoints-eval

However, if we look at the following code, it can be interpreted as doing the following calculation...

OKS = Σi[exp(-di^2 / (8 * s * ki^2))δ(vi>0)] / Σi[δ(vi>0)]

https://github.com/cocodataset/cocoapi/blob/master/PythonAPI/pycocotools/cocoeval.py#L205-L233

tucachmo2202 commented 3 years ago

Hi, s is square root of object segment area, in cocoeval.py they use gt['area'] = s^2