Skip to content

Commit

Permalink
fix recall calculation bug for empty scene (#908)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yzichen authored Mar 29, 2022
1 parent 1d5dac7 commit fd20aab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pcdet/models/detectors/detector3d_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def generate_recall_record(box_preds, recall_dict, batch_index, data_dict=None,

cur_gt = gt_boxes
k = cur_gt.__len__() - 1
while k > 0 and cur_gt[k].sum() == 0:
while k >= 0 and cur_gt[k].sum() == 0:
k -= 1
cur_gt = cur_gt[:k + 1]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def sample_rois_for_rcnn(self, batch_dict):
cur_roi, cur_gt, cur_roi_labels, cur_roi_scores = \
rois[index], gt_boxes[index], roi_labels[index], roi_scores[index]
k = cur_gt.__len__() - 1
while k > 0 and cur_gt[k].sum() == 0:
while k >= 0 and cur_gt[k].sum() == 0:
k -= 1
cur_gt = cur_gt[:k + 1]
cur_gt = cur_gt.new_zeros((1, cur_gt.shape[1])) if len(cur_gt) == 0 else cur_gt
Expand Down

0 comments on commit fd20aab

Please sign in to comment.