MCPcopy Create free account
hub / github.com/MotrixLab/FineMoGen / recover_from_ric

Function recover_from_ric

mogen/utils/plot_utils.py:91–104  ·  view source on GitHub ↗
(data, joints_num)

Source from the content-addressed store, hash-verified

89
90
91def recover_from_ric(data, joints_num):
92 r_rot_quat, r_pos = recover_root_rot_pos(data)
93 positions = data[..., 4:(joints_num - 1) * 3 + 4]
94 positions = positions.view(positions.shape[:-1] + (-1, 3))
95 '''Add Y-axis rotation to local joints'''
96 rot = qinv(r_rot_quat[..., None, :]).expand(positions.shape[:-1] + (4, ))
97 positions = qrot(rot, positions)
98 '''Add root XZ to joints'''
99 positions[..., 0] += r_pos[..., 0:1]
100 positions[..., 2] += r_pos[..., 2:3]
101 '''Concate root and joints'''
102 positions = torch.cat([r_pos.unsqueeze(-2), positions], dim=-2)
103
104 return positions
105
106
107def plot_3d_motion(save_path,

Callers 1

plot_t2mFunction · 0.90

Calls 3

recover_root_rot_posFunction · 0.85
qinvFunction · 0.70
qrotFunction · 0.70

Tested by

no test coverage detected