Functions
rpn::rpn Namespace Reference

Functions

def assign_anchor
def get_rpn_batch
def get_rpn_testbatch

Detailed Description

RPN:
data =
{'data': [num_images, c, h, w],
 'im_info': [num_images, 4] (optional)}
label =
{'gt_boxes': [num_boxes, 5] (optional),
 'label': [batch_size, 1] <- [batch_size, num_anchors, feat_height, feat_width],
 'bbox_target': [batch_size, num_anchors, feat_height, feat_width],
 'bbox_weight': [batch_size, num_anchors, feat_height, feat_width]}

Function Documentation

def rpn.rpn.assign_anchor (   feat_shape,
  gt_boxes,
  im_info,
  cfg,
  feat_stride = 16,
  scales = (8, 16,
  ratios = (0.5, 1,
  allowed_border = 0 
)
assign ground truth boxes to anchor positions
:param feat_shape: infer output shape
:param gt_boxes: assign ground truth
:param im_info: filter out anchors overlapped with edges
:param feat_stride: anchor position step
:param scales: used to generate anchors, affects num_anchors (per location)
:param ratios: aspect ratios of generated anchors
:param allowed_border: filter out anchors with edge overlap > allowed_border
:return: dict of label
'label': of shape (batch_size, 1) <- (batch_size, num_anchors, feat_height, feat_width)
'bbox_target': of shape (batch_size, num_anchors * 4, feat_height, feat_width)
'bbox_inside_weight': *todo* mark the assigned anchors
'bbox_outside_weight': used to normalize the bbox_loss, all weights sums to RPN_POSITIVE_WEIGHT

Definition at line 66 of file rpn.py.

def rpn.rpn.get_rpn_batch (   roidb,
  cfg 
)
prototype for rpn batch: data, im_info, gt_boxes
:param roidb: ['image', 'flipped'] + ['gt_boxes', 'boxes', 'gt_classes']
:return: data, label

Definition at line 39 of file rpn.py.

def rpn.rpn.get_rpn_testbatch (   roidb,
  cfg 
)
return a dict of testbatch
:param roidb: ['image', 'flipped']
:return: data, label, im_info

Definition at line 21 of file rpn.py.



rail_object_detector
Author(s):
autogenerated on Sat Jun 8 2019 20:26:31