Skip to content

Commit

Permalink
mAP result: add IoU thresholds
Browse files Browse the repository at this point in the history
  • Loading branch information
LinasKo committed Aug 26, 2024
1 parent 2221d2b commit 0c6def1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions supervision/metrics/mean_average_precision.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ def _compute(
average_precisions = np.empty((0, len(iou_thresholds)), dtype=np.float32)

return MeanAveragePrecisionResult(
iou_thresholds=iou_thresholds,
map50_95=map50_95,
map50=map50,
map75=map75,
Expand Down Expand Up @@ -355,6 +356,7 @@ def _average_precisions_per_class(

@dataclass
class MeanAveragePrecisionResult:
iou_thresholds: np.ndarray
map50_95: float
map50: float
map75: float
Expand All @@ -366,6 +368,7 @@ class MeanAveragePrecisionResult:
def __str__(self) -> str:
out_str = (
f"{self.__class__.__name__}:\n"
f"iou_thresholds: {self.iou_thresholds}\n"
f"map50_95: {self.map50_95}\n"
f"map50: {self.map50}\n"
f"map75: {self.map75}\n"
Expand Down

0 comments on commit 0c6def1

Please sign in to comment.