本文整理汇总了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