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

Why do an operation that is repeated and may bring errors?

Open chencodeX opened this issue 5 years ago • 0 comments

https://github.com/rbgirshick/py-faster-rcnn/blob/master/lib/rpn/anchor_target_layer.py Line 137 138 140

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]

line 137 and line 138 equivalent to gt_max_overlaps = overlaps.max(axis=0)

And when the 140th line retrieves the index by value, the row-column relationship is not considered. If the largest overlap of a groudturth and all anchors is only 0.5, this line of code may mistakenly get the indexes of some other groudturth low-scoring anchors when indexing

Why not just use gt_argmax_overlaps = overlaps.argmax(axis=0) ?

chencodeX avatar Oct 09 '20 12:10 chencodeX