(smpl_params, joints, set_floor=False)
| 166 | return smpl_params |
| 167 | |
| 168 | def canonicalize_motion(smpl_params, joints, set_floor=False): |
| 169 | # Get transformation and update smpl_params |
| 170 | R_inv = get_transform_DART(joints) |
| 171 | aligned_smpl_params = apply_rotation(smpl_params, R_inv) |
| 172 | joints_base = torch.matmul(R_inv[None, None, :, :], joints.unsqueeze(-1)).squeeze(-1) |
| 173 | |
| 174 | delta_transl = -joints_base[0, 0:1] # fetch the pelvis joint from first frame, Shape: (1,3) |
| 175 | if set_floor: |
| 176 | # For gravity axis (Z), set the minimum z-coordinate to 0 as the floor |
| 177 | delta_transl[0, 2] = - torch.min(joints_base[..., 2]) |
| 178 | joints = joints_base + delta_transl[None,] |
| 179 | aligned_smpl_params['transl'] += delta_transl |
| 180 | |
| 181 | # Convert to motion representation |
| 182 | motion = collect_motion_rep_DART(aligned_smpl_params, joints) # 276-dim representation |
| 183 | |
| 184 | return motion, joints[:-1], R_inv, delta_transl |
| 185 | |
| 186 | def process_hmr_motion(hmr_motion, intrinsic, to_cpu=True, set_floor=False): |
| 187 | new_data = {} |
no test coverage detected