加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.py 961 Bytes
一键复制 编辑 原始数据 按行查看 历史
sjyan 提交于 2019-08-06 20:42 . fix
#!/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()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化