Update app.py
Browse files
app.py
CHANGED
@@ -30,13 +30,13 @@ def draw_annotations(index):
|
|
30 |
# Draw bounding box with color based on category
|
31 |
bbox = record["bbox"]
|
32 |
category_id = record["category_id"]
|
33 |
-
box_color = CATEGORY_COLORS.get(category_id, "yellow") # Default to
|
34 |
draw.rectangle([bbox[0], bbox[1], bbox[0] + bbox[2], bbox[1] + bbox[3]], outline=box_color, width=2)
|
35 |
|
36 |
# Draw segmentation mask
|
37 |
segmentation = record["segmentation"]
|
38 |
for seg in segmentation:
|
39 |
-
draw.polygon(seg, outline="
|
40 |
|
41 |
# Prepare additional information
|
42 |
area = record["area"]
|
|
|
30 |
# Draw bounding box with color based on category
|
31 |
bbox = record["bbox"]
|
32 |
category_id = record["category_id"]
|
33 |
+
box_color = CATEGORY_COLORS.get(category_id, "yellow") # Default to yellow if category not in mapping
|
34 |
draw.rectangle([bbox[0], bbox[1], bbox[0] + bbox[2], bbox[1] + bbox[3]], outline=box_color, width=2)
|
35 |
|
36 |
# Draw segmentation mask
|
37 |
segmentation = record["segmentation"]
|
38 |
for seg in segmentation:
|
39 |
+
draw.polygon(seg, outline="red", width=2)
|
40 |
|
41 |
# Prepare additional information
|
42 |
area = record["area"]
|