HumanML3D icon indicating copy to clipboard operation
HumanML3D copied to clipboard

Motion Representation

Open blairstar opened this issue 2 years ago • 1 comments

hello! thanks for your great job! I have some question about motion represention!

  1. 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

  2. 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_

blairstar avatar Apr 07 '23 13:04 blairstar

Hi,

  1. 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.
  2. 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.

EricGuo5513 avatar Apr 08 '23 16:04 EricGuo5513