Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage of "root_orient" and "trans" #9

Open
glisca opened this issue Feb 5, 2020 · 2 comments
Open

Usage of "root_orient" and "trans" #9

glisca opened this issue Feb 5, 2020 · 2 comments

Comments

@glisca
Copy link

glisca commented Feb 5, 2020

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:

  • smpl_poses['poses'][pose_id:pose_id+1, :3] and
  • smpl_poses['trans'][pose_id] ?

Thank you very much!

kind regards,

[1] root_orient
[2] trans

@yizhouzhao
Copy link

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'][<frame_idx>] stores the global position of the body at one frame.

@Coondinator
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants