| 1235 | f.write('PA MPJPE (Hands): %.2f mm\n' % |
| 1236 | np.mean(eval_result['pa_mpjpe_hand'])) |
| 1237 | def validate_within_img_batch( |
| 1238 | self, img_wh, points): # check whether the points is within the image |
| 1239 | # img: (h, w, c), points: (num_points, 2) |
| 1240 | |
| 1241 | valid_mask = np.logical_and((points-img_wh[:,None])<0,points>0) |
| 1242 | valid_mask = np.logical_and(valid_mask[:,:,0],valid_mask[:,:,1]) |
| 1243 | |
| 1244 | return valid_mask |
| 1245 | def decompress_keypoints(self, humandata) -> None: |
| 1246 | """If a key contains 'keypoints', and f'{key}_mask' is in self.keys(), |
| 1247 | invalid zeros will be inserted to the right places and f'{key}_mask' |