| 221 | return eval_result |
| 222 | |
| 223 | def print_eval_result(self, eval_result): |
| 224 | print('======EHF======') |
| 225 | print('PA MPVPE (All): %.2f mm' % np.mean(eval_result['pa_mpvpe_all'])) |
| 226 | print('PA MPVPE (L-Hands): %.2f mm' % |
| 227 | np.mean(eval_result['pa_mpvpe_l_hand'])) |
| 228 | print('PA MPVPE (R-Hands): %.2f mm' % |
| 229 | np.mean(eval_result['pa_mpvpe_r_hand'])) |
| 230 | print('PA MPVPE (Hands): %.2f mm' % |
| 231 | np.mean(eval_result['pa_mpvpe_hand'])) |
| 232 | print('PA MPVPE (Face): %.2f mm' % |
| 233 | np.mean(eval_result['pa_mpvpe_face'])) |
| 234 | print() |
| 235 | |
| 236 | print('MPVPE (All): %.2f mm' % np.mean(eval_result['mpvpe_all'])) |
| 237 | print('MPVPE (L-Hands): %.2f mm' % |
| 238 | np.mean(eval_result['mpvpe_l_hand'])) |
| 239 | print('MPVPE (R-Hands): %.2f mm' % |
| 240 | np.mean(eval_result['mpvpe_r_hand'])) |
| 241 | print('MPVPE (Hands): %.2f mm' % np.mean(eval_result['mpvpe_hand'])) |
| 242 | print('MPVPE (Face): %.2f mm' % np.mean(eval_result['mpvpe_face'])) |
| 243 | print() |
| 244 | |
| 245 | print('PA MPJPE (Body): %.2f mm' % |
| 246 | np.mean(eval_result['pa_mpjpe_body'])) |
| 247 | print('PA MPJPE (L-Hands): %.2f mm' % |
| 248 | np.mean(eval_result['pa_mpjpe_l_hand'])) |
| 249 | print('PA MPJPE (R-Hands): %.2f mm' % |
| 250 | np.mean(eval_result['pa_mpjpe_r_hand'])) |
| 251 | print('PA MPJPE (Hands): %.2f mm' % |
| 252 | np.mean(eval_result['pa_mpjpe_hand'])) |
| 253 | out_file = osp.join(cfg.result_dir,'ehf_test.txt') |
| 254 | if os.path.exists(out_file): |
| 255 | f = open(out_file, 'a+') |
| 256 | else: |
| 257 | f = open(out_file, 'w', encoding="utf-8") |
| 258 | |
| 259 | f.write('\n') |
| 260 | f.write(f'{cfg.exp_name}\n') |
| 261 | f.write(f'EHF dataset: \n') |
| 262 | f.write('PA MPVPE (All): %.2f mm\n' % |
| 263 | np.mean(eval_result['pa_mpvpe_all'])) |
| 264 | f.write('PA MPVPE (L-Hands): %.2f mm\n' % |
| 265 | np.mean(eval_result['pa_mpvpe_l_hand'])) |
| 266 | f.write('PA MPVPE (R-Hands): %.2f mm\n' % |
| 267 | np.mean(eval_result['pa_mpvpe_r_hand'])) |
| 268 | f.write('PA MPVPE (Hands): %.2f mm\n' % |
| 269 | np.mean(eval_result['pa_mpvpe_hand'])) |
| 270 | f.write('PA MPVPE (Face): %.2f mm\n' % |
| 271 | np.mean(eval_result['pa_mpvpe_face'])) |
| 272 | f.write('MPVPE (All): %.2f mm\n' % np.mean(eval_result['mpvpe_all'])) |
| 273 | f.write('MPVPE (L-Hands): %.2f mm\n' % |
| 274 | np.mean(eval_result['mpvpe_l_hand'])) |
| 275 | f.write('MPVPE (R-Hands): %.2f mm\n' % |
| 276 | np.mean(eval_result['mpvpe_r_hand'])) |
| 277 | f.write('MPVPE (Hands): %.2f mm\n' % np.mean(eval_result['mpvpe_hand'])) |
| 278 | f.write('MPVPE (Face): %.2f mm\n' % np.mean(eval_result['mpvpe_face'])) |
| 279 | f.write('PA MPJPE (Body): %.2f mm\n' % |
| 280 | np.mean(eval_result['pa_mpjpe_body'])) |