🎨 [Update] the bouding box color
Browse files- yolo/tools/drawer.py +3 -3
yolo/tools/drawer.py
CHANGED
@@ -44,10 +44,10 @@ def draw_bboxes(
|
|
44 |
bbox = [(x_min, y_min), (x_max, y_max)]
|
45 |
|
46 |
random.seed(int(class_id))
|
47 |
-
color_map = (random.randint(0,
|
48 |
|
49 |
-
draw.rounded_rectangle(bbox, outline=(*color_map,
|
50 |
-
draw.rounded_rectangle(bbox, fill=(*color_map,
|
51 |
|
52 |
class_text = str(idx2label[int(class_id)] if idx2label else class_id)
|
53 |
label_text = f"{class_text}" + (f" {conf[0]: .0%}" if conf else "")
|
|
|
44 |
bbox = [(x_min, y_min), (x_max, y_max)]
|
45 |
|
46 |
random.seed(int(class_id))
|
47 |
+
color_map = (random.randint(0, 200), random.randint(0, 200), random.randint(0, 200))
|
48 |
|
49 |
+
draw.rounded_rectangle(bbox, outline=(*color_map, 200), radius=5, width=2)
|
50 |
+
draw.rounded_rectangle(bbox, fill=(*color_map, 100), radius=5)
|
51 |
|
52 |
class_text = str(idx2label[int(class_id)] if idx2label else class_id)
|
53 |
label_text = f"{class_text}" + (f" {conf[0]: .0%}" if conf else "")
|