From 905a21af8f491c8c83d969aa99d3699b6e055f71 Mon Sep 17 00:00:00 2001 From: luanhailiang Date: Thu, 21 Sep 2023 21:40:47 +0800 Subject: [PATCH] .... --- app.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index d1b8a2d..beececc 100644 --- a/app.py +++ b/app.py @@ -63,15 +63,18 @@ def worker(id,source,region=None,stream=False): try: cap = cv2.VideoCapture(source) if not cap.isOpened(): - print("Error opening video stream....") + print("Error opening video stream.") while True: 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 + print("Error opening 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]