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