Attempting Detection
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ import supervision as sv
|
|
6 |
from inference import get_model
|
7 |
|
8 |
MARKDOWN = """
|
9 |
-
<h1 style='text-align: center'>
|
10 |
Welcome to Segment Something! Your on the go demo for instance segmentation. 🚀
|
11 |
|
12 |
<h2 style='text-align: center'>Matthias Bartolo</h2>
|
@@ -21,12 +21,12 @@ IMAGE_EXAMPLES = [
|
|
21 |
['https://media.roboflow.com/supervision/image-examples/basketball-1.png', 0.3, 0.3, 0.1],
|
22 |
]
|
23 |
|
24 |
-
YOLO_V8N_MODEL = get_model(model_id="yolov8n-
|
25 |
-
YOLO_V8S_MODEL = get_model(model_id="yolov8s-
|
26 |
-
YOLO_V8M_MODEL = get_model(model_id="yolov8m-
|
27 |
|
28 |
LABEL_ANNOTATORS = sv.LabelAnnotator(text_color=sv.Color.black())
|
29 |
-
|
30 |
|
31 |
|
32 |
def detect_and_annotate(
|
@@ -57,7 +57,7 @@ def detect_and_annotate(
|
|
57 |
]
|
58 |
|
59 |
annotated_image = input_image.copy()
|
60 |
-
annotated_image =
|
61 |
scene=annotated_image, detections=detections)
|
62 |
annotated_image = LABEL_ANNOTATORS.annotate(
|
63 |
scene=annotated_image, detections=detections, labels=labels)
|
|
|
6 |
from inference import get_model
|
7 |
|
8 |
MARKDOWN = """
|
9 |
+
<h1 style='text-align: center'>Detect Something 💫</h1>
|
10 |
Welcome to Segment Something! Your on the go demo for instance segmentation. 🚀
|
11 |
|
12 |
<h2 style='text-align: center'>Matthias Bartolo</h2>
|
|
|
21 |
['https://media.roboflow.com/supervision/image-examples/basketball-1.png', 0.3, 0.3, 0.1],
|
22 |
]
|
23 |
|
24 |
+
YOLO_V8N_MODEL = get_model(model_id="yolov8n-640")
|
25 |
+
YOLO_V8S_MODEL = get_model(model_id="yolov8s-640")
|
26 |
+
YOLO_V8M_MODEL = get_model(model_id="yolov8m-640")
|
27 |
|
28 |
LABEL_ANNOTATORS = sv.LabelAnnotator(text_color=sv.Color.black())
|
29 |
+
BOUNDING_BOX_ANNOTATORS = sv.BoundingBoxAnnotator()
|
30 |
|
31 |
|
32 |
def detect_and_annotate(
|
|
|
57 |
]
|
58 |
|
59 |
annotated_image = input_image.copy()
|
60 |
+
annotated_image = BOUNDING_BOX_ANNOTATORS.annotate(
|
61 |
scene=annotated_image, detections=detections)
|
62 |
annotated_image = LABEL_ANNOTATORS.annotate(
|
63 |
scene=annotated_image, detections=detections, labels=labels)
|