🛠️ fix idx error in annotate

This commit is contained in:
SkalskiP 2023-03-23 13:43:03 +01:00
parent 420dae9e70
commit b2f6520b87
1 changed files with 1 additions and 1 deletions

View File

@ -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)