wangsen1312 / joints2smpl

fit smpl parameters model using 3D joints
157 stars 10 forks source link

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

Open dongran opened 5 months ago

dongran commented 5 months ago

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

`