SIGN IN SIGN UP
roboflow / supervision UNCLAIMED

We write your reusable computer vision tools. 💜

0 0 0 Python

refactor(metrics): update MeanAveragePrecisionResult to use float32 precision (#2169)

* refactor(metrics): update MeanAveragePrecisionResult to use float32 precision

This change reduces memory usage and improves computation speed while maintaining acceptable precision for most computer vision tasks.

- Changed mAP_scores, ap_per_class, and iou_thresholds from float64 to float32
- Updated EPS constant to use float32 precision
- Modified COCOEvaluator parameters and computations to use float32
- Added type annotations for variables in filter_segments_by_distance function
- Changed precision and recall calculations to use float32
- Updated average precision computation to handle float32 values
- Modified summarize_predictions to return float32 array

* update type annotation for `keep_labels` to use `npt.NDArray[np.bool_]`
* update EPS constant and mAP calculations for precision consistency
* Apply suggestions from code review

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
J
Jirka Borovec committed
93f5622d15590550c2680dfc2b0b05e940769860
Parent: a78bf58
Committed by GitHub <noreply@github.com> on 3/10/2026, 3:53:32 PM