Skip to content

Commit fb87da2

Browse files
corrected pairing in SSD head of pointpillars (#602)
Accordiing to the PointPillars paper, "A positive match is either the highest with a ground truth box, or above the positive match threshold". While the latter point is implemented correctly, there's a minor mistake in the implementation of the first point. The original code only updates the bool array _pos_idx_ without changing the matched target to the correct ground truth index. This could lead to ground truth box without a valid match in the end. When I corrected the SSD matching, I also referred to this implementation of SSD: https://github.com/amdegroot/ssd.pytorch/blob/5b0b77faa955c1917b0c710d770739ba8fbff9b7/layers/box_utils.py#L106 <!-- Reviewable:start --> - - - This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/isl-org/Open3D-ML/602) <!-- Reviewable:end --> Co-authored-by: Benjamin Ummenhofer <benjaminum@gmail.com>
1 parent 200085e commit fb87da2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ml3d/torch/models/point_pillars.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ def flatten_idx(idx, j):
907907
# for each anchor the gt with max IoU
908908
max_overlaps, argmax_overlaps = overlaps.max(dim=0)
909909
# for each gt the anchor with max IoU
910-
gt_max_overlaps, _ = overlaps.max(dim=1)
910+
gt_max_overlaps, gt_argmax_overlaps = overlaps.max(dim=1)
911911

912912
pos_idx = max_overlaps >= pos_th
913913
neg_idx = (max_overlaps >= 0) & (max_overlaps < neg_th)
@@ -916,6 +916,7 @@ def flatten_idx(idx, j):
916916
for k in range(len(target_bboxes[i])):
917917
if gt_max_overlaps[k] >= neg_th:
918918
pos_idx[overlaps[k, :] == gt_max_overlaps[k]] = True
919+
argmax_overlaps[gt_argmax_overlaps[k]] = k
919920

920921
# encode bbox for positive matches
921922
assigned_bboxes.append(

0 commit comments

Comments
 (0)