From 7f69f6a1682bf101c96b6c91e7fd953aea0b9b2e Mon Sep 17 00:00:00 2001 From: fdloopes Date: Mon, 30 Oct 2023 10:26:09 -0300 Subject: [PATCH] Add np.maximum when retrieving detections coordinates within the BlurAnnotator.annotate() method. --- supervision/annotators/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervision/annotators/core.py b/supervision/annotators/core.py index 95cea69e..45da5e72 100644 --- a/supervision/annotators/core.py +++ b/supervision/annotators/core.py @@ -892,7 +892,7 @@ class BlurAnnotator(BaseAnnotator): supervision-annotator-examples/blur-annotator-example-purple.png) """ for detection_idx in range(len(detections)): - x1, y1, x2, y2 = detections.xyxy[detection_idx].astype(int) + x1, y1, x2, y2 = np.maximum(detections.xyxy[detection_idx].astype(int),0) roi = scene[y1:y2, x1:x2] roi = cv2.blur(roi, (self.kernel_size, self.kernel_size))