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

Converting the rest pose to A pose & SMPL-X support #10

Open
jiaxilv opened this issue Mar 17, 2024 · 2 comments
Open

Converting the rest pose to A pose & SMPL-X support #10

jiaxilv opened this issue Mar 17, 2024 · 2 comments

Comments

@jiaxilv
Copy link

jiaxilv commented Mar 17, 2024

Hi! Your script has been immensely helpful for my work. I have two questions:

  1. How can I convert the rest pose from the default T pose to an A pose? (I need to perform this operation in bulk.)
  2. Have you considered adding SMPL-X support to the existing script? Even just including hand gestures would be a great addition.

Thank you for your work!

@KosukeFukazawa
Copy link
Owner

Hi jiaxilv,
I'm sorry for the late reply.

  1. How can I convert the rest pose from the default T pose to an A pose? (I need to perform this operation in bulk.)

If you want to change to A-pose, it is necessary to change joint positions of the rest pose and change joint rotations accordingly.

First, we need to create A-pose rotations before create the rest pose(87 line on smpl2bvh.py)

A_pose = torch.zeros((1, 72), dtype=torch.float32)
A_pose[:, 3 * 16 + 2] = -torch.pi / 3
A_pose[:, 3 * 17 + 2] =  torch.pi / 3
A_pose_quat = quat.from_scaled_angle_axis(
    A_pose.numpy().reshape(1, 24, 3)
)

Then, create the rest pose as A-pose (89~91 lines)

rest = model(
    # betas = torch.randn([1, num_betas], dtype=torch.float32)
    body_pose=A_pose[:, 3:]
)

After that, you need to add A-pose inverse rotations to rotations on your data, it will fix the change of the rest pose. (123 line)

rots = quat.inv_mul(A_pose_quat, rots)

I haven't tested it, but perhaps this will work!

  1. Have you considered adding SMPL-X support to the existing script? Even just including hand gestures would be a great addition.

I added SMPL+H support on my another repo(https://github.com/KosukeFukazawa/CharacterAnimationTools), but I don't maintain for a long time.
SMPL-X uses face joints, which can be quite complex to define in a hierarchical structure like bvh.

If you face some problem, feel free to contact me again.

@iamthephd
Copy link

Hi, I have joint locations from SMPLX model of shape [N, 144, 3]. I understand that creating hierarchical structure for face is difficult, but is there a way to convert first 55 bones to BVH?

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