HowieMa / NSRMhand

[WACV 2020] "Nonparametric Structure Regularization Machine for 2D Hand Pose Estimation"
104 stars 16 forks source link

How to get 21 keypoints annotations after cropping the original image? #8

Closed zctang closed 4 years ago

zctang commented 4 years ago

Hi @HowieMa Thanks for your great work, I was confused how you get 21 keypoints annotations after cropping the original image. Manual annotation or some trick that transform annotation from the original annotation of CMU dataset? Cause I want to training for another datasets, I want to know how you preprocess the dataset. Looking forward to your reply.

HowieMa commented 4 years ago

Hi, thanks for asking, sorry for the late response. There is no tricks in the proprecessing, just an offset. In detail, for the original image in the Panoptic dataset, it has annotations for 21 keypoints in the 2D image. For example, (x0, y0).. (x20, y20). From this we can get the hand center by (mean(xi), mean(yi)), and hand size by [ max(xi) - min(xi), max(yi) - min(yi)]. Thus, with some simple calculation, you can get the coordinates of your bounding box. For example, the top-left is (X1, Y1) and the bottom-down is (X2,X2). Thus, to get the coordinate in the cropped image, you just need to (x0 - X1, y0 - Y1) ... (x20-X1, y20- Y1) ... Hope this can solve your problem, thanks!

zctang commented 4 years ago

Thank you so much, I got it.