main
luanhailiang 2023-09-21 21:40:47 +08:00
parent 66d6e3a161
commit 905a21af8f
1 changed files with 6 additions and 3 deletions

7
app.py
View File

@ -63,14 +63,17 @@ 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.")
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)