mbar0075 commited on
Commit
aa20ceb
Β·
1 Parent(s): 82750d6

Minor Changes

Browse files
Files changed (1) hide show
  1. app.py +8 -8
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'>Detect Something πŸ’«</h1>
10
- Welcome to Detect Something! Just a simple demo to showcase the detection capabilities of various YOLOv8 models. πŸš€πŸ”πŸ‘€
11
 
12
- A simple project just for fun for on the go object detection. πŸŽ‰
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-640")
27
- YOLO_V8S_MODEL = get_model(model_id="yolov8s-640")
28
- YOLO_V8M_MODEL = get_model(model_id="yolov8m-640")
29
 
30
  LABEL_ANNOTATORS = sv.LabelAnnotator(text_color=sv.Color.black())
31
- BOUNDING_BOX_ANNOTATORS = sv.BoundingBoxAnnotator()
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 = BOUNDING_BOX_ANNOTATORS.annotate(
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)