当前位置: 首页>>代码示例>>Python>>正文


Python bbox_transform.bbox_transform方法代码示例

本文整理汇总了Python中model.bbox_transform.bbox_transform方法的典型用法代码示例。如果您正苦于以下问题:Python bbox_transform.bbox_transform方法的具体用法?Python bbox_transform.bbox_transform怎么用?Python bbox_transform.bbox_transform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在model.bbox_transform的用法示例。


在下文中一共展示了bbox_transform.bbox_transform方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _compute_targets

# 需要导入模块: from model import bbox_transform [as 别名]
# 或者: from model.bbox_transform import bbox_transform [as 别名]
def _compute_targets(ex_rois, gt_rois, labels):
  """Compute bounding-box regression targets for an image."""
  # Inputs are tensor

  assert ex_rois.shape[0] == gt_rois.shape[0]
  assert ex_rois.shape[1] == 4
  assert gt_rois.shape[1] == 4
  #  返回roi相对与其匹配的gt (dx,dy,dw,dh)四个回归值,shape(len(rois),4)
  targets = bbox_transform(ex_rois, gt_rois)
  if cfg.TRAIN.BBOX_NORMALIZE_TARGETS_PRECOMPUTED:
    #  是否归一化
    #  Optionally normalize targets by a precomputed mean and stdev
    targets = ((targets - targets.new(cfg.TRAIN.BBOX_NORMALIZE_MEANS))
               / targets.new(cfg.TRAIN.BBOX_NORMALIZE_STDS))
  # labels.unsqueeze(1) -> (128, 1)
  return torch.cat(
    [labels.unsqueeze(1), targets], 1)  # (128, 5) 类别和4个回归值 
开发者ID:Sundrops,项目名称:pytorch-faster-rcnn,代码行数:19,代码来源:proposal_target_layer.py

示例2: _compute_targets

# 需要导入模块: from model import bbox_transform [as 别名]
# 或者: from model.bbox_transform import bbox_transform [as 别名]
def _compute_targets(ex_rois, gt_rois, labels):
  """Compute bounding-box regression targets for an image."""
  # Inputs are tensor

  assert ex_rois.shape[0] == gt_rois.shape[0]
  assert ex_rois.shape[1] == 4
  assert gt_rois.shape[1] == 4

  targets = bbox_transform(ex_rois, gt_rois)
  if cfg.TRAIN.BBOX_NORMALIZE_TARGETS_PRECOMPUTED:
    # Optionally normalize targets by a precomputed mean and stdev
    targets = ((targets - targets.new(cfg.TRAIN.BBOX_NORMALIZE_MEANS))
               / targets.new(cfg.TRAIN.BBOX_NORMALIZE_STDS))
  return torch.cat(
    [labels.unsqueeze(1), targets], 1) 
开发者ID:Sunarker,项目名称:Collaborative-Learning-for-Weakly-Supervised-Object-Detection,代码行数:17,代码来源:proposal_target_layer.py

示例3: _compute_targets

# 需要导入模块: from model import bbox_transform [as 别名]
# 或者: from model.bbox_transform import bbox_transform [as 别名]
def _compute_targets(ex_rois, gt_rois):
  """Compute bounding-box regression targets for an image."""

  assert ex_rois.shape[0] == gt_rois.shape[0]
  assert ex_rois.shape[1] == 4
  assert gt_rois.shape[1] == 5

  return bbox_transform(torch.from_numpy(ex_rois), torch.from_numpy(gt_rois[:, :4])).numpy() 
开发者ID:Sunarker,项目名称:Collaborative-Learning-for-Weakly-Supervised-Object-Detection,代码行数:10,代码来源:anchor_target_layer.py

示例4: _compute_targets

# 需要导入模块: from model import bbox_transform [as 别名]
# 或者: from model.bbox_transform import bbox_transform [as 别名]
def _compute_targets(ex_rois, gt_rois):
    """Compute bounding-box regression targets for an image."""

    assert ex_rois.shape[0] == gt_rois.shape[0]
    assert ex_rois.shape[1] == 4
    assert gt_rois.shape[1] == 5

    return bbox_transform(ex_rois, gt_rois[:, :4]).astype(np.float32, copy=False) 
开发者ID:wanjinchang,项目名称:SSH-TensorFlow,代码行数:10,代码来源:anchor_target_layer.py

示例5: _compute_targets

# 需要导入模块: from model import bbox_transform [as 别名]
# 或者: from model.bbox_transform import bbox_transform [as 别名]
def _compute_targets(ex_rois, gt_rois):
    """Compute bounding-box regression targets for an image."""

    assert ex_rois.shape[0] == gt_rois.shape[0]
    assert ex_rois.shape[1] == 4
    assert gt_rois.shape[1] == 5

    targets = bbox_transform(ex_rois, gt_rois)

    return targets 
开发者ID:Sanster,项目名称:tf_ctpn,代码行数:12,代码来源:anchor_target_layer.py

示例6: _compute_targets

# 需要导入模块: from model import bbox_transform [as 别名]
# 或者: from model.bbox_transform import bbox_transform [as 别名]
def _compute_targets(ex_rois, gt_rois, labels):
  """Compute bounding-box regression targets for an image."""

  assert ex_rois.shape[0] == gt_rois.shape[0]
  assert ex_rois.shape[1] == 4
  assert gt_rois.shape[1] == 4

  targets = bbox_transform(ex_rois, gt_rois)
  if cfg.TRAIN.BBOX_NORMALIZE_TARGETS_PRECOMPUTED:
    # Optionally normalize targets by a precomputed mean and stdev
    targets = ((targets - np.array(cfg.TRAIN.BBOX_NORMALIZE_MEANS))
               / np.array(cfg.TRAIN.BBOX_NORMALIZE_STDS))
  return np.hstack(
    (labels[:, np.newaxis], targets)).astype(np.float32, copy=False) 
开发者ID:pengzhou1108,项目名称:RGB-N,代码行数:16,代码来源:proposal_target_layer.py

示例7: _compute_targets

# 需要导入模块: from model import bbox_transform [as 别名]
# 或者: from model.bbox_transform import bbox_transform [as 别名]
def _compute_targets(ex_rois, gt_rois):
  """Compute bounding-box regression targets for an image."""

  assert ex_rois.shape[0] == gt_rois.shape[0]
  assert ex_rois.shape[1] == 4
  assert gt_rois.shape[1] == 5

  return bbox_transform(ex_rois, gt_rois[:, :4]).astype(np.float32, copy=False) 
开发者ID:pengzhou1108,项目名称:RGB-N,代码行数:10,代码来源:anchor_target_layer.py

示例8: _compute_targets

# 需要导入模块: from model import bbox_transform [as 别名]
# 或者: from model.bbox_transform import bbox_transform [as 别名]
def _compute_targets(ex_rois, gt_rois):
  """Compute bounding-box regression targets for an image."""

  assert ex_rois.shape[0] == gt_rois.shape[0]
  assert ex_rois.shape[1] == 4
  if cfg.SUB_CATEGORY:
    assert gt_rois.shape[1] == 6
  else:
    assert gt_rois.shape[1] == 5

  return bbox_transform(torch.from_numpy(ex_rois), torch.from_numpy(gt_rois[:, :4])).numpy() 
开发者ID:Sundrops,项目名称:pytorch-faster-rcnn,代码行数:13,代码来源:anchor_target_layer.py


注:本文中的model.bbox_transform.bbox_transform方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。