本文整理匯總了Python中lib.datasets.factory.get_imdb方法的典型用法代碼示例。如果您正苦於以下問題:Python factory.get_imdb方法的具體用法?Python factory.get_imdb怎麽用?Python factory.get_imdb使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類lib.datasets.factory
的用法示例。
在下文中一共展示了factory.get_imdb方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: combined_roidb
# 需要導入模塊: from lib.datasets import factory [as 別名]
# 或者: from lib.datasets.factory import get_imdb [as 別名]
def combined_roidb(imdb_names):
# for now: imdb_names='vg_1.2_train'
def get_roidb(imdb_name):
imdb = get_imdb(imdb_name)
print('Loaded dataset `{:s}` for training'.format(imdb.name))
imdb.set_proposal_method(cfg.TRAIN.PROPOSAL_METHOD)
print('Set proposal method: {:s}'.format(cfg.TRAIN.PROPOSAL_METHOD))
roidb = get_training_roidb(imdb)
return roidb
roidbs = [get_roidb(s) for s in imdb_names.split('+')]
roidb = roidbs[0]
if len(roidbs) > 1:
for r in roidbs[1:]:
roidb.extend(r)
imdb = lib.datasets.imdb.imdb(imdb_names)
else:
imdb = get_imdb(imdb_names)
return imdb, roidb
示例2: combined_roidb
# 需要導入模塊: from lib.datasets import factory [as 別名]
# 或者: from lib.datasets.factory import get_imdb [as 別名]
def combined_roidb(imdb_names):
"""
Combine multiple roidbs
"""
def get_roidb(imdb_name):
imdb = get_imdb(imdb_name)
print('Loaded dataset `{:s}` for training'.format(imdb.name))
imdb.set_proposal_method("gt")
print('Set proposal method: {:s}'.format("gt"))
roidb = get_training_roidb(imdb)
return roidb
roidbs = [get_roidb(s) for s in imdb_names.split('+')]
roidb = roidbs[0]
if len(roidbs) > 1:
for r in roidbs[1:]:
roidb.extend(r)
tmp = get_imdb(imdb_names.split('+')[1])
imdb = imdb2(imdb_names, tmp.classes)
else:
imdb = get_imdb(imdb_names)
return imdb, roidb
示例3: combined_roidb
# 需要導入模塊: from lib.datasets import factory [as 別名]
# 或者: from lib.datasets.factory import get_imdb [as 別名]
def combined_roidb(imdb_names):
"""
Combine multiple roidbs
"""
def get_roidb(imdb_name):
imdb = get_imdb(imdb_name)
print('Loaded dataset `{:s}` for training'.format(imdb.name))
imdb.set_proposal_method(cfg.TRAIN.PROPOSAL_METHOD)
# print('Set proposal method: {:s}'.format(cfg.TRAIN.PROPOSAL_METHOD))
roidb = get_training_roidb(imdb)
return roidb
roidbs = [get_roidb(s) for s in imdb_names.split('+')]
roidb = roidbs[0]
if len(roidbs) > 1:
for r in roidbs[1:]:
roidb.extend(r)
tmp = get_imdb(imdb_names.split('+')[1])
imdb = lib.datasets.imdb.imdb(imdb_names, tmp.classes)
else:
imdb = get_imdb(imdb_names)
return imdb, roidb
示例4: combined_roidb
# 需要導入模塊: from lib.datasets import factory [as 別名]
# 或者: from lib.datasets.factory import get_imdb [as 別名]
def combined_roidb(imdb_names):#"voc_2007_trainval"
"""
Combine multiple roidbs
"""
def get_roidb(imdb_name):
imdb = get_imdb(imdb_name)
print('Loaded dataset `{:s}` for training'.format(imdb.name))
imdb.set_proposal_method("gt")
print('Set proposal method: {:s}'.format("gt"))
roidb = get_training_roidb(imdb)
return roidb
roidbs = [get_roidb(s) for s in imdb_names.split('+')]
roidb = roidbs[0]
if len(roidbs) > 1:
for r in roidbs[1:]:
roidb.extend(r)
tmp = get_imdb(imdb_names.split('+')[1])
imdb = imdb2(imdb_names, tmp.classes)
else:
imdb = get_imdb(imdb_names)
return imdb, roidb
示例5: from_dets
# 需要導入模塊: from lib.datasets import factory [as 別名]
# 或者: from lib.datasets.factory import get_imdb [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 = pickle.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)
示例6: get_roidb_limit_ram
# 需要導入模塊: from lib.datasets import factory [as 別名]
# 或者: from lib.datasets.factory import get_imdb [as 別名]
def get_roidb_limit_ram(imdb_name):
"""
Note: we need to run get_training_roidb sort of funcs later
for now, it only supports single roidb.
"""
imdb = get_imdb(imdb_name)
roidb = imdb.roidb
assert isinstance(roidb, six.string_types), \
"for limit ram vision, roidb should be a path."
return imdb, roidb
示例7: __init__
# 需要導入模塊: from lib.datasets import factory [as 別名]
# 或者: from lib.datasets.factory import get_imdb [as 別名]
def __init__(self, imdb_name, resize=True):
imdb = get_imdb(imdb_name)
# Ignore the background class!!! So ['gt_classes'] must minus 1.
self.classes = [ np.zeros(imdb.num_classes - 1) for i in range(imdb.num_images) ]
for i, anno in enumerate(imdb.gt_roidb()):
np.put(self.classes[i], map(lambda x: x-1, anno['gt_classes']), 1)
# np.put(self.classes[i], random.choice(map(lambda x: x-1, anno['gt_classes'])), 1)
self.images = [ imdb.image_path_at(i) for i in range(imdb.num_images) ]
assert len(self.classes) == len(self.images)
self._perm = np.random.permutation(np.arange(len(self.images)))
self._cur = 0
self.resize = resize