MarilynKeller / SMPL2AddBiomechanics

Enable inputting a SMPL sequence into AddBiomechanics to fit an OpenSim skeleton model to the sequence.
Other
71 stars 3 forks source link

Joint centers from OpenSim vs. from SMPL regressor #6

Open davidpagnon opened 3 months ago

davidpagnon commented 3 months ago

Hi Marilyn,

I wonder if you have any perspective which of the following two approaches would be better for obtaining joint centers from an SMPL mesh:

If you think the second one is a good solution, do you know how I can use it to obtain joint centers from SMPL vertices?

Thanks!

davidpagnon commented 3 months ago

Might be related to this issue (not entirely sure about it): https://github.com/MarilynKeller/SKEL/issues/7

MarilynKeller commented 3 months ago

Hi David,

Definitely the second option is the most straightforward. From the bioamass dataset , we indeed trained a regressor that given the posed smpl vertices, predicts the opensim skeleton joints location.

I have been meaning to add a demo of this but did not find the time so far.

Here is how it works: https://github.com/MarilynKeller/SKEL/blob/af881e69f6d818f5e077c301777d0db73bb6fbdf/skel/skel_model.py#L301

skel_model = SKEL(gender)
J = torch.einsum('bik,ji->bjk', [v_shaped, skel_model.J_regressor_osim])

Where v_shaped are the posed SMPL mesh vertices sequence (Fx6080) and J (Fx24x3) are the regressed 24 anatomical joint location that correspond to the OpenSim model. F is the number of frames of the sequence.

davidpagnon commented 3 months ago

Thanks, I can't right now but I'll check this in about 2 weeks!