mbar0075 commited on
Commit
f56f1f3
·
1 Parent(s): 550f206

ADDED Bounding Box Functionality

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -29,6 +29,7 @@ YOLO_V8M_MODEL = get_model(model_id="yolov8m-seg-640")
29
 
30
  LABEL_ANNOTATORS = sv.LabelAnnotator(text_color=sv.Color.black())
31
  MASK_ANNOTATORS = sv.MaskAnnotator()
 
32
 
33
 
34
  def detect_and_annotate(
@@ -61,6 +62,8 @@ def detect_and_annotate(
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)
66
  return annotated_image
 
29
 
30
  LABEL_ANNOTATORS = sv.LabelAnnotator(text_color=sv.Color.black())
31
  MASK_ANNOTATORS = sv.MaskAnnotator()
32
+ BOUNDING_BOX_ANNOTATORS = sv.BoundingBoxAnnotator()
33
 
34
 
35
  def detect_and_annotate(
 
62
  annotated_image = input_image.copy()
63
  annotated_image = MASK_ANNOTATORS.annotate(
64
  scene=annotated_image, detections=detections)
65
+ annotated_image = BOUNDING_BOX_ANNOTATORS.annotate(
66
+ scene=annotated_image, detections=detections)
67
  annotated_image = LABEL_ANNOTATORS.annotate(
68
  scene=annotated_image, detections=detections, labels=labels)
69
  return annotated_image