| 126 | |
| 127 | @staticmethod |
| 128 | def from_humanapi_meta(meta): |
| 129 | pose_meta = AAPoseMeta() |
| 130 | width, height = meta["width"], meta["height"] |
| 131 | pose_meta.width = width |
| 132 | pose_meta.height = height |
| 133 | pose_meta.kps_body = meta["keypoints_body"][:, :2] * (width, height) |
| 134 | pose_meta.kps_body_p = meta["keypoints_body"][:, 2] |
| 135 | pose_meta.kps_lhand = meta["keypoints_left_hand"][:, :2] * (width, height) |
| 136 | pose_meta.kps_lhand_p = meta["keypoints_left_hand"][:, 2] |
| 137 | pose_meta.kps_rhand = meta["keypoints_right_hand"][:, :2] * (width, height) |
| 138 | pose_meta.kps_rhand_p = meta["keypoints_right_hand"][:, 2] |
| 139 | if "keypoints_face" in meta: |
| 140 | pose_meta.kps_face = meta["keypoints_face"][:, :2] * (width, height) |
| 141 | pose_meta.kps_face_p = meta["keypoints_face"][:, 2] |
| 142 | return pose_meta |
| 143 | |
| 144 | def load_from_meta(self, meta, norm_body=True, norm_hand=False): |
| 145 | self.image_id = meta.get("image_id", "00000.png") |