main
luanhailiang 2023-09-21 21:20:07 +08:00
parent 12dc967902
commit 1f3a751600
1 changed files with 5 additions and 1 deletions

4
app.py
View File

@ -68,7 +68,11 @@ def worker(id,source,region=None,stream=False):
ret, frame = cap.read()
if not ret:
print("Error read video stream.")
cap = cv2.VideoCapture(source)
if not cap.isOpened():
print("Error opening video stream.")
break
continue
result = model.track(frame,show=False,stream=False,persist=True,device=int(id)%4)
result = result[0]
detections = sv.Detections.from_yolov8(result)