forked from yejin109/DSL_VC
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
55 lines (40 loc) · 1.45 KB
/
main.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
54
55
import os
import argparse
from tqdm import tqdm
import env
from utils.data_handler import DataHandler
from utils.metric import export_all
parser = argparse.ArgumentParser(
prog='SmartVC',
description='What the program does')
parser.add_argument("--is_sample", type=bool, default=False)
parser.add_argument('--export_table', type=bool, default=False)
parser.add_argument('--correct_line_x', type=bool, default=False)
parser.add_argument('--correct_line_y', type=bool, default=False)
parser.add_argument('--log_all', type=bool, default=False)
args = parser.parse_args()
def main():
for i in tqdm(range(len(handler.data))):
try:
handler.sample_id = i
# Run iVT Filter
handler.run_ivt()
# Run Line Allocation
handler.run_alloc()
except (IndexError, ValueError) as err:
handler.data[i].RawFixationList = None
handler.data[i].correctedFixationList = None
print(f"{i}/{len(handler.data)} data err :", err)
if args.export_table:
df = export_all(handler)
df.to_excel('data/result.xlsx')
print(df.head(10))
# Phase-2 : Metric(TBD)
# Mission 3: Metric
if __name__ == '__main__':
env.CORRECT_X = args.correct_line_x
env.CORRECT_Y = args.correct_line_y
env.LOG_ALL = args.log_all
path_root = os.getcwd()
handler = DataHandler(path_root, is_sample=args.is_sample)
main()