mmhuman3d icon indicating copy to clipboard operation
mmhuman3d copied to clipboard

physical meaning of SMPL output

Open zhewei-mt opened this issue 2 years ago • 13 comments

Hello, The output of smpl pose parameter is a matrix of shape 24*3, what is the corresponding meaning of all 24 joints and what is the meaning of the 3D vector of each joint? I know the 3D vector represents rotation angle but have no idea of what rotation angle it respects to. Any help will be appreciate!

zhewei-mt avatar Sep 26 '22 02:09 zhewei-mt

The first 3 elements of the pose parameters mean the global orientation and the other 69 elements are the joint rotation relative to their parent joints. Both of them are represented in an axis angle. For more details, you can refer to here and here. I hope this answer can help you.

ttxskk avatar Sep 26 '22 08:09 ttxskk

The first 3 elements of the pose parameters mean the global orientation and the other 69 elements are the joint rotation relative to their parent joints. Both of them are represented in an axis angle. For more details, you can refer to here and here. I hope this answer can help you.

Thank you for reply! I notice that the range of "axis angle" is between -1 and 1, is that a normalized version? like -90 to 90 but scaled by 90?

zhewei-mt avatar Sep 28 '22 06:09 zhewei-mt

Hi @zhewei-mt, That's a good question, I guess the axis angle hasn't been normalized from here

    angle = torch.norm(rot_vecs + 1e-8, dim=1, keepdim=True)
    rot_dir = rot_vecs / angle

, where the angle isn't multiplied by a scale.

ttxskk avatar Sep 28 '22 07:09 ttxskk

Hi @zhewei-mt, That's a good question, I guess the axis angle hasn't been normalized from here

    angle = torch.norm(rot_vecs + 1e-8, dim=1, keepdim=True)
    rot_dir = rot_vecs / angle

, where the angle isn't multiplied by a scale.

Then why the angle is so small. -1 to 1 degree is not visually obvious. Or it doesn't represent degree?

zhewei-mt avatar Sep 28 '22 07:09 zhewei-mt

Hi @zhewei-mt , Can you give an example?

ttxskk avatar Sep 28 '22 08:09 ttxskk

You can refer here, where we rectify upside down people in h36m by applying a global rotation ([np.pi, 0, 0]).

ttxskk avatar Sep 28 '22 08:09 ttxskk

You can refer here, where we rectify upside down people in h36m by applying a global rotation ([np.pi, 0, 0]).

For example, from my understanding, the output of L_Hip = (0.5, 0.5, 0.5). Does it mean that hip should do a 0.5 degree rotation along X(pitch)Y(yaw)Z(roll) axis with respect to pelvis? If so, how can notice that the body moves since there is only a 0.5 degree rotation?

zhewei-mt avatar Sep 28 '22 09:09 zhewei-mt

You can refer here, where we rectify upside down people in h36m by applying a global rotation ([np.pi, 0, 0]).

For example, from my understanding, the output of L_Hip = (0.5, 0.5, 0.5). Does it mean that hip should do a 0.5 degree rotation along X(pitch)Y(yaw)Z(roll) axis with respect to pelvis? If so, how can notice that the body moves since there is only a 0.5 degree rotation?

Well, I think you're confusing Euler-angle with axis-angle. Please refer to the above codes, where the angle is torch.norm(rot_vecs + 1e-8, dim=1, keepdim=True) and axis is rot_vecs / angle. In axis-angle representation, the angle describes the magnitude of the rotation about the axis. If the pose parameters are too small, it means the corresponding pose is similar to the T-pose. I recommend you visualize the SMPL body with your pose parameters first, and then you can change them and visualize the SMPL body again. You may find the difference between the two pose parameters.

ttxskk avatar Sep 28 '22 11:09 ttxskk

You can refer here, where we rectify upside down people in h36m by applying a global rotation ([np.pi, 0, 0]).

For example, from my understanding, the output of L_Hip = (0.5, 0.5, 0.5). Does it mean that hip should do a 0.5 degree rotation along X(pitch)Y(yaw)Z(roll) axis with respect to pelvis? If so, how can notice that the body moves since there is only a 0.5 degree rotation?

