Unverified Commit fd20aabc authored by Yzichen's avatar Yzichen Committed by GitHub
Browse files

fix recall calculation bug for empty scene (#908)

parent 1d5dac76
...@@ -299,7 +299,7 @@ class Detector3DTemplate(nn.Module): ...@@ -299,7 +299,7 @@ class Detector3DTemplate(nn.Module):
cur_gt = gt_boxes cur_gt = gt_boxes
k = cur_gt.__len__() - 1 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 k -= 1
cur_gt = cur_gt[:k + 1] cur_gt = cur_gt[:k + 1]
......
...@@ -90,7 +90,7 @@ class ProposalTargetLayer(nn.Module): ...@@ -90,7 +90,7 @@ class ProposalTargetLayer(nn.Module):
cur_roi, cur_gt, cur_roi_labels, cur_roi_scores = \ cur_roi, cur_gt, cur_roi_labels, cur_roi_scores = \
rois[index], gt_boxes[index], roi_labels[index], roi_scores[index] rois[index], gt_boxes[index], roi_labels[index], roi_scores[index]
k = cur_gt.__len__() - 1 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 k -= 1
cur_gt = cur_gt[: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 cur_gt = cur_gt.new_zeros((1, cur_gt.shape[1])) if len(cur_gt) == 0 else cur_gt
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment