Closed He-Chao closed 1 year ago
HI He-Chao, Not sure if this addresses your question: [https://github.com/Jeff-sjtu/HybrIK/issues/92#issuecomment-1285203410]
Can you do that is it possible to suggest me how to do?
@srn-source if you want to get the joint positions you can run the smpl model forward() with parameters from the pose_output
of hybrik's output:
from pytorch3d import transforms
import smplx
aa = transforms.matrix_to_axis_angle(pose_output.pred_theta_mats.reshape(-1, 3, 3))
global_orient = aa[:3].unsqueeze(0)
body_pose = aa[3:].unsqueeze(0)
model_n = smplx.create("<path to smpl models>", model_type="smpl", gender="neutral")
output_n = model_n(betas=pose_output.pred_shape.detach().cpu(), global_orient=global_orient.detach().cpu(), body_pose=body_pose.detach().cpu(), transl=pose_output.transl.detach().cpu())
joints = output_n.joints[0, :24, :]
joints = joints.detach().cpu().numpy()
joints
are the 3d positions of the 24 joints and then you can use whatever visualization tool you like to draw them. I don't know why though the reconstructed smpl body doesn't align with the pose_output.pred_vertices
positions (with pose_output.transl
applied), but since it's a fixed offset it's probably no big deal just in terms of getting joint positions.
I want to visualize smpl joints like this But when I use pose_output.pred_xyz_jts_24_struct, it's not right When I use pose_output.pred_xyz_jts_24_struct as SMPL input pose, I get result T-pose Input image is Can someone help me?