simple-faster-rcnn-pytorch
simple-faster-rcnn-pytorch copied to clipboard
关于RPN网络softmax
对最后一维(2个数字嘛)做了softmax出来,为什么取序号为1的那列呢?是把1的那列当作包含物体的概率?为什么啊?这一点我没找到什么资料。
你可以试着取另一维,然后跑跑看结果。如果几乎没有差别,那就说明这个选取没有一定的要求。 而事实上可能真的就是这样:神经网络不在乎你取哪一个,他总是会根据你的选择完成拟合。
def _create_label(self, inside_index, anchor, bbox):
# label: 1 is positive, 0 is negative, -1 is dont care
label = np.empty((len(inside_index),), dtype=np.int32)
label.fill(-1)
argmax_ious, max_ious, gt_argmax_ious = \
self._calc_ious(anchor, bbox, inside_index)
# assign negative labels first so that positive labels can clobber them
label[max_ious < self.neg_iou_thresh] = 0
# positive label: for each gt, anchor with highest iou
label[gt_argmax_ious] = 1
# positive label: above threshold IOU
label[max_ious >= self.pos_iou_thresh] = 1
...