本文整理匯總了Python中roi_data_layer.roidb.add_bbox_regression_targets方法的典型用法代碼示例。如果您正苦於以下問題:Python roidb.add_bbox_regression_targets方法的具體用法?Python roidb.add_bbox_regression_targets怎麽用?Python roidb.add_bbox_regression_targets使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類roi_data_layer.roidb
的用法示例。
在下文中一共展示了roidb.add_bbox_regression_targets方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from roi_data_layer import roidb [as 別名]
# 或者: from roi_data_layer.roidb import add_bbox_regression_targets [as 別名]
def __init__(self, sess, saver, network, imdb, roidb, output_dir, pretrained_model=None):
"""Initialize the SolverWrapper."""
self.net = network
self.imdb = imdb
self.roidb = roidb
self.output_dir = output_dir
self.pretrained_model = pretrained_model
print 'Computing bounding-box regression targets...'
if cfg.TRAIN.BBOX_REG:
self.bbox_means, self.bbox_stds = rdl_roidb.add_bbox_regression_targets(
roidb)
print 'done'
# For checkpoint
self.saver = saver
示例2: __init__
# 需要導入模塊: from roi_data_layer import roidb [as 別名]
# 或者: from roi_data_layer.roidb import add_bbox_regression_targets [as 別名]
def __init__(self, solver_prototxt, roidb, output_dir, pretrained_model=None):
"""Initialize the SolverWrapper."""
self.output_dir = output_dir
print 'Computing bounding-box regression targets...'
if cfg.TRAIN.BBOX_REG:
if cfg.IS_RPN:
self.bbox_means, self.bbox_stds = gdl_roidb.add_bbox_regression_targets(roidb)
else:
self.bbox_means, self.bbox_stds = rdl_roidb.add_bbox_regression_targets(roidb)
print 'done'
self.solver = caffe.SGDSolver(solver_prototxt)
if pretrained_model is not None:
print ('Loading pretrained model '
'weights from {:s}').format(pretrained_model)
self.solver.net.copy_from(pretrained_model)
self.solver_param = caffe_pb2.SolverParameter()
with open(solver_prototxt, 'rt') as f:
pb2.text_format.Merge(f.read(), self.solver_param)
self.solver.net.layers[0].set_roidb(roidb)
示例3: __init__
# 需要導入模塊: from roi_data_layer import roidb [as 別名]
# 或者: from roi_data_layer.roidb import add_bbox_regression_targets [as 別名]
def __init__(self, solver_prototxt, roidb, output_dir,
pretrained_model=None):
"""Initialize the SolverWrapper."""
self.output_dir = output_dir
if (cfg.TRAIN.HAS_RPN and cfg.TRAIN.BBOX_REG and
cfg.TRAIN.BBOX_NORMALIZE_TARGETS):
# RPN can only use precomputed normalization because there are no
# fixed statistics to compute a priori
assert cfg.TRAIN.BBOX_NORMALIZE_TARGETS_PRECOMPUTED
if cfg.TRAIN.BBOX_REG:
print 'Computing bounding-box regression targets...'
self.bbox_means, self.bbox_stds = \
rdl_roidb.add_bbox_regression_targets(roidb)
print 'done'
self.solver = caffe.SGDSolver(solver_prototxt)
if pretrained_model is not None:
print ('Loading pretrained model '
'weights from {:s}').format(pretrained_model)
self.solver.net.copy_from(pretrained_model)
self.solver_param = caffe_pb2.SolverParameter()
with open(solver_prototxt, 'rt') as f:
pb2.text_format.Merge(f.read(), self.solver_param)
self.solver.net.layers[0].set_roidb(roidb)
示例4: __init__
# 需要導入模塊: from roi_data_layer import roidb [as 別名]
# 或者: from roi_data_layer.roidb import add_bbox_regression_targets [as 別名]
def __init__(self, sess, saver, network, imdb, roidb, output_dir, pretrained_model=None):
"""Initialize the SolverWrapper."""
self.net = network
self.imdb = imdb
self.roidb = roidb
self.output_dir = output_dir
self.pretrained_model = pretrained_model
print 'Computing bounding-box regression targets...'
if cfg.TRAIN.BBOX_REG:
self.bbox_means, self.bbox_stds = rdl_roidb.add_bbox_regression_targets(roidb)
print 'done'
# For checkpoint
self.saver = saver