MCPcopy Index your code
hub / github.com/MotrixLab/MotionDiffuse / recover_from_ric

Function recover_from_ric

text2motion/utils/motion_process.py:401–416  ·  view source on GitHub ↗
(data, joints_num)

Source from the content-addressed store, hash-verified

399
400
401def recover_from_ric(data, joints_num):
402 r_rot_quat, r_pos = recover_root_rot_pos(data)
403 positions = data[..., 4:(joints_num - 1) * 3 + 4]
404 positions = positions.view(positions.shape[:-1] + (-1, 3))
405
406 '''Add Y-axis rotation to local joints'''
407 positions = qrot(qinv(r_rot_quat[..., None, :]).expand(positions.shape[:-1] + (4,)), positions)
408
409 '''Add root XZ to joints'''
410 positions[..., 0] += r_pos[..., 0:1]
411 positions[..., 2] += r_pos[..., 2:3]
412
413 '''Concate root and joints'''
414 positions = torch.cat([r_pos.unsqueeze(-2), positions], dim=-2)
415
416 return positions
417'''
418For Text2Motion Dataset
419'''

Callers 2

plot_t2mFunction · 0.90
motion_process.pyFile · 0.85

Calls 3

recover_root_rot_posFunction · 0.85
qrotFunction · 0.85
qinvFunction · 0.85

Tested by

no test coverage detected