def front_angle(self, p3, x_dim=0, y_dim=1): l_joint_index = self.joint_index(l_hip) r_joint_index = self.joint_index(r_hip) return front_angle(p3, l_joint_index, r_joint_index, x_dim=x_dim, y_dim=y_dim)
def normalized_poses(dataset, scale=True, center=True, rotate_front=True): if scale: p3s = sequences_to_rescaled_poses(dataset) else: p3s = sequences_to_poses(dataset) skeleton = skeleton_register[dataset.attrs['skeleton_id']] if center: # hips above origin r = skeleton.joint_index(skeleton.root_joint) p3s[..., :2] -= p3s[:, r:r + 1, :2] if rotate_front: # rotate hips to front phi = front_angle(p3s, skeleton) p3s = rotate_about(p3s, -np.expand_dims(phi, axis=1), dim=2) return p3s
def front_angle(self, p3, x_dim=0, y_dim=1): return front_angle(p3, l_joint_index=self.joint_index(l_hip), r_joint_index=self.joint_index(r_hip), x_dim=0, y_dim=1)