Well, I think you're confusing Euler-angle with axis-angle. Please refer to the above codes, where the angle is torch.norm(rot_vecs + 1e-8, dim=1, keepdim=True) and axis is rot_vecs / angle. In axis-angle representation, the angle describes the magnitude of the rotation about the axis. If the pose parameters are too small, it means the corresponding pose is similar to the T-pose. I recommend you visualize the SMPL body with your pose parameters first, and then you can change them and visualize the SMPL body again. You may find the difference between the two pose parameters.

Thanks for pointing out, what I really need is Euler-angle. So I try to use "rotmat_to_ee" instead of "rotmat_to_aa" but I find something wired. Using the same detection method and same SMPL method, the calculated Euler-angle is slightly different up to 5 degrees.

zhewei-mt avatar Sep 29 '22 07:09 zhewei-mt

You can refer here, where we rectify upside down people in h36m by applying a global rotation ([np.pi, 0, 0]).

For example, from my understanding, the output of L_Hip = (0.5, 0.5, 0.5). Does it mean that hip should do a 0.5 degree rotation along X(pitch)Y(yaw)Z(roll) axis with respect to pelvis? If so, how can notice that the body moves since there is only a 0.5 degree rotation?

Well, I think you're confusing Euler-angle with axis-angle. Please refer to the above codes, where the angle is torch.norm(rot_vecs + 1e-8, dim=1, keepdim=True) and axis is rot_vecs / angle. In axis-angle representation, the angle describes the magnitude of the rotation about the axis. If the pose parameters are too small, it means the corresponding pose is similar to the T-pose. I recommend you visualize the SMPL body with your pose parameters first, and then you can change them and visualize the SMPL body again. You may find the difference between the two pose parameters.

And using "rotmat_to_ee" sometimes I get "nan" rather than a float number. I just simply substitute "rotmat_to_aa" with "rotmat_to_ee" without modifying any other code. Did I do wrong?

zhewei-mt avatar Sep 29 '22 11:09 zhewei-mt

Hi @zhewei-mt , In order to resolve your issues, I need you to provide more information as follows: Q1: Please attach the pose parameters and show the corresponding visualized result. If the pose parameters are too small, maybe the corresponding body pose is similar to the T-pose. Q2: Please attach your code.

ttxskk avatar Oct 03 '22 11:10 ttxskk

Hello @ttxskk , What I am trying to do is to drive digital characters in Unreal Engine 5 using pose parameters output by SMPL. For visualization, the original code in estimate_smpl.py is to convert rotation matrix into axis angle. But what UE5 need is the Euler-angle of each joint so I convert rotation matrix to degree based Euler-angle (see attached pictures). The output is a 24 * 3 matrix corresponding to pitch, yaw, roll of 24 joints I assume. 屏幕截图 2022-10-08 104244 When I do the verification using "pelvis" joint output in one frame, the output is "175, -54, -6.8" in degrees, and the visualized pose in UE5 is like the following: 屏幕截图 2022-10-08 105617 There must be something wrong with the procedure but I don't know where, and no matter how I change the sequence of "175, -54, -6.8", I cannot get a reasonable pose.

zhewei-mt avatar Oct 08 '22 03:10 zhewei-mt

Hi @zhewei-mt , In order to resolve your issues, I need you to provide more information as follows: Q1: Please attach the pose parameters and show the corresponding visualized result. If the pose parameters are too small, maybe the corresponding body pose is similar to the T-pose. Q2: Please attach your code.

I also did the test on one single frame. The output of the first joint 'pelvis' is "179, -4.3, 2.4" in degrees and the first frame looks like this: 00000 The pose in the picture is the front view of a person, so I believe the output joint 'pelvis' should be close to 0. Maybe this is not the right way to convert a rotation matrix to Euler-angle? Any suggestions will be appreciate!!!!

zhewei-mt avatar Oct 10 '22 10:10 zhewei-mt