This repository has been archived by the owner on Feb 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgen_csv.py
53 lines (48 loc) · 1.62 KB
/
gen_csv.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import pandas as pd
from utilis import read_json
from utilis.package import *
def main():
run_fn = "../run"
dataset = []
Miou = []
seq_len = []
Recall = []
AP = []
Recall_time = []
mAP = []
Accuracy = []
Accuracy1 = []
Accuracy0 = []
for root, dirs, files in os.walk(run_fn, topdown=False):
for name in files:
if name == "log.json":
print("...found {}".format(osp.join(root, name)))
log_fn = osp.join(root, name)
log_dict = read_json(osp.join(log_fn))
dataset.append(log_dict['cfg']['dataset'])
seq_len.append(log_dict['cfg']['seq_len'])
AP.append(log_dict['final']['AP'])
mAP.append(log_dict['final']['mAP'])
Accuracy.append(log_dict['final']['Accuracy'])
Accuracy1.append(log_dict['final']['Accuracy1'])
Accuracy0.append(log_dict['final']['Accuracy0'])
Miou.append(log_dict['final']['Miou'])
Recall.append(log_dict['final']['Recall'])
Recall_time.append(log_dict['final']['Recall_time'])
df = pd.DataFrame({
'dataset': dataset,
'seq_len': seq_len,
'AP': AP,
'mAP': mAP,
'Miou': Miou,
'Recall': Recall,
'Recall_time': Recall_time,
'Accuracy': Accuracy,
'Accuracy1': Accuracy1,
'Accuracy0': Accuracy0
})
csv_save_path = osp.join(run_fn, 'all.csv')
df.to_csv(csv_save_path)
print("...all results are saved into {}".format(csv_save_path))
if __name__ == '__main__':
main()