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)