rmbashirov / rgbd-kinect-pose

Demo for "Real-time RGBD-based Extended Body Pose Estimation" paper
MIT License
185 stars 22 forks source link

Conversion to SMPL from SMPLX #6

Closed MoyGcc closed 3 years ago

MoyGcc commented 3 years ago

Hi Renat,

I was trying to obtain the SMPLX parameters and convert them to an SMPL mesh. The only difference is that I lose the hand pose information and thus I just set the last 6 axis angle parameters in the SMPL body pose as zero. But it turns out there is a consistent shift along the y-axis. I attached the SMPL and SMPLX point cloud in this drive link https://drive.google.com/drive/folders/1JsmK6dNOJfsDImfuqyESp5sQdwilKhGU?usp=sharing.

I extract the intermediate results by inserting the following code in the file aggregate.py before visualization and run the standard SMPL model forward function to get the SMPL vertices. BTW, I disabled the prediction for hand and face pose, but I don't think that can result in my current issue. This seems to relate to the global translation. But it should not differ between SMPL and SMPLX. Do you maybe have any idea why this happened? Many thanks in advance!

          smpl_dict['body_pose'] = x['body_pose']
          smpl_dict['global_rot'] = x['global_rot']
          smpl_dict['global_trans'] = x['global_trans']
          smpl_dict['smplx_verts'] = vertices.detach().cpu().numpy().squeeze()
          import pickle as pkl
          pkl.dump(smpl_dict, open('extract_from_raw.pkl', 'wb'))
rmbashirov commented 3 years ago

I have compared plys and seen the y-axis shift. Don't have ideas for now.

What about infering those params using SMPL-X?

MoyGcc commented 3 years ago

I just tried out using SMPL-X with the estimated parameters. The result is identical to what u have used for visualization. Maybe there is something different between SMPL and SMPL-X forward functions. But I did not observe anything yet... And BTW., you have shown the gif demo for SMPL prediction. Have u considered releasing that part? Then the users might don't need to do the manual conversion in case other body models are required in the use case.

MoyGcc commented 3 years ago

I just found the reason... The hip position (starting position for the kinematic chain) in both models is different which causes the y-axis shift. This can be manually corrected by adding the difference of hip positions into the global translation argument.

rmbashirov commented 3 years ago

The gif demo in readme.md uses SMPL-X.

Even if you run both models with all params set to 0 and align them for identical pelvis, you'll still have misaligned meshes. This is because of different templates. Shape space is also different in smpl and smpls. This all means angles are not comparable as well. For closest mapping possible you can use https://github.com/vchoutas/smplx/tree/master/transfer_model, but it's not realtime because it's optimization based.

MoyGcc commented 3 years ago

Thank you for the follow-up.

I also tried the transfer_model method provided by MPI. Yeah, it consumes really a lot of time. Instead, I just naively use the SMPLX parameters and disregarded the hand poses and indeed, the misalignments are acceptable to some extent. Just a way to provide a rough initialization for further applications.

Many thanks again!

Screenshot from 2021-09-03 16-28-50