Xinyu-Yi / PNP

A real-time human motion capture system based on 6 IMUs, upgrading PIP through the incorporation of non-inertial forces
https://xinyu-yi.github.io/PNP/
GNU General Public License v3.0
93 stars 13 forks source link

Use Pose, Trans Estimation with SMPLX Python Module #4

Open deckerjulian opened 2 months ago

deckerjulian commented 2 months ago

Dear all,

I attempted to integrate the translation and pose estimation output from the Network to be used with the SMPLX Python Module (https://github.com/vchoutas/smplx). However, whenever the model turns direction, it behaves strangely, and the model appears upside down. I suspect this might be an issue related to the coordinate frame.

For example:

smplx_model = smplx.create(
    r"SMPL_FEMALE.pkl", 
    betas=self.betas, 
    model_type='smpl', 
    create_global_orient=True, 
    gender='female', 
    ext='pkl'
)

body_pose = torch.unsqueeze(torch.tensor(pose[3:]), 0)
global_orient = torch.unsqueeze(torch.tensor(pose[:3]), 0)  # Use the hip as the global orientation?
# Translation is not needed at the moment

output = smplx_model.forward(body_pose=body_pose, global_orient=global_orient)

i also tried to get the pose from:

self.model.forward_kinematics(
                    torch.unsqueeze(self.pose, 0),
                    tran=torch.unsqueeze(self.trans, 0),
                    calc_mesh=True,
                )
            )

but no success.

Is there a specific transformation or reference frame issue I might be overlooking?

Thank you very much!