本文整理匯總了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))