Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -71,7 +71,7 @@ DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
| 71 |
EFFICIENT_SAM_MODEL = load(device=DEVICE)
|
| 72 |
YOLO_WORLD_MODEL = YOLOWorld(model_id="yolo_world/l")
|
| 73 |
|
| 74 |
-
|
| 75 |
MASK_ANNOTATOR = sv.MaskAnnotator()
|
| 76 |
LABEL_ANNOTATOR = sv.LabelAnnotator()
|
| 77 |
|
|
@@ -99,7 +99,7 @@ def annotate_image(
|
|
| 99 |
zip(detections.class_id, detections.confidence)
|
| 100 |
]
|
| 101 |
output_image = MASK_ANNOTATOR.annotate(input_image, detections)
|
| 102 |
-
output_image =
|
| 103 |
output_image = LABEL_ANNOTATOR.annotate(output_image, detections, labels=labels)
|
| 104 |
return output_image
|
| 105 |
|
|
|
|
| 71 |
EFFICIENT_SAM_MODEL = load(device=DEVICE)
|
| 72 |
YOLO_WORLD_MODEL = YOLOWorld(model_id="yolo_world/l")
|
| 73 |
|
| 74 |
+
BOX_ANNOTATOR = sv.BoxAnnotator()
|
| 75 |
MASK_ANNOTATOR = sv.MaskAnnotator()
|
| 76 |
LABEL_ANNOTATOR = sv.LabelAnnotator()
|
| 77 |
|
|
|
|
| 99 |
zip(detections.class_id, detections.confidence)
|
| 100 |
]
|
| 101 |
output_image = MASK_ANNOTATOR.annotate(input_image, detections)
|
| 102 |
+
output_image = BOX_ANNOTATOR.annotate(output_image, detections)
|
| 103 |
output_image = LABEL_ANNOTATOR.annotate(output_image, detections, labels=labels)
|
| 104 |
return output_image
|
| 105 |
|