本文整理汇总了Python中model.utils.config.get_output_dir方法的典型用法代码示例。如果您正苦于以下问题:Python config.get_output_dir方法的具体用法?Python config.get_output_dir怎么用?Python config.get_output_dir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model.utils.config
的用法示例。
在下文中一共展示了config.get_output_dir方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_net
# 需要导入模块: from model.utils import config [as 别名]
# 或者: from model.utils.config import get_output_dir [as 别名]
def test_net(net, imdb, device,thresh=0.5, visualize=False,output_path=None):
"""
Testing the SSH network on a dataset
:param net: The trained network
:param imdb: The test imdb
:param thresh: Detections with a probability less than this threshold are ignored
:param visualize: Whether to visualize the detections
:param output_path: Output directory
"""
print('Evaluating on {}'.format(imdb.name))
output_dir = get_output_dir(imdb_name=imdb.name, net_name="SSH pytorch", output_dir=output_path)
timers = {'detect': Timer(), 'misc': Timer()}
dets = [[[] for _ in range(len(imdb))] for _ in range(imdb.num_classes)]
pyramid = True if len(cfg.TEST.SCALES) > 1 else False
for i in range(len(imdb)):
im_path = imdb.image_path_at(i)
dets[1][i], detect_time = detect(net, im_path, device, thresh, visualize=visualize,
timers=timers, pyramid=pyramid,visualization_folder=arg.visualize_folder)
print('\r{:d}/{:d} detect-time: {:.3f}s, misc-time:{:.3f}s'
.format(i + 1, len(imdb), timers['detect'].average_time,
timers['misc'].average_time), end='')
print('\n', end='')
# Evaluate the detections
print('Evaluating detections')
imdb.evaluate_detections(all_boxes=dets, output_dir=output_dir, method_name="SSH pytorch")
print('All Done!')