File size: 1,057 Bytes
be2715b |
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 39 40 41 42 43 |
import yaml
from munch import munchify
import argparse
def load_config(path):
with open(path, 'r') as file:
cfg = yaml.load(file, Loader=yaml.FullLoader)
return munchify(cfg)
def parse_config():
parser = argparse.ArgumentParser(allow_abbrev=True)
parser.add_argument(
'-config',
type=str,
default='./configs/default.yaml',
help='Path to the config file.'
)
parser.add_argument(
'-overwrite',
action='store_true',
default=False,
help='Overwrite file in the save path.'
)
parser.add_argument(
'-lvm_encoder',
'--lvm_med_encoder_path',
type=str,
default='',
help='Path to LVM Med encoder arch'
)
parser.add_argument(
'-print_config',
action='store_true',
default=False,
help='Print details of configs.'
)
parser.add_argument(
'-test',
'--use_test_mode',
action='store_true',
help='')
args = parser.parse_args()
return args |