本文整理汇总了Python中utils.load_config_from_file方法的典型用法代码示例。如果您正苦于以下问题:Python utils.load_config_from_file方法的具体用法?Python utils.load_config_from_file怎么用?Python utils.load_config_from_file使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utils
的用法示例。
在下文中一共展示了utils.load_config_from_file方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_configs_load
# 需要导入模块: import utils [as 别名]
# 或者: from utils import load_config_from_file [as 别名]
def test_configs_load(self):
''' Make sure configs are loadable '''
cfg_root_path = utils.get_config_root_path()
files = glob.glob(
os.path.join(cfg_root_path, "./**/*.yaml"), recursive=True)
self.assertGreater(len(files), 0)
for fn in files:
print('Loading {}...'.format(fn))
utils.load_config_from_file(fn)
示例2: _test_build_detectors
# 需要导入模块: import utils [as 别名]
# 或者: from utils import load_config_from_file [as 别名]
def _test_build_detectors(self, device):
''' Make sure models build '''
cfg_files = get_config_files(None, EXCLUDED_FOLDERS)
self.assertGreater(len(cfg_files), 0)
for cfg_file in cfg_files:
with self.subTest(cfg_file=cfg_file):
print('Testing {}...'.format(cfg_file))
cfg = utils.load_config_from_file(cfg_file)
create_model(cfg, device)
示例3: _test_run_selected_detectors
# 需要导入模块: import utils [as 别名]
# 或者: from utils import load_config_from_file [as 别名]
def _test_run_selected_detectors(self, cfg_files, device):
''' Make sure models build and run '''
self.assertGreater(len(cfg_files), 0)
for cfg_file in cfg_files:
with self.subTest(cfg_file=cfg_file):
print('Testing {}...'.format(cfg_file))
cfg = utils.load_config_from_file(cfg_file)
cfg.MODEL.RPN.POST_NMS_TOP_N_TEST = 10
cfg.MODEL.RPN.FPN_POST_NMS_TOP_N_TEST = 10
model = create_model(cfg, device)
inputs = create_random_input(cfg, device)
model.eval()
output = model(inputs)
self.assertEqual(len(output), len(inputs.image_sizes))