endernewton / tf-faster-rcnn

Tensorflow Faster RCNN for Object Detection
https://arxiv.org/pdf/1702.02138.pdf
MIT License
3.65k stars 1.58k forks source link

rpn_box_targets from ntwork.py def _add_losses(self, sigma_rpn=3.0): #476

Open ghost opened 4 years ago

ghost commented 4 years ago

# RPN, bbox loss rpn_bbox_pred = self._predictions['rpn_bbox_pred'] rpn_bbox_targets = self._anchor_targets['rpn_bbox_targets'] rpn_bbox_inside_weights = self._anchor_targets['rpn_bbox_inside_weights'] rpn_bbox_outside_weights = self._anchor_targets['rpn_bbox_outside_weights'] rpn_loss_box = self._smooth_l1_loss(rpn_bbox_pred, rpn_bbox_targets, rpn_bbox_inside_weights, rpn_bbox_outside_weights, sigma=sigma_rpn, dim=[1, 2, 3])

smooth_l1_loss ‘s rpn_bbox_pred and rpn_bbox_targets.

From this code I can find the rpn_box_targets is the diff from ground_truth and anchor . but why the rpn_bbox_pred is not the diff from prediction and anchor ?

rpn_bbox_pred = slim.conv2d(rpn, self._num_anchors * 4, [1, 1], trainable=is_training, weights_initializer=initializer, padding='VALID', activation_fn=None, scope='rpn_bbox_pred')

the rpn_bbox_pred has no relationship with anchor