Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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()
|