forked from yysijie/st-gcn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
33 lines (25 loc) · 961 Bytes
/
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
#!/usr/bin/env python
import argparse
import sys
# torchlight
import torchlight
from torchlight import import_class
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Processor collection')
# region register processor yapf: disable
processors = dict()
processors['recognition'] = import_class('processor.recognition.REC_Processor')
processors['demo_old'] = import_class('processor.demo_old.Demo')
processors['demo'] = import_class('processor.demo_realtime.DemoRealtime')
processors['demo_offline'] = import_class('processor.demo_offline.DemoOffline')
#endregion yapf: enable
# 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:])
p.start()