SMPL pose parameters
melih-unsal opened this issue · 1 comments
Hi @akashsengupta1997 great congrats on your paper. When I have investigated your code I have found the pose parameter shape is (1,144) while standard SMPL has (1,72). Where are these extra 72 coming from? I need to render the SMPL with your parameters but the standard one waits for 72 for the pose. Can I get 72 pose parameters or are they irrelevant to each other?
Thanks.
Hi sorry for the super late reply!
The standard SMPL model takes 72 pose parameters since they represent the rotations of 24 joints in axis-angle format i.e. each 3D rotation is represented by 3 numbers.
We instead use the 6 dimensional rotation representation proposed here: https://arxiv.org/abs/1812.07035, because it is a continuous representation of rotations (unlike axis-angle which is periodic and discontinuous) and makes training much easier. Thus there are 6 x 24 = 144 pose parameters.
6D rot representation can be converted to a usual 3x3 rotation matrix using:
def rot6d_to_rotmat(x):
"""Convert 6D rotation representation to 3x3 rotation matrix.
Based on Zhou et al., "On the Continuity of Rotation Representations in Neural Networks", CVPR 2019
Input:
(B,6) Batch of 6-D rotation representations
Output:
(B,3,3) Batch of corresponding rotation matrices
"""
x = x.view(-1,3,2)
a1 = x[:, :, 0]
a2 = x[:, :, 1]
b1 = F.normalize(a1) # Ensuring columns are unit vectors
b2 = F.normalize(a2 - torch.einsum('bi,bi->b', b1, a2).unsqueeze(-1) * b1) # Ensuring column 1 and column 2 are orthogonal
b3 = torch.cross(b1, b2)
return torch.stack((b1, b2, b3), dim=-1)
Then a 3x3 rotation matrix can be converted into axis-angle vector using cv2.Rodrigues().