xingyizhou / CenterNet

Object detection, 3D detection, and pose estimation using center point detection:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Evaluation for specific keypoints for Pose estimation: for example only head, ears, and so on[SOLVED]

Dipankar1997161 opened this issue · comments

Hello @xingyizhou ,

I used my own dataset which consists of 13 keypoints ( eyes, ears are excluded)
I checked the coco_hp.py and it has 17 key points. I made the necessary changes in every file, however, the flip_idx is giving me error as it is not able to reshape into 13 keypoints during EVALUATION.
Error states: Required tensor shape 13, loaded 17

So is it possible to test only the desired number of keypoints ( not all 17 ) or do I have to retrain the model om.13 keypoints first to match the Tensor shape??

I hope to hear from you or your team @xingyizhou

I recently solved this and evaluated only the 13 key points leaving behind the eyes and the ears as per my application.

Just open the cocoeval.py under pycocotools, then head over to the computeOKS function, there you will encounter 2 sets of keypoints, ground truth keypoints, and detection keypoints as a NumPy array. Make sure to do proper slicing for that 51 array size python lists.

For example: if you wish to only check the mAP for nose, the slicing would be as follows:

g= np.array(gt['keypoints'][0:3])

Similarly, do it for dt array.

Also, set the sigma values of those unwanted key points to 0. You are all set!

Enjoy :)