Spaces:
Running
Running
File size: 289 Bytes
2b848f3 |
1 2 3 4 5 6 7 8 9 10 11 |
from ultralytics import YOLO
model = YOLO("yolov8m.pt")
cap = cv2.VideoCapture(tfile.name)
while cap.isOpened():
ret, frame = cap.read()
if not ret:
break
results = model(frame)
annotated_frame = results[0].plot()
stframe.image(annotated_frame, channels="BGR") |