endernewton / tf-faster-rcnn

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

problem about _anchor_target_layer #461

Open FishBigOcean opened 5 years ago

FishBigOcean commented 5 years ago

gt_argmax_overlaps = overlaps.argmax(axis=0) gt_max_overlaps = overlaps[gt_argmax_overlaps, np.arange(overlaps.shape[1])] gt_argmax_overlaps = np.where(overlaps == gt_max_overlaps)[0]

Since we got the gt_argmax_overlaps in the first line, why should we count it again in the third line?

rnsandeep commented 5 years ago

Overlaps is a two dimensional matrix. each cell shows the amount of overlap between generated box and actual groundtruth Box. If you take argmax from one axis you will get the groundTruth Box which is maximally overlapped with that specific generated box. Likewise, if you take the argmax from second axis you will get the generated Box which is maximally overlapping with the given groundTruth Box. He got the first one from line 51 and second one from line 53. Finally in line 55 he wanted the boxes which are maximally overlapped Box with the groundYTruth Box as well as the same box should be overlapped with Generated box. Its the intersection of both outputs of line 51 and 53. I think the name of the variable on line 55 is confusing. Other than that, Nothing is wrong. I hope You understand what it meant.