(positions)
| 96 | return quat_params, r_velocity, velocity, r_rot |
| 97 | |
| 98 | def get_cont6d_params(positions): |
| 99 | skel = Skeleton(n_raw_offsets, kinematic_chain, "cpu") |
| 100 | # (seq_len, joints_num, 4) |
| 101 | quat_params = skel.inverse_kinematics_np(positions, face_joint_indx, smooth_forward=True) |
| 102 | |
| 103 | '''Quaternion to continuous 6D''' |
| 104 | cont_6d_params = quaternion_to_cont6d_np(quat_params) |
| 105 | # (seq_len, 4) |
| 106 | r_rot = quat_params[:, 0].copy() |
| 107 | # print(r_rot[0]) |
| 108 | '''Root Linear Velocity''' |
| 109 | # (seq_len - 1, 3) |
| 110 | velocity = (positions[1:, 0] - positions[:-1, 0]).copy() |
| 111 | # print(r_rot.shape, velocity.shape) |
| 112 | velocity = qrot_np(r_rot[1:], velocity) |
| 113 | '''Root Angular Velocity''' |
| 114 | # (seq_len - 1, 4) |
| 115 | r_velocity = qmul_np(r_rot[1:], qinv_np(r_rot[:-1])) |
| 116 | # (seq_len, joints_num, 4) |
| 117 | return cont_6d_params, r_velocity, velocity, r_rot |
| 118 | |
| 119 | cont_6d_params, r_velocity, velocity, r_rot = get_cont6d_params(positions) |
| 120 | positions = get_rifke(positions) |
no test coverage detected