forked from jf-garamendi/VideoInp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
38 lines (29 loc) · 873 Bytes
/
main.py
File metadata and controls
38 lines (29 loc) · 873 Bytes
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
"""
Based on https://github.com/moemen95/Pytorch-Project-Template
Main
-Capture the config file
-Process the json config passed
-Create an agent instance
-Run the agent
"""
import argparse
from utils.config import process_config
from agents import *
def main():
# parse the path of the json config file
arg_parser = argparse.ArgumentParser(description="")
arg_parser.add_argument(
'config',
metavar='config_json_file',
default='None',
help='The Configuration file in json format')
args = arg_parser.parse_args()
# parse the config json file
config = process_config(args.config)
# Create the Agent and pass all the configuration to it then run it..
agent_class = globals()[config.general.agent]
agent = agent_class(config)
agent.run()
agent.finalize()
if __name__ == '__main__':
main()