faster-rcnn-keras icon indicating copy to clipboard operation
faster-rcnn-keras copied to clipboard

想請問utils.py內encoded跟decoded的問題

Open finn-cell opened this issue 4 years ago • 1 comments

作者您好! 2020-12-04 15-26-58 在FasterRCNN的論文裡面,計算tx, ty, tw, th的公式如圖所示 而在encode_boxes有看到 `

    encoded_box[:, :2][assign_mask] = box_center - assigned_priors_center
    encoded_box[:, :2][assign_mask] /= assigned_priors_wh
    encoded_box[:, :2][assign_mask] *= 4
    encoded_box[:, 2:4][assign_mask] = np.log(box_wh / assigned_priors_wh)
    encoded_box[:, 2:4][assign_mask] *= 4

`

和decode_boxes `

    # 真实框距离先验框中心的xy轴偏移情况
    decode_bbox_center_x = mbox_loc[:, 0] * prior_width / 4
    decode_bbox_center_x += prior_center_x
    decode_bbox_center_y = mbox_loc[:, 1] * prior_height / 4
    decode_bbox_center_y += prior_center_y
    
    # 真实框的宽与高的求取
    decode_bbox_width = np.exp(mbox_loc[:, 2] / 4)
    decode_bbox_width *= prior_width
    decode_bbox_height = np.exp(mbox_loc[:, 3] /4)
    decode_bbox_height *= prior_height

`

想請問為何要針對encode_box*4和對decode_box/4呢?

finn-cell avatar Dec 04 '20 07:12 finn-cell

一个归一化的方法而已,问题不大,改变数量级

bubbliiiing avatar Dec 07 '20 06:12 bubbliiiing