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 336 forks source link

Some confusions about SMPLifyAnglePrior #76

Closed sulei1998 closed 4 years ago

sulei1998 commented 4 years ago

Sorry to bother you! But I feel a little confused about the SMPLifyAnglePrior. In the code,

        # Indices for the roration angle of 
        # 55: left elbow,  90deg bend at -np.pi/2 
        # 58: right elbow, 90deg bend at np.pi/2 
        # 12: left knee,   90deg bend at np.pi/2 
        # 15: right knee,  90deg bend at np.pi/2 
        angle_prior_idxs = np.array([55, 58, 12, 15], dtype=np.int64)
        angle_prior_idxs = torch.tensor(angle_prior_idxs, dtype=torch.long)
        self.register_buffer('angle_prior_idxs', angle_prior_idxs)

        angle_prior_signs = np.array([1, -1, -1, -1],
                                     dtype=np.float32 if dtype == torch.float32
                                     else np.float64)
        angle_prior_signs = torch.tensor(angle_prior_signs,
                                         dtype=dtype)

I feel confused about the angle_prior_signs. I want to know why they are [1, -1, -1, -1]. Maybe they have something to do with angle?I want to know if I modify the angle, should i change the angle_prior_signs?Looking forward to hearing from you!

vchoutas commented 4 years ago

I would suggest posing the model with the rotations in the comments to help you get a feeling of the signs. You basically want to avoid bending in weird directions, which are described by the sign.