Minor Changes
Browse files
app.py
CHANGED
@@ -6,10 +6,10 @@ import supervision as sv
|
|
6 |
from inference import get_model
|
7 |
|
8 |
MARKDOWN = """
|
9 |
-
<h1 style='text-align: center'>
|
10 |
-
Welcome to
|
11 |
|
12 |
-
A simple project just for fun for on the go
|
13 |
|
14 |
Inspired from YOLO-ARENA by SkalskiP. π
|
15 |
|
@@ -23,12 +23,12 @@ IMAGE_EXAMPLES = [
|
|
23 |
['https://media.roboflow.com/supervision/image-examples/basketball-1.png', 0.3, 0.3, 0.3],
|
24 |
]
|
25 |
|
26 |
-
YOLO_V8N_MODEL = get_model(model_id="yolov8n-
|
27 |
-
YOLO_V8S_MODEL = get_model(model_id="yolov8s-
|
28 |
-
YOLO_V8M_MODEL = get_model(model_id="yolov8m-
|
29 |
|
30 |
LABEL_ANNOTATORS = sv.LabelAnnotator(text_color=sv.Color.black())
|
31 |
-
|
32 |
|
33 |
|
34 |
def detect_and_annotate(
|
@@ -59,7 +59,7 @@ def detect_and_annotate(
|
|
59 |
]
|
60 |
|
61 |
annotated_image = input_image.copy()
|
62 |
-
annotated_image =
|
63 |
scene=annotated_image, detections=detections)
|
64 |
annotated_image = LABEL_ANNOTATORS.annotate(
|
65 |
scene=annotated_image, detections=detections, labels=labels)
|
|
|
6 |
from inference import get_model
|
7 |
|
8 |
MARKDOWN = """
|
9 |
+
<h1 style='text-align: center'>Segment Something πΌοΈ</h1>
|
10 |
+
Welcome to Segment Something! Just a simple demo to showcase the instance segmentation capabilities of various YOLOv8 segmentation models. πππ
|
11 |
|
12 |
+
A simple project just for fun for on the go instance segmentation. π
|
13 |
|
14 |
Inspired from YOLO-ARENA by SkalskiP. π
|
15 |
|
|
|
23 |
['https://media.roboflow.com/supervision/image-examples/basketball-1.png', 0.3, 0.3, 0.3],
|
24 |
]
|
25 |
|
26 |
+
YOLO_V8N_MODEL = get_model(model_id="yolov8n-seg.pt")
|
27 |
+
YOLO_V8S_MODEL = get_model(model_id="yolov8s-seg.pt")
|
28 |
+
YOLO_V8M_MODEL = get_model(model_id="yolov8m-seg.pt")
|
29 |
|
30 |
LABEL_ANNOTATORS = sv.LabelAnnotator(text_color=sv.Color.black())
|
31 |
+
MASK_ANNOTATORS = sv.MaskAnnotator()
|
32 |
|
33 |
|
34 |
def detect_and_annotate(
|
|
|
59 |
]
|
60 |
|
61 |
annotated_image = input_image.copy()
|
62 |
+
annotated_image = MASK_ANNOTATORS.annotate(
|
63 |
scene=annotated_image, detections=detections)
|
64 |
annotated_image = LABEL_ANNOTATORS.annotate(
|
65 |
scene=annotated_image, detections=detections, labels=labels)
|