how to plot the skeleton having the top of head?
Closed this issue · 5 comments
leolle520 commented
I see you having a visualization of the skeleton going from the top to the neck, how to have this?
Thank you.
developer0hye commented
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 commented
Hi Kwon,
Thank you for you replying.
I mean like the middle skeleton of image:
https://github.com/developer0hye/onepose/blob/main/onepose/assets/sample_all_vis.png
,
The method above gives the left skeleton.
Yonghye Kwon ***@***.***> 于2024年6月13日周四 21:30写道:
… Hello, @leolle520 <https://github.com/leolle520>
Try the below code.
import cv2import oneposeimg = 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)
—
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BI4UQ6HFTOKGFET6BZHVFFTZHGNGDAVCNFSM6AAAAABJF2IDCWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRVGY4DCNZRGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
developer0hye commented
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
leolle520 commented
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?
developer0hye commented
@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.