mbar0075 commited on
Commit
6110322
·
1 Parent(s): 268d0fa

Attempting Detection

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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'>Segment 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,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-seg-640")
25
- YOLO_V8S_MODEL = get_model(model_id="yolov8s-seg-640")
26
- YOLO_V8M_MODEL = get_model(model_id="yolov8m-seg-640")
27
 
28
  LABEL_ANNOTATORS = sv.LabelAnnotator(text_color=sv.Color.black())
29
- INSTANCE_SEGMENTATION_ANNOTATORS = sv.InstanceSegmentationAnnotator()
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 = INSTANCE_SEGMENTATION_ANNOTATORS.annotate(
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)