vchoutas / smplify-x

Expressive Body Capture: 3D Hands, Face, and Body from a Single Image
https://smpl-x.is.tue.mpg.de/
Other
1.73k stars 335 forks source link

AttributeError: 'L2Prior' object has no attribute 'get_mean' #132

Open nicholas-kondal opened 3 years ago

nicholas-kondal commented 3 years ago

I'm trying to set my own global orientation and body pose for the SMPL model, which requires create_body_pose to be True in main.py: https://github.com/vchoutas/smplify-x/blob/a7876f03aa086c1fa010941a91482d7cb240e7d9/smplifyx/main.py#L102-L105

So I set use_vposer to False and created a 1 x 3 torch tensor for the global orientation and a 1 x 69 torch tensor for my desired orientation and pose, which are then fed into the SMPLX package to create the initial models with no issues. However, in fit_single_frame.py, the following line runs if use_vposer is set to False and creates an attribute error (AttributeError: 'L2Prior' object has no attribute 'get_mean'): https://github.com/vchoutas/smplify-x/blob/a7876f03aa086c1fa010941a91482d7cb240e7d9/smplifyx/fit_single_frame.py#L192-L196

Upon further investigation of the error, the get_mean() method is not implemented in the L2Prior object in prior.py: https://github.com/vchoutas/smplify-x/blob/a7876f03aa086c1fa010941a91482d7cb240e7d9/smplifyx/prior.py#L92-L97

Is the get_mean() method implemented elsewhere that I could put into the L2Prior object or how could I implement this myself?

I'm using Python 3.6.12 and Torch 1.1.0 to run SMPLify-X in Windows 10 and have generated 2D keypoints using OpenPose. Please let me know if there's anything else I should add or clarify as this is the first issue I've ever created, thank you.

AlyanQ commented 2 years ago

Hi, @nickykay98 , Did you solve this issue? I'm trying to use my own pose params and am getting the same error. Thanks.

nicholas-kondal commented 2 years ago

Hi @AlyanQ, apologies for the very late reply, I'm afraid I wasn't able to solve this issue and it's been a long time so I'm unable to find a proper solution sorry 😅 Perhaps the VPoser repo may help in creating a prior that SMPLify-X accepts: https://github.com/nghorbani/human_body_prior/search?q=mean

sparshgarg23 commented 2 years ago

In SMPL paper,pose prior is defined as max mixture,the get_mean is implemented in that.