| 919 | |
| 920 | |
| 921 | def print_eval_result(self, eval_result): |
| 922 | |
| 923 | print('AGORA test results are dumped at: ' + |
| 924 | osp.join(cfg.result_dir, 'predictions')) |
| 925 | |
| 926 | if self.data_split == 'test' and self.test_set == 'test': # do not print. just submit the results to the official evaluation server |
| 927 | return |
| 928 | |
| 929 | print('======AGORA-val======') |
| 930 | print('PA MPVPE (All): %.2f mm' % np.mean(eval_result['pa_mpvpe_all'])) |
| 931 | print('PA MPVPE (L-Hands): %.2f mm' % |
| 932 | np.mean(eval_result['pa_mpvpe_l_hand'])) |
| 933 | print('PA MPVPE (R-Hands): %.2f mm' % |
| 934 | np.mean(eval_result['pa_mpvpe_r_hand'])) |
| 935 | print('PA MPVPE (Hands): %.2f mm' % |
| 936 | np.mean(eval_result['pa_mpvpe_hand'])) |
| 937 | print('PA MPVPE (Face): %.2f mm' % |
| 938 | np.mean(eval_result['pa_mpvpe_face'])) |
| 939 | print() |
| 940 | |
| 941 | print('MPVPE (All): %.2f mm' % np.mean(eval_result['mpvpe_all'])) |
| 942 | print('MPVPE (L-Hands): %.2f mm' % |
| 943 | np.mean(eval_result['mpvpe_l_hand'])) |
| 944 | print('MPVPE (R-Hands): %.2f mm' % |
| 945 | np.mean(eval_result['mpvpe_r_hand'])) |
| 946 | print('MPVPE (Hands): %.2f mm' % np.mean(eval_result['mpvpe_hand'])) |
| 947 | print('MPVPE (Face): %.2f mm' % np.mean(eval_result['mpvpe_face'])) |
| 948 | |
| 949 | out_file = osp.join(cfg.result_dir,'agora_val.txt') |
| 950 | if os.path.exists(out_file): |
| 951 | f = open(out_file, 'a+') |
| 952 | else: |
| 953 | f = open(out_file, 'w', encoding="utf-8") |
| 954 | |
| 955 | f.write('\n') |
| 956 | f.write(f'{cfg.exp_name}\n') |
| 957 | f.write(f'AGORA-val dataset: \n') |
| 958 | f.write('PA MPVPE (All): %.2f mm\n' % |
| 959 | np.mean(eval_result['pa_mpvpe_all'])) |
| 960 | f.write('PA MPVPE (L-Hands): %.2f mm\n' % |
| 961 | np.mean(eval_result['pa_mpvpe_l_hand'])) |
| 962 | f.write('PA MPVPE (R-Hands): %.2f mm\n' % |
| 963 | np.mean(eval_result['pa_mpvpe_r_hand'])) |
| 964 | f.write('PA MPVPE (Hands): %.2f mm\n' % |
| 965 | np.mean(eval_result['pa_mpvpe_hand'])) |
| 966 | f.write('PA MPVPE (Face): %.2f mm\n' % |
| 967 | np.mean(eval_result['pa_mpvpe_face'])) |
| 968 | f.write('MPVPE (All): %.2f mm\n' % np.mean(eval_result['mpvpe_all'])) |
| 969 | f.write('MPVPE (L-Hands): %.2f mm\n' % |
| 970 | np.mean(eval_result['mpvpe_l_hand'])) |
| 971 | f.write('MPVPE (R-Hands): %.2f mm\n' % |
| 972 | np.mean(eval_result['mpvpe_r_hand'])) |
| 973 | f.write('MPVPE (Hands): %.2f mm\n' % np.mean(eval_result['mpvpe_hand'])) |
| 974 | f.write('MPVPE (Face): %.2f mm\n' % np.mean(eval_result['mpvpe_face'])) |