Skip to content

Commit 458fce6

Browse files
author
Tianyu Li
authored
48 issue with unsorted confidence array in recall threshold calculation (#50)
fix 48-issue-with-unsorted-confidence-array-in-recall-threshold-calculation
1 parent 9170133 commit 458fce6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

openlanev2/evaluation/evaluate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ def _inject(num_gt, pred, tp, idx_match_gt, confidence, distance_threshold, obje
160160

161161
confidence = np.asarray(confidence)
162162
sorted_idx = np.argsort(-confidence)
163+
sorted_confidence = confidence[sorted_idx]
163164
tp = tp[sorted_idx]
164165

165166
tps = np.cumsum(tp, axis=0)
@@ -168,7 +169,7 @@ def _inject(num_gt, pred, tp, idx_match_gt, confidence, distance_threshold, obje
168169

169170
taken = np.percentile(recalls, np.arange(10, 101, 10), method='closest_observation')
170171
taken_idx = {r: i for i, r in enumerate(recalls)}
171-
confidence_thresholds = confidence[np.asarray([taken_idx[t] for t in taken])]
172+
confidence_thresholds = sorted_confidence[np.asarray([taken_idx[t] for t in taken])]
172173

173174
pred[f'{object_type}_{distance_threshold}_idx_match_gt'] = idx_match_gt
174175
pred[f'{object_type}_{distance_threshold}_confidence'] = confidence

0 commit comments

Comments
 (0)