HumanML3D
HumanML3D copied to clipboard
Motion Representation
hello! thanks for your great job! I have some question about motion represention!
-
In Common/Skeleton.py:forward_kinematics_np(), why do specially change first frame's root_quat , that would make root rotation discontinuous.
'''Get Root Rotation''' target = np.array([[0,0,1]]).repeat(len(forward), axis=0) root_quat = qbetween_np(forward, target) '''Inverse Kinematics''' quat_params = np.zeros(joints.shape[:-1] + (4,)) root_quat[0] = np.array([[1.0, 0.0, 0.0, 0.0]]) quat_params[:, 0] = root_quat
-
In get_rifke(): what it means "All pose face Z+"? In inverse_kinematics(), root rot is calculated by basis of np.array([[0, 1, 0]]), which directions to Y+.
_def get_rifke(r_rot, positions):
'''Local pose'''
positions[..., 0] -= positions[:, 0:1, 0]
positions[..., 2] -= positions[:, 0:1, 2]
'''All pose face Z+'''
positions = qrot_np(np.repeat(r_rot[:, None], positions.shape[1], axis=1), positions)
return positions_
Hi,
- Thanks for letting us know. This may be a bug. In our projects, we assume all motions passed to inverse_kinematics has been processed that the initial pose faces Z+, which is not, however, during retargeting. I have corrected this.
- We are using Y+ to calculate the forward directions, forward_init = np.cross(np.array([[0, 1, 0]]), across, axis=-1), instead use it as the forward direction. And then we get the root rotations between forward direction and Z+, target = np.array([[0, 0, 1]]). In get_rifke, we wanna get the local pose positions without global rotations. Therefore, we try to get rid of global rotations.