Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions perceptionmetrics/utils/detection_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ def update(self, gt_boxes, gt_labels, pred_boxes, pred_labels, pred_scores):
(gt_boxes, gt_labels, pred_boxes, pred_labels, pred_scores)
)

# Update ground truth counts
for g_label in gt_labels:
self.gt_counts[int(g_label)] += 1

# Handle empty inputs
if len(gt_boxes) == 0 and len(pred_boxes) == 0:
return # Nothing to process
Expand All @@ -89,9 +93,6 @@ def update(self, gt_boxes, gt_labels, pred_boxes, pred_labels, pred_scores):
for label in matches:
self.results[label].extend(matches[label])

# Update ground truth counts
for g_label in gt_labels:
self.gt_counts[int(g_label)] += 1

def _match_predictions(
self,
Expand Down