[GRASS-SVN] r74151 - grass-addons/grass7/imagery/i.ann.maskrcnn/maskrcnnlib

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Mar 4 04:26:15 PST 2019


Author: pesekon2
Date: 2019-03-04 04:26:15 -0800 (Mon, 04 Mar 2019)
New Revision: 74151

Modified:
   grass-addons/grass7/imagery/i.ann.maskrcnn/maskrcnnlib/model.py
Log:
i.ann.maskrcnn: fix multiple anchors with same IoU

Modified: grass-addons/grass7/imagery/i.ann.maskrcnn/maskrcnnlib/model.py
===================================================================
--- grass-addons/grass7/imagery/i.ann.maskrcnn/maskrcnnlib/model.py	2019-03-03 23:29:56 UTC (rev 74150)
+++ grass-addons/grass7/imagery/i.ann.maskrcnn/maskrcnnlib/model.py	2019-03-04 12:26:15 UTC (rev 74151)
@@ -1502,8 +1502,8 @@
     anchor_iou_max = overlaps[np.arange(overlaps.shape[0]), anchor_iou_argmax]
     rpn_match[(anchor_iou_max < 0.3) & (no_crowd_bool)] = -1
     # 2. Set an anchor for each GT box (regardless of IoU value).
-    # TODO: If multiple anchors have the same IoU match all of them
-    gt_iou_argmax = np.argmax(overlaps, axis=0)
+    # If multiple anchors have the same IoU match all of them
+    gt_iou_argmax = np.argwhere(overlaps == np.max(overlaps, axis=0))[:,0]
     rpn_match[gt_iou_argmax] = 1
     # 3. Set anchors with high overlap as positive.
     rpn_match[anchor_iou_max >= 0.7] = 1



More information about the grass-commit mailing list