nghorbani / amass

Data preparation and loader for AMASS
https://amass.is.tue.mpg.de/
Other
654 stars 87 forks source link

Usage of "root_orient" and "trans" #9

Open glisca opened 4 years ago

glisca commented 4 years ago

Hi there,

I try to use the root_orient[1] and trans[2] fields in order to position and orient the SMPL model relative to the global reference frame.

When I instantiate the SMPL model with the following code:

# pose_id goes along frames stored in "./ACCAD/Male2Walking_c3d/B17 -  Walk to hop to walk_poses.npz"

root_orient = torch.Tensor(smpl_poses['poses'][pose_id:pose_id+1, :3]).to(computing_device) # controls the global root orientation
pose_body =   torch.Tensor(smpl_poses['poses'][pose_id:pose_id+1, 3:66]).to(computing_device) # controls the body
pose_hand =   torch.Tensor(smpl_poses['poses'][pose_id:pose_id+1, 66:]).to(computing_device) # controls the finger articulation
betas =       torch.Tensor(smpl_poses['betas'][:10][np.newaxis]).to(computing_device) # controls the body shape
dmpls =       torch.Tensor(smpl_poses['dmpls'][pose_id:pose_id+1]).to(computing_device) # controls soft tissue dynamics
root_trans =  torch.Tensor(smpl_poses['trans'][pose_id]).to(computing_device) # controls the global root orientation

smpl_in_pose_id = smpl_model(
    pose_body=pose_body, pose_hand=pose_hand,
    betas=betas, dmpls=dmpls,
    root_trans=root_trans, root_orient=root_orient)

and plot the trajectories of SMPL vertices with indexes 412 (head) and 3021 (pelvis) then I get this plot: title_

When I instantiate the SMPL model with the following code:

# pose_id goes along frames stored in "./ACCAD/Male2Walking_c3d/B17 -  Walk to hop to walk_poses.npz"

root_orient = torch.Tensor(smpl_poses['poses'][pose_id:pose_id+1, :3]).to(computing_device) # controls the global root orientation
pose_body =   torch.Tensor(smpl_poses['poses'][pose_id:pose_id+1, 3:66]).to(computing_device) # controls the body
pose_hand =   torch.Tensor(smpl_poses['poses'][pose_id:pose_id+1, 66:]).to(computing_device) # controls the finger articulation
betas =       torch.Tensor(smpl_poses['betas'][:10][np.newaxis]).to(computing_device) # controls the body shape
dmpls =       torch.Tensor(smpl_poses['dmpls'][pose_id:pose_id+1]).to(computing_device) # controls soft tissue dynamics
root_trans =  torch.Tensor(smpl_poses['trans'][pose_id]).to(computing_device) # controls the global root orientation

smpl_in_pose_id = smpl_model(
    pose_body=pose_body, betas=betas)

then manually assemble the transformation matrix from root_trans vector and root_orient rotation matrix, apply it to the same SMPL vertices with indexes 412 (head) and 3021 (pelvis) and plot their trajectories then I get this plot: Screenshot from 2020-02-05 18-57-46

Could you please help me to correctly use the values stored in:

Thank you very much!

kind regards,

[1] root_orient [2] trans

yizhouzhao commented 3 years ago

I am kind of confused either. But I have found some clues:

  1. smpl_poses['poses'][pose_id:pose_id+1, :3] stores the joint information

https://meshcapade.wiki/SMPL#smpl-x

  1. smpl_poses['trans'][] stores the global position of the body at one frame.
Coondinator commented 1 year ago

I have also encountered this issue when I try to tracking the root transform in Blender. The real rendering result is always has a such offset comparing to the 'trans' term. Have you solved it?