Skip to content

Commit 0808a4d

Browse files
author
zimmermc
committed
Added PCK curve dump
1 parent ea9545e commit 0808a4d

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

eval.py

+19-4
Original file line numberDiff line numberDiff line change
@@ -325,16 +325,31 @@ def main(gt_path, pred_path, output_dir, pred_file_name=None, set_name=None):
325325
fo.write('%s\n' % t)
326326
print('Scores written to: %s' % score_path)
327327

328+
# scale to cm
329+
thresh_xyz *= 100.0
330+
thresh_xyz_al *= 100.0
331+
thresh_mesh *= 100.0
332+
thresh_mesh_al *= 100.0
333+
328334
createHTML(
329335
output_dir,
330336
[
331-
curve(thresh_xyz*100, pck_xyz, 'Distance in cm', 'Percentage of correct keypoints', 'PCK curve for aligned keypoint error'),
332-
curve(thresh_xyz_al*100, pck_xyz_al, 'Distance in cm', 'Percentage of correct keypoints', 'PCK curve for aligned keypoint error'),
333-
curve(thresh_mesh*100, pck_mesh, 'Distance in cm', 'Percentage of correct vertices', 'PCV curve for mesh error'),
334-
curve(thresh_mesh_al*100, pck_mesh_al, 'Distance in cm', 'Percentage of correct vertices', 'PCV curve for aligned mesh error')
337+
curve(thresh_xyz, pck_xyz, 'Distance in cm', 'Percentage of correct keypoints', 'PCK curve for keypoint error'),
338+
curve(thresh_xyz_al, pck_xyz_al, 'Distance in cm', 'Percentage of correct keypoints', 'PCK curve for aligned keypoint error'),
339+
curve(thresh_mesh, pck_mesh, 'Distance in cm', 'Percentage of correct vertices', 'PCV curve for mesh error'),
340+
curve(thresh_mesh_al, pck_mesh_al, 'Distance in cm', 'Percentage of correct vertices', 'PCV curve for aligned mesh error')
335341
]
336342
)
337343

344+
pck_curve_data = {
345+
'xyz': [thresh_xyz.tolist(), pck_xyz.tolist()],
346+
'xyz_al': [thresh_xyz_al.tolist(), pck_xyz_al.tolist()],
347+
'mesh': [thresh_mesh.tolist(), pck_mesh.tolist()],
348+
'mesh_al': [thresh_mesh_al.tolist(), pck_mesh_al.tolist()],
349+
}
350+
with open('pck_data.json', 'w') as fo:
351+
json.dump(pck_curve_data, fo)
352+
338353
print('Evaluation complete.')
339354

340355

0 commit comments

Comments
 (0)