HumanML3D icon indicating copy to clipboard operation
HumanML3D copied to clipboard

question about get_rifke(positions) function?

Open li-haoran opened this issue 1 year ago • 4 comments

 def get_rifke(positions):
        '''Local pose'''
        positions[..., 0] -= positions[:, 0:1, 0]
        positions[..., 2] -= positions[:, 0:1, 2]
        '''All pose face Z+'''
        positions = qrot_np(np.repeat(r_rot[:, None], positions.shape[1], axis=1), positions)
        return positions 

This function disentangles the global rotations and local rotation/position/velocity.

I plot the pose 0 (red) and pose 10(green) before and after the function. The blue line means the facing direction. This is pose[0] and pose[10] before the function: image and this is the visulization after the function: image The function align the root center to zeros and align the facing direction to Z+, but the facing direction is not parallel the Z+ strictly for the rest poses like pose[10] except the pose[0]?

I didn't figure out why?

li-haoran avatar Oct 16 '23 12:10 li-haoran

Hi, I am also not so sure why it's not strictly z+. Is it a common or casual case?

EricGuo5513 avatar Nov 08 '23 04:11 EricGuo5513

Shouldn't the inverse of r_rot be used to obtain the local positions?

roey1rg avatar May 23 '24 07:05 roey1rg

 def get_rifke(positions):
        '''Local pose'''
        positions[..., 0] -= positions[:, 0:1, 0]
        positions[..., 2] -= positions[:, 0:1, 2]
        '''All pose face Z+'''
        positions = qrot_np(np.repeat(r_rot[:, None], positions.shape[1], axis=1), positions)
        return positions 

This function disentangles the global rotations and local rotation/position/velocity.

I plot the pose 0 (red) and pose 10(green) before and after the function. The blue line means the facing direction. This is pose[0] and pose[10] before the function: image and this is the visulization after the function: image The function align the root center to zeros and align the facing direction to Z+, but the facing direction is not parallel the Z+ strictly for the rest poses like pose[10] except the pose[0]?

I didn't figure out why?

Hi, I met the same problem. Did you get the answer?

LvXinTao avatar Jul 30 '24 03:07 LvXinTao

Hi, I get one solution to that, you can refer to #141.

LvXinTao avatar Jul 30 '24 07:07 LvXinTao