forked from open-mmlab/mmskeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
31 lines (23 loc) · 791 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
#!/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'] = import_class('processor.demo.Demo')
#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()