tree3po commited on
Commit
e4dfe6c
·
verified ·
1 Parent(s): 825c042

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -56,7 +56,13 @@ def stream_object_detection(video):
56
  result = model(Image.fromarray(frame))[0]
57
  detections = sv.Detections.from_ultralytics(result)
58
  print(detections)
59
- outp = draw_box(frame,detections)
 
 
 
 
 
 
60
  frame = np.array(outp)
61
  # Convert RGB to BGR
62
  frame = frame[:, :, ::-1].copy()
 
56
  result = model(Image.fromarray(frame))[0]
57
  detections = sv.Detections.from_ultralytics(result)
58
  print(detections)
59
+
60
+ box_annotator = sv.BoxAnnotator()
61
+ outp = box_annotator.annotate(
62
+ scene=frame.copy(),
63
+ detections=detections)
64
+
65
+ #outp = draw_box(frame,detections)
66
  frame = np.array(outp)
67
  # Convert RGB to BGR
68
  frame = frame[:, :, ::-1].copy()