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