-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathannotations_stats.py
More file actions
executable file
·34 lines (23 loc) · 929 Bytes
/
Copy pathannotations_stats.py
File metadata and controls
executable file
·34 lines (23 loc) · 929 Bytes
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
#!/usr/bin/env python
"""
Print statistics on the given annotation file.
"""
if __name__ == "__main__":
import argparse
import datetime
import realtime_annotate
parser = argparse.ArgumentParser()
parser.add_argument("file_path", help="Annotation file path.")
args = parser.parse_args()
all_events = realtime_annotate.Annotations(args.file_path).all_event_data
print("Number of events:", len(all_events))
num_annotations = 0
total_time = realtime_annotate.Time()
for event_data in all_events.values():
if event_data:
num_annotations += len(event_data)
total_time += event_data[-1].time - event_data[0].time
print("Number of annotations:", num_annotations)
print("Num. annovations/event:", num_annotations/len(all_events))
print("Total annotation time (H:M:S):", total_time)
print("Time/event:", total_time/len(all_events))