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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -26,12 +26,12 @@ def inference(video, text):
26
  current_frame = 0
27
  # Read the current frame
28
  ret, frame = capture.read()
29
- while ret:
30
- if ret:
31
  ret,frame = capture.read()
32
  print('Read a new frame: ', ret)
33
  current_frame += 1
34
- video_frames.append(Image.fromarray(frame[:, :, ::-1]))
 
35
 
36
 
37
  # Print some statistics
 
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
33
+ if ret:
34
+ video_frames.append(Image.fromarray(frame[:, :, ::-1]))
35
 
36
 
37
  # Print some statistics