本文整理汇总了Python中fast_rcnn.test.apply_nms方法的典型用法代码示例。如果您正苦于以下问题:Python test.apply_nms方法的具体用法?Python test.apply_nms怎么用?Python test.apply_nms使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fast_rcnn.test
的用法示例。
在下文中一共展示了test.apply_nms方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parse_args
# 需要导入模块: from fast_rcnn import test [as 别名]
# 或者: from fast_rcnn.test import apply_nms [as 别名]
def parse_args():
"""
Parse input arguments
"""
parser = argparse.ArgumentParser(description='Re-evaluate results')
parser.add_argument('output_dir', nargs=1, help='results directory',
type=str)
parser.add_argument('--imdb', dest='imdb_name',
help='dataset to re-evaluate',
default='voc_2007_test', type=str)
parser.add_argument('--matlab', dest='matlab_eval',
help='use matlab for evaluation',
action='store_true')
parser.add_argument('--comp', dest='comp_mode', help='competition mode',
action='store_true')
parser.add_argument('--nms', dest='apply_nms', help='apply nms',
action='store_true')
if len(sys.argv) == 1:
parser.print_help()
sys.exit(1)
args = parser.parse_args()
return args
示例2: parse_args
# 需要导入模块: from fast_rcnn import test [as 别名]
# 或者: from fast_rcnn.test import apply_nms [as 别名]
def parse_args():
"""
Parse input arguments
"""
parser = argparse.ArgumentParser(description='Re-evaluate results')
parser.add_argument('output_dir', nargs=1, help='results directory',
type=str)
parser.add_argument('--imdb', dest='imdb_name',
help='dataset to re-evaluate',
default='voc_2007_test', type=str)
parser.add_argument('--matlab', dest='matlab_eval',
help='use matlab for evaluation',
action='store_true')
parser.add_argument('--comp', dest='comp_mode', help='competition mode',
action='store_true')
parser.add_argument('--nms', dest='apply_nms', help='apply nms',
action='store_true', default=True)
if len(sys.argv) == 1:
parser.print_help()
sys.exit(1)
args = parser.parse_args()
return args
示例3: from_dets
# 需要导入模块: from fast_rcnn import test [as 别名]
# 或者: from fast_rcnn.test import apply_nms [as 别名]
def from_dets(imdb_name, output_dir, args):
imdb = get_imdb(imdb_name)
imdb.competition_mode(args.comp_mode)
imdb.config['matlab_eval'] = args.matlab_eval
with open(os.path.join(output_dir, 'detections.pkl'), 'rb') as f:
dets = cPickle.load(f)
if args.apply_nms:
print 'Applying NMS to all detections'
nms_dets = apply_nms(dets, cfg.TEST.NMS)
else:
nms_dets = dets
print 'Evaluating detections'
imdb.evaluate_detections(nms_dets, output_dir)
示例4: from_dets
# 需要导入模块: from fast_rcnn import test [as 别名]
# 或者: from fast_rcnn.test import apply_nms [as 别名]
def from_dets(imdb_name, output_dir, comp_mode):
imdb = get_imdb(imdb_name)
imdb.competition_mode(comp_mode)
with open(os.path.join(output_dir, 'detections.pkl'), 'rb') as f:
dets = cPickle.load(f)
print 'Applying NMS to all detections'
nms_dets = apply_nms(dets, cfg.TEST.NMS)
print 'Evaluating detections'
imdb.evaluate_detections(nms_dets, output_dir)