From b2f6520b87ec3bf046e1d4fcbd651a497e5dbfe2 Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Thu, 23 Mar 2023 13:43:03 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20fix=20idx=20error=20in?= =?UTF-8?q?=20annotate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supervision/detection/annotate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervision/detection/annotate.py b/supervision/detection/annotate.py index de6e314f..f8bfff55 100644 --- a/supervision/detection/annotate.py +++ b/supervision/detection/annotate.py @@ -57,7 +57,7 @@ class BoxAnnotator: font = cv2.FONT_HERSHEY_SIMPLEX for i, (xyxy, confidence, class_id, tracker_id) in enumerate(detections): x1, y1, x2, y2 = xyxy.astype(int) - idx = class_id if not None else i + idx = class_id if class_id is not None else i color = ( self.color.by_idx(idx) if isinstance(self.color, ColorPalette)