From cc007f83b0c51027ca1d8f3eb99aad0f0ab01f3e Mon Sep 17 00:00:00 2001 From: "codeflash-ai[bot]" <148906541+codeflash-ai[bot]@users.noreply.github.com> Date: Wed, 29 Oct 2025 10:51:32 +0000 Subject: [PATCH] Optimize get_intersection_mask --- .../core/workflows/core_steps/fusion/detections_consensus/v1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inference/core/workflows/core_steps/fusion/detections_consensus/v1.py b/inference/core/workflows/core_steps/fusion/detections_consensus/v1.py index 196c5425a1..df00323f4c 100644 --- a/inference/core/workflows/core_steps/fusion/detections_consensus/v1.py +++ b/inference/core/workflows/core_steps/fusion/detections_consensus/v1.py @@ -658,7 +658,7 @@ def get_largest_bounding_box(detections: sv.Detections) -> Tuple[int, int, int, def get_intersection_mask(detections: sv.Detections) -> np.ndarray: - return np.all(detections.mask, axis=0) + return np.logical_and.reduce(detections.mask, axis=0) def get_union_mask(detections: sv.Detections) -> np.ndarray: