HuangJunJie2017 / UDP-Pose

Official code of The Devil is in the Details: Delving into Unbiased Data Processing for Human Pose Estimation
Apache License 2.0
307 stars 54 forks source link

why need norm = np.ones((pred.shape[0], 2)) * np.array([h, w]) / 10 in accuracy #29

Closed azuryl closed 3 years ago

azuryl commented 3 years ago

Dear JunJie

in https://github.com/HuangJunJie2017/UDP-Pose/blob/d742edd0142b87886d287e56315328f9639d508c/deep-high-resolution-net.pytorch/lib/core/evaluate.py#L55 norm = np.ones((pred.shape[0], 2)) * np.array([h, w]) / 10 I did know why use norm and why need /10 and in https://github.com/HuangJunJie2017/UDP-Pose/blob/d742edd0142b87886d287e56315328f9639d508c/deep-high-resolution-net.pytorch/lib/core/evaluate.py#L16 and why normed_preds = preds[n, c, :] / normalize[n] normed_targets = target[n, c, :] / normalize[n]

when I print the output preds[n, c, :] and target[n, c, :] are very different such as[ 27,30] and [4,8]

Thank you

HuangJunJie2017 commented 3 years ago

@azuryl emm, i think the accuracy is meaningless. So i haven't paid attention on this function. You can question this in the origin hrnet repo.

azuryl commented 3 years ago

Dear JunJie thank your reply

in https://github.com/HuangJunJie2017/UDP-Pose/blob/d742edd0142b87886d287e56315328f9639d508c/deep-high-resolution-net.pytorch/lib/core/function.py#L185

lif config.MODEL.TARGETTYPE == 'offset': , avg_acc, cnt, pred = accuracy(output.cpu().numpy()[:, ::3, :, :], target.cpu().numpy()[:, ::3,:, :]) you used this function. I do not know why

Thank you

HuangJunJie2017 commented 3 years ago

@azuryl i just imitate the source hrnet repo to add this for preventing the error.

azuryl commented 3 years ago

ok I see thank :)