-
Notifications
You must be signed in to change notification settings - Fork 9
/
main.py
28 lines (25 loc) · 834 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
import argparse
from configs.config_utils import CONFIG
def parse_args():
'''PARAMETERS'''
parser = argparse.ArgumentParser('Refer-it-in-RGBD training')
parser.add_argument('--config', type=str, default='config/pretrian_config.yaml',
help='configure file for training or testing.')
parser.add_argument('--mode', type=str, default='train', help='train, test or demo.')
return parser.parse_args()
if __name__=="__main__":
args=parse_args()
cfg=CONFIG(args.config)
cfg.update_config(args.__dict__)
cfg.log_string('Loading configuration')
cfg.log_string(cfg.config)
cfg.write_config()
'''
Run
'''
if cfg.config['mode']=='train':
import train
train.run(cfg)
elif cfg.config['mode']=='test':
import test
test.run(cfg)