Skip to content

Commit 43a2b65

Browse files
authored
Small Fixes for Lite ObjDet (#771)
1 parent 28eed7b commit 43a2b65

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

lite/tests/detection/test_confusion_matrix.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
def test_confusion_matrix_no_data():
77
evaluator = Evaluator()
88
curves = evaluator._compute_confusion_matrix(
9-
data=np.array([]), label_metadata=np.array([])
9+
data=np.array([]),
10+
label_metadata=np.array([]),
11+
iou_thresholds=[0.5],
12+
score_thresholds=[0.5],
13+
number_of_examples=0,
1014
)
1115
assert isinstance(curves, list)
1216
assert len(curves) == 0

lite/valor_lite/detection/manager.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -830,22 +830,24 @@ def _compute_confusion_matrix(
830830
self,
831831
data: NDArray[np.floating],
832832
label_metadata: NDArray[np.int32],
833-
iou_thresholds: list[float] = [0.5],
834-
score_thresholds: list[float] = [
835-
score / 10.0 for score in range(1, 11)
836-
],
837-
number_of_examples: int = 0,
833+
iou_thresholds: list[float],
834+
score_thresholds: list[float],
835+
number_of_examples: int,
838836
) -> list[ConfusionMatrix]:
839837
"""
840838
Computes detailed counting metrics.
841839
842840
Parameters
843841
----------
844-
iou_thresholds : list[float], default=[0.5]
842+
data : NDArray[np.floating]
843+
An array containing detailed pairs of detections.
844+
label_metadata : NDArray[np.int32]
845+
An array containing label metadata.
846+
iou_thresholds : list[float]
845847
List of IoU thresholds to compute metrics for.
846-
score_thresholds : list[float], default=[0.1,0.2,...,1.0]
848+
score_thresholds : list[float]
847849
List of confidence thresholds to compute metrics for.
848-
number_of_examples : int, default=0
850+
number_of_examples : int
849851
Maximum number of annotation examples to return per metric.
850852
851853
Returns

0 commit comments

Comments
 (0)