ruoqianguo / cascade-rcnn_Pytorch

An implementation of Cascade R-CNN: Delving into High Quality Object Detection.
MIT License
436 stars 107 forks source link

about proposal_target_layer #31

Open foralliance opened 5 years ago

foralliance commented 5 years ago

@guoruoqian HI

proposal_target_layer.py中,在选择负样本时,用的函数是:

rand_num = np.floor(np.random.rand(bg_rois_per_this_image) * bg_num_rois)   
rand_num = torch.from_numpy(rand_num).type_as(gt_boxes).long()
bg_inds = bg_inds[rand_num]

其中, rand_num = np.floor(np.random.rand(bg_rois_per_this_image) * bg_num_rois)   其结果会有重复数字,即导致重复采样.为什么要设置成重复采样呢??

在py-faster-rcnn中,采样时 npr.choice(bg_inds, size=bg_rois_per_this_image, replace=False) 通过replace=False的设置来刻意避免重复采样.

many many thaks!!