vchoutas / smplx

SMPL-X
https://smpl-x.is.tue.mpg.de/
Other
1.81k stars 306 forks source link

from SMPL-X beta to get SMPL beta [transfer model] #190

Open XueYing126 opened 5 months ago

XueYing126 commented 5 months ago

Hi, thank you for the great work!

I saw that you mention "the SMPL and SMPL-X shape spaces are NOT compatible, since each model is the result of a different training process. " Can I ask if SMPL-X beta (use first 10) could approximate the SMPL beta (10, )? If not, what is the main reason? the first 10 PCA should be similar, right? Is the dataset that they were trained on are very different?

Is there an easier way to get smpl-beta from smplx-beta?

Thanks a lot!

LeyangWen commented 5 months ago

Hi @XueYing126

Did you find a workaround for this? I tried using the conversion code but it is way too slow, estimated to take years (four, to be exact) on my collected dataset.

Also, I am wondering how/if you converted the SMPLX body pose (21x3) to the SMPL body pose (23x3)? i.e., getting the SMPL hand joint pose from the SMPLX hand poses.

Thanks.

XueYing126 commented 5 months ago

Hi @LeyangWen

If you add ftol: 1e-10 to config_files/smplx2smpl.yaml, https://github.com/XueYing126/smplx2smpl-shape/blob/c88c67d0e52229c3a854a16cf7eed18366e58de9/config_files/smplx2smpl.yaml#L15 it will make the run time 10, or even 20 times faster. (because optimization stops before iterations stops ) This will gives you less than 2 months, and if you parallel process... maybe less than a week ;)

As far as I understand, after you run the : python -m transfer_model --exp-cfg config_files/smplx2smpl.yaml you will have the SMPL pose you need at: var_dict['body_pose']

Good luck!

LeyangWen commented 5 months ago

Thanks @XueYing126, changing the ftol works wonders. Also, I increased the batch_size to 128, which also dramatically speed things up. The default batch_size was set to 1. Now,

I randomly selected a few frames to compare the mesh outputs and they still look good after the changes.

With the changes, a GPU server, downsampling, and parallelization, the expected time is down from 4 years to ~4 days.

Thanks again :+1:

BukuBukuChagma commented 5 months ago

@XueYing126 @LeyangWen Did you guys test out the betas given by transfer model for smplx->smpl? The obj file it created seems correct, but if you use the betas and pose parameter from pkl file to recreate the mesh using smpl, the result is completely differnet body shape. Meaning the betas value are quite incorrect.

XueYing126 commented 5 months ago

@BukuBukuChagma Hi, Yes I used beta and pose to create the mesh and it seems correct. Make sure you set the gender correctly.

LeyangWen commented 5 months ago

So, using batch_size >1 would cause a minor bug in here, causing it to write the same pkl file for batch_size times. If you merge all the pkl files, you will get #*batch_size frames with a lot of redundant frames.

One quick fix is to add if ii==0: and only write the pkl once. (PR#193)