-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmain.py
35 lines (23 loc) · 1.02 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
import argparse
import sys, os
from utils.torchlight import import_class
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Processor collection')
processors = dict()
# Trian the ActFormer generator or generate fake samples with the trained ActFormer
processors['generator'] = import_class('processor.generator.GEN_Processor')
# Train the action recognition model for evaluation
processors['recognition'] = import_class('processor.recognition.REC_Processor')
# Evaluate synthetic samples with the trained action recognition model
processors['evaluator'] = import_class('processor.evaluator.Score_Processor')
# add sub-parser
subparsers = parser.add_subparsers(dest='processor')
for k, p in processors.items():
subparsers.add_parser(k, parents=[p.get_parser()])
# read arguments
arg = parser.parse_args()
# start
Processor = processors[arg.processor]
p = Processor(sys.argv[2:])
os.makedirs(p.arg.work_dir, exist_ok=True)
p.start()