mmcv/utils/config.py
def auto_argparser(description=None):
        """Generate argparser from config file automatically (experimental)
        """
        partial_parser = ArgumentParser(description=description)
        partial_parser.add_argument('config', help='config file path')
        cfg_file = partial_parser.parse_known_args()[0].config
        cfg = Config.from_file(cfg_file)
        parser = ArgumentParser(description=description)
        parser.add_argument('config', help='config file path')
        add_args(parser, cfg)
        return parser, cfg
def auto_argparser(description=None):
        """Generate argparser from config file automatically (experimental)
        """
        partial_parser = ArgumentParser(description=description)
        partial_parser.add_argument('config', help='config file path')
        cfg_file = partial_parser.parse_known_args()[0].config
        cfg = Config.from_file(cfg_file)
        parser = ArgumentParser(description=description)
        parser.add_argument('config', help='config file path')
        add_args(parser, cfg)
        return parser, cfg
def auto_argparser ( description = None ) : partial_parser = ArgumentParser ( description = description ) partial_parser . add_argument ( 'config' , help = 'config file path' ) cfg_file = partial_parser . parse_known_args ( ) [ 0 ] . config cfg = Config . from_file ( cfg_file ) parser = ArgumentParser ( description = description ) parser . add_argument ( 'config' , help = 'config file path' ) add_args ( parser , cfg ) return parser , cfg
Generate argparser from config file automatically (experimental)
Generate argparser from config file automatically ( experimental )