Skip to content

question about the angle representation #5

@Xiao-Fangff

Description

@Xiao-Fangff

Excellent work! Could you please clarify whether the angle representation used in motionscript is Euler angles or rotation vectors?
I noticed in get_pose_sequence_data_from_file_HumanML3D_T2M_GPT() that the angle representation is Euler angles read from the root_euler folder. However, in generate_text_HumanML3D(), the angles are converted using rotvec_to_eulerangles, which seems to indicate that the angle representation is a rotation vector?

MotionScript/src/utils.py

Lines 913 to 928 in f7075d4

FirstPerson_pred_xyz, pred_xyz, r_rot_quat, r_pos, euler_angles_from_quat = recover_from_ric((motion_tensor).float(), 22)
# pred_xyz = recover_from_ric((pred_pose * std + mean).float(), 22)
# xyz = pred_xyz.reshape(1, -1, 22, 3)
try:
euler_angles_from_file = np.load(npy_file_euler_address)
euler_angles = euler_angles_from_file.squeeze()
# euler_angles = euler_angles_from_quat
except: # for the HumanAct12 subdataset in HumanML3D which doesn't have Euler info.
euler_angles = np.zeros((pred_xyz.shape[0],3))
euler_angles[:,0] = np.pi/2
xyz = pred_xyz.reshape(pred_xyz.shape[0], -1)
FirstPerson_xyz = FirstPerson_pred_xyz.reshape(FirstPerson_pred_xyz.shape[0], -1)
return FirstPerson_xyz, xyz, euler_angles, r_pos

for frame in range(root_euler_orient.shape[0]):
# theta_x, theta_y, theta_z = root_orient[frame, [0, 1, 2]] # utils.rotvec_to_eulerangles(root_orient[frame, :].unsqueeze(0))
theta_x, theta_y, theta_z = utils.rotvec_to_eulerangles(root_rot_vec[frame, :].unsqueeze(0))
# root_orient[frame, :] = torch.cat((rad2deg(theta_x),
# rad2deg(theta_y),
# rad2deg(theta_z)))
root_euler_orient[frame, :] = torch.cat(( torch.unsqueeze(rad2deg(theta_x), 0),
torch.unsqueeze(rad2deg(theta_y), 0),
torch.unsqueeze(rad2deg(theta_z), 0))).squeeze()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions