developer0hye/onepose

how to plot the skeleton having the top of head?

Closed this issue · 5 comments

I see you having a visualization of the skeleton going from the top to the neck, how to have this?
Thank you.

Hello, @leolle520

Try to run the below code.

import cv2
import onepose
img = cv2.imread("sample.png")
keypoints = onepose.create_model('ViTPose_huge_mpii').to("cuda")(img)
onepose.visualize_keypoints(img, keypoints, model.keypoint_info, model.skeleton_info)
cv2.imshow('img', img)
cv2.waitKey(0)

@leolle520

There is an error in code. Try this code

import cv2
import onepose
from google.colab.patches import cv2_imshow

if __name__ == '__main__':
    img = cv2.imread('sample.png')
    model = onepose.create_model('ViTPose_huge_mpii')

    keypoints = model(img)
    onepose.visualize_keypoints(img, keypoints, model.keypoint_info, model.skeleton_info)
    cv2.imshow('img', img)
    cv2.waitKey(0)

https://colab.research.google.com/drive/17nmWymCYlFQM59qAoyF03YbSUZC_0g1S?usp=sharing

image

Thank you Kwon.
The specific ViTPose_huge_mpii solve my problem.
I have another question: Is it able to do the human instance segmentation with the ViTPose model?

@leolle520
It's hard to use it as an instance segmentation model but if you use both it and segment anything of meta, you may get results that you want.