HybrIK
HybrIK copied to clipboard
how to obtain pose and shape from the hybrik output
Thanks for your codes. I try to extract shape and pose for SMPL modeling. From your code, "pose_output" contains some parameters. How should I process it to extract pose and shape? I tried with "pose_output.shape" and "pose_output.xyz_jts_24" but it did not work.
You can get the output params by key names like this, pose_output.pred_shape
Thanks for the comment. I wonder if I am using it correctly. I try to use the following code to transfer rot_mat to pose as pred_pose = output.rot_mats.float().reshape(-1, 4) pred_pose = quat_to_rotmat(pred_pose) pred_pose, _, _ = rotmat_to_aa(pred_pose)
But using this pose and output.shape does not give me the correct SMPL body. Is there anything wrong?
hello,i meet the same question,did you sloved it? how do i obtaion pose ooutput?
@Holmes-Alan have you solved it ? i have the same question.
@Holmes-Alan This seems to have worked for me - you might have to make sure that the w
of the quaternion is in the expected position. As far as I can tell, HybrIK assumes the quaternion layout to be [w, x, y z]
. If you're using scipy for the conversion, you have to move the w
to the end:
from scipy.spatial.transform import Rotation as R
hybrik_poses_quat = pose_output.pred_theta_mats.reshape((batch_size, -1, 4)).detach().cpu().numpy()
hybrik_poses_quat = hybrik_poses_quat[..., [1, 2, 3, 0]]
hybrik_poses = R.as_rotvec(R.from_quat(hybrik_poses_quat.reshape((-1, 4)))).reshape((batch_size, -1))
@kaufManu , i test it , you are right
@kaufManu , i test it , you are right
hi,i test with the code ,but i got the shape of hybrik_poses which is (1,162) How to use the hybrik_pose to the SMPL_model?