From e8ab777dfd5b49bb60e0e0ee6d90a75a22b85d09 Mon Sep 17 00:00:00 2001 From: Levi Vasconcelos Date: Thu, 15 Feb 2024 02:55:49 -0300 Subject: [PATCH] add multiple anchors support: use np.all --- supervision/detection/tools/polygon_zone.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervision/detection/tools/polygon_zone.py b/supervision/detection/tools/polygon_zone.py index 372db7a3..c02bcad8 100644 --- a/supervision/detection/tools/polygon_zone.py +++ b/supervision/detection/tools/polygon_zone.py @@ -69,7 +69,7 @@ class PolygonZone: ) is_in_zone = self.mask[all_clipped_anchors[:, :, 1], all_clipped_anchors[:, :, 0]].transpose().astype(bool) - is_in_zone = np.sum(is_in_zone, axis=1) == is_in_zone.shape[1] + is_in_zone = np.all(is_in_zone, axis=1) self.current_count = int(np.sum(is_in_zone)) return is_in_zone.astype(bool)