Spaces:
Running
on
T4
Running
on
T4
fix colors
Browse files
app.py
CHANGED
|
@@ -61,6 +61,7 @@ def detect_and_annotate(
|
|
| 61 |
text_scale = sv.calculate_optimal_text_scale(resolution_wh=resolution_wh) - 0.2
|
| 62 |
thickness = sv.calculate_optimal_line_thickness(resolution_wh=resolution_wh)
|
| 63 |
|
|
|
|
| 64 |
bbox_annotator = sv.BoxAnnotator(color=COLOR, thickness=thickness)
|
| 65 |
label_annotator = sv.LabelAnnotator(
|
| 66 |
color=COLOR,
|
|
@@ -73,12 +74,11 @@ def detect_and_annotate(
|
|
| 73 |
for class_id, confidence
|
| 74 |
in zip(detections.class_id, detections.confidence)
|
| 75 |
]
|
| 76 |
-
|
| 77 |
annotated_image = image.copy()
|
| 78 |
annotated_image = bbox_annotator.annotate(annotated_image, detections)
|
| 79 |
annotated_image = label_annotator.annotate(annotated_image, detections, labels)
|
| 80 |
if checkpoint == "segmentation preview":
|
| 81 |
-
mask_annotator = sv.MaskAnnotator()
|
| 82 |
annotated_image = mask_annotator.annotate(annotated_image, detections)
|
| 83 |
return annotated_image
|
| 84 |
|
|
|
|
| 61 |
text_scale = sv.calculate_optimal_text_scale(resolution_wh=resolution_wh) - 0.2
|
| 62 |
thickness = sv.calculate_optimal_line_thickness(resolution_wh=resolution_wh)
|
| 63 |
|
| 64 |
+
mask_annotator = sv.MaskAnnotator(color=COLOR)
|
| 65 |
bbox_annotator = sv.BoxAnnotator(color=COLOR, thickness=thickness)
|
| 66 |
label_annotator = sv.LabelAnnotator(
|
| 67 |
color=COLOR,
|
|
|
|
| 74 |
for class_id, confidence
|
| 75 |
in zip(detections.class_id, detections.confidence)
|
| 76 |
]
|
| 77 |
+
print(detections)
|
| 78 |
annotated_image = image.copy()
|
| 79 |
annotated_image = bbox_annotator.annotate(annotated_image, detections)
|
| 80 |
annotated_image = label_annotator.annotate(annotated_image, detections, labels)
|
| 81 |
if checkpoint == "segmentation preview":
|
|
|
|
| 82 |
annotated_image = mask_annotator.annotate(annotated_image, detections)
|
| 83 |
return annotated_image
|
| 84 |
|