From 0808a4d29107ebcca2724b135728c1aa72022b77 Mon Sep 17 00:00:00 2001 From: zimmermc Date: Tue, 14 Jan 2020 09:47:03 +0100 Subject: [PATCH] Added PCK curve dump --- eval.py | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/eval.py b/eval.py index bfe9227..92c7563 100644 --- a/eval.py +++ b/eval.py @@ -325,16 +325,31 @@ def main(gt_path, pred_path, output_dir, pred_file_name=None, set_name=None): fo.write('%s\n' % t) print('Scores written to: %s' % score_path) + # scale to cm + thresh_xyz *= 100.0 + thresh_xyz_al *= 100.0 + thresh_mesh *= 100.0 + thresh_mesh_al *= 100.0 + createHTML( output_dir, [ - curve(thresh_xyz*100, pck_xyz, 'Distance in cm', 'Percentage of correct keypoints', 'PCK curve for aligned keypoint error'), - curve(thresh_xyz_al*100, pck_xyz_al, 'Distance in cm', 'Percentage of correct keypoints', 'PCK curve for aligned keypoint error'), - curve(thresh_mesh*100, pck_mesh, 'Distance in cm', 'Percentage of correct vertices', 'PCV curve for mesh error'), - curve(thresh_mesh_al*100, pck_mesh_al, 'Distance in cm', 'Percentage of correct vertices', 'PCV curve for aligned mesh error') + curve(thresh_xyz, pck_xyz, 'Distance in cm', 'Percentage of correct keypoints', 'PCK curve for keypoint error'), + curve(thresh_xyz_al, pck_xyz_al, 'Distance in cm', 'Percentage of correct keypoints', 'PCK curve for aligned keypoint error'), + curve(thresh_mesh, pck_mesh, 'Distance in cm', 'Percentage of correct vertices', 'PCV curve for mesh error'), + curve(thresh_mesh_al, pck_mesh_al, 'Distance in cm', 'Percentage of correct vertices', 'PCV curve for aligned mesh error') ] ) + pck_curve_data = { + 'xyz': [thresh_xyz.tolist(), pck_xyz.tolist()], + 'xyz_al': [thresh_xyz_al.tolist(), pck_xyz_al.tolist()], + 'mesh': [thresh_mesh.tolist(), pck_mesh.tolist()], + 'mesh_al': [thresh_mesh_al.tolist(), pck_mesh_al.tolist()], + } + with open('pck_data.json', 'w') as fo: + json.dump(pck_curve_data, fo) + print('Evaluation complete.')