Open foralliance opened 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) 其结果会有重复数字,即导致重复采样.为什么要设置成重复采样呢??
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的设置来刻意避免重复采样.
npr.choice(bg_inds, size=bg_rois_per_this_image, replace=False)
replace=False
many many thaks!!
@guoruoqian HI
在proposal_target_layer.py中,在选择负样本时,用的函数是:
其中,
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!!