Ahsen Khaliq commited on
Commit
2c40e64
1 Parent(s): 2f4e6e2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -26,7 +26,7 @@ def inference(video, text):
26
  current_frame = 0
27
  # Read the current frame
28
  ret, frame = capture.read()
29
- while capture.isOpened():
30
  ret,frame = capture.read()
31
  print('Read a new frame: ', ret)
32
  current_frame += 1
 
26
  current_frame = 0
27
  # Read the current frame
28
  ret, frame = capture.read()
29
+ while capture.isOpened() and ret:
30
  ret,frame = capture.read()
31
  print('Read a new frame: ', ret)
32
  current_frame += 1