stefanopini / simple-HRNet

Multi-person Human Pose Estimation with HRNet in Pytorch
GNU General Public License v3.0
573 stars 106 forks source link

[Request] Converting coco keypoints to open pose body keypoints ? #68

Open basicvisual opened 4 years ago

basicvisual commented 4 years ago

Hi i was wondering if there is a possibility to convert the COCO keypoints to Open Pose Body 18 keypoints. It seems the openpose key points have 18 keypoints with a different order ? If there is a possibility to convert them , it could be useful as many other applications take openpose keypoints as input rather than coco keypoints.

What are your views?

stefanopini commented 4 years ago

Hi! I'm sorry for the late reply.

I've checked and OpenPose, in the 19-keypoint version (i.e. without additional keypoints for feet), provides the same keypoints of COCO plus an additional mid hip joint. Moreover, HRNet has been trained on COCO without the neck joint. Thus, there are two missing joints in the output of HRNet, but they can be computed as the mean point between the right and the left hip and the right and the left shoulder.

You can check

Bottom line, it seems doable and should be easy. I've added this into the To Do list 🙂

yfedberts commented 3 years ago

@stefanopini Hi, appreciate the work you've done here! I've got a question about having it plot 18 keypoints, wondering if you've had any luck in adding it or have an insight as to a good place to start and modify the code?

Thanks in advance!

stefanopini commented 3 years ago

Hi @Mystickal , sorry for the late reply.

Unfortunately, I haven't found the time to work on this yet.

In SimpleHRNet.py, you will have access to all the keypoints after these two for loops, so you can create an extended version of pts with the additional keypoints and compute them. Then, you can add a new joint type in the joints_dict you find in visualization.py and use it when calling the drawing functions (e.g. here).

Let me know if this is enough to start modifying the code! I'll try to work on this change within the next few weekends.