本文整理汇总了Python中datasets.pascal_voc.pascal_voc方法的典型用法代码示例。如果您正苦于以下问题:Python pascal_voc.pascal_voc方法的具体用法?Python pascal_voc.pascal_voc怎么用?Python pascal_voc.pascal_voc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类datasets.pascal_voc
的用法示例。
在下文中一共展示了pascal_voc.pascal_voc方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: from_dets
# 需要导入模块: from datasets import pascal_voc [as 别名]
# 或者: from datasets.pascal_voc import pascal_voc [as 别名]
def from_dets(imdb_name, detection_file, args):
imdb = pascal_voc('test', '2007')
imdb.competition_mode(args.comp_mode)
imdb.config['matlab_eval'] = args.matlab_eval
with open(os.path.join(detection_file), 'rb') as f:
if 'json' in detection_file:
dets = json.load(f)
else:
dets = pickle.load(f, encoding='latin1')
# import pdb; pdb.set_trace()
if args.apply_nms:
print('Applying NMS to all detections')
test_nms = 0.3
nms_dets = apply_nms(dets, test_nms)
else:
nms_dets = dets
print('Evaluating detections')
imdb.evaluate_detections(nms_dets)
示例2: combined_roidb
# 需要导入模块: from datasets import pascal_voc [as 别名]
# 或者: from datasets.pascal_voc import pascal_voc [as 别名]
def combined_roidb(dataset_name, set_name, classes=None, ext=None, training=True, data_extra=None):
"""
Combine multiple roidbs
"""
def get_training_roidb(imdb):
"""Returns a roidb (Region of Interest database) for use in training."""
if cfg.TRAIN.USE_FLIPPED:
tqdm.write('Appending horizontally-flipped training examples...')
imdb.append_flipped_images()
tqdm.write('done')
tqdm.write('Preparing training data...')
prepare_roidb(imdb)
# ratio_index = rank_roidb_ratio(imdb)
tqdm.write('done')
return imdb.roidb
# Get the roidb
imdb = pascal_voc(set_name, dataset_name, classes=classes, ext=ext, data_extra=data_extra)
tqdm.write('Loaded dataset `{:s}` for training'.format(imdb.name))
imdb.set_proposal_method(cfg.TRAIN.PROPOSAL_METHOD)
tqdm.write('Set proposal method: {:s}'.format(cfg.TRAIN.PROPOSAL_METHOD))
roidb = get_training_roidb(imdb)
# Get the imdb
# imdb = pascal_voc(set_name, dataset_name)
if training:
roidb = filter_roidb(roidb)
ratio_list, ratio_index = rank_roidb_ratio(roidb)
return imdb, roidb, ratio_list, ratio_index