-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathh3m_report.py
39 lines (34 loc) · 1.31 KB
/
h3m_report.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""Script for reporting procrustes errors for h3m datasets."""
import h5py
from human_pose_util.dataset.h3m.report import proc_manager, \
sequence_proc_manager
from serialization import results_path
def inference_report(
inference_id, overwrite=False, use_s14=False):
"""
Print procruste errors for previously inferred sequences.
If use_s14, only the 14 joints in s14 are considered in the averages
(procruste alignment is still done on the entire skeleton).
"""
with h5py.File(results_path, 'a') as results:
results = results[inference_id]
print('Individual proc_err')
proc_manager().report(results, overwrite=overwrite)
print('----------------')
print('Sequence proc_err')
sequence_proc_manager().report(
results, overwrite=overwrite)
if __name__ == '__main__':
import argparse
from serialization import register_defaults
parser = argparse.ArgumentParser()
parser.add_argument(
'inference_id',
help='id of inference spec defined in inference_params')
parser.add_argument(
'-o', '--overwrite', action='store_true',
help='overwrite existing data if present')
args = parser.parse_args()
register_defaults()
inference_report(
args.inference_id, overwrite=args.overwrite)