(data, joints_num)
| 399 | |
| 400 | |
| 401 | def 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 | ''' |
| 418 | For Text2Motion Dataset |
| 419 | ''' |
no test coverage detected