amirgame197 commited on
Commit
6e756ce
·
verified ·
1 Parent(s): 5cb9d7a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -12,8 +12,6 @@ def doo(video):
12
 
13
  processed_frames = [] # List to store processed frames
14
 
15
- frame_index = 0 # Initialize frame index
16
-
17
  while cap.isOpened():
18
  ret, frame = cap.read() # Read video
19
 
@@ -33,13 +31,12 @@ def doo(video):
33
  if processed_frame.shape[2] != 3:
34
  raise ValueError("Processed frame does not have 3 channels (RGB)")
35
 
36
- # Append the processed frame (as a tuple) to the list
37
- processed_frames.append((frame_index, processed_frame))
38
- frame_index += 1
39
 
40
  cap.release()
41
 
42
- # Return the list of processed frames
43
  return processed_frames
44
 
45
  iface = gr.Interface(fn=doo, inputs="video", outputs="video")
 
12
 
13
  processed_frames = [] # List to store processed frames
14
 
 
 
15
  while cap.isOpened():
16
  ret, frame = cap.read() # Read video
17
 
 
31
  if processed_frame.shape[2] != 3:
32
  raise ValueError("Processed frame does not have 3 channels (RGB)")
33
 
34
+ # Append the processed frame to the list
35
+ processed_frames.append(processed_frame)
 
36
 
37
  cap.release()
38
 
39
+ # Return the list of processed frames (as NumPy arrays)
40
  return processed_frames
41
 
42
  iface = gr.Interface(fn=doo, inputs="video", outputs="video")