Functions | |
def | assign_anchor |
def | get_rpn_batch |
def | get_rpn_testbatch |
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]}
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
def rpn.rpn.get_rpn_batch | ( | roidb, | |
cfg | |||
) |
def rpn.rpn.get_rpn_testbatch | ( | roidb, | |
cfg | |||
) |