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

How to apply SMPL model (24 3Dkeypoints) not AMASS (22 3Dkeypoints) ? #13

Open
dongran opened this issue Apr 20, 2024 · 0 comments
Open

Comments

@dongran
Copy link

dongran commented Apr 20, 2024

Thank you for providing a great tool for calculating IK!

Can I apply the SMPL model?

Because the demo was only for AMASS model 3Dkeypoints.

I have tried the following mapping, but it does not work.

Did you already provide a method to apply SMPL model in the code?

`SMPL_JOINT_NAMES = [
"pelvis",
"left_hip",
"right_hip",
"spine1",
"left_knee",
"right_knee",
"spine2",
"left_ankle",
"right_ankle",
"spine3",
"left_foot",
"right_foot",
"neck",
"left_collar",
"right_collar",
"head",
"left_shoulder",
"right_shoulder",
"left_elbow",
"right_elbow",
"left_wrist",
"right_wrist",
"left_hand",
"right_hand",
]

#According to SMPL keypoints3d method
#################################################
smpl = None
smpl = SMPL(model_path=args.smpl_dir, gender='MALE', batch_size=1)
keypoints3d = smpl.forward(
global_orient=torch.from_numpy(smpl_poses[:, 0:1]).float(),
body_pose=torch.from_numpy(smpl_poses[:, 1:]).float(),
transl=torch.from_numpy(smpl_trans / smpl_scaling).float(),
).joints.detach().numpy()[:, 0:24, :]
nframes = keypoints3d.shape[0]
dances.append(keypoints3d.reshape(nframes, -1).tolist())
print(np.shape(dances[-1])) # (nframes, 72)
################################################

AMASS_JOINT_NAMES = [
"pelvis",
"left_hip",
"left_knee",
"left_ankle",
"left_foot",
"right_hip",
"right_knee",
"right_ankle",
"right_foot",
"left_shoulder",
"left_elbow",
"left_wrist",
"right_shoulder",
"right_elbow",
"right_wrist",
"spine1",
"spine2",
"spine3",
"neck",
"head",
"left_collar",
"right_collar",
]

#According to Amass keypoints3d provided in the config.py

`

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

1 participant