cocktailpeanut commited on
Commit
3e685a6
1 Parent(s): d2ba806
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -84,7 +84,7 @@ def fn(vid, bg_type="Color", bg_image=None, bg_video=None, color="#00FF00", fps=
84
  processed_image = pil_image # Default to original image if no background is selected
85
 
86
  processed_frames.append(np.array(processed_image))
87
- yield processed_image, None
88
 
89
  # Create a new video from the processed frames
90
  processed_video = mp.ImageSequenceClip(processed_frames, fps=fps)
@@ -101,12 +101,14 @@ def fn(vid, bg_type="Color", bg_image=None, bg_video=None, color="#00FF00", fps=
101
 
102
  # yield gr.update(visible=False), gr.update(visible=True)
103
  # Return the path to the temporary file
104
- yield processed_image, temp_filepath
 
105
 
106
  except Exception as e:
107
  print(f"Error: {e}")
108
  # yield gr.update(visible=False), gr.update(visible=True)
109
- yield None, f"Error processing video: {e}"
 
110
 
111
 
112
 
 
84
  processed_image = pil_image # Default to original image if no background is selected
85
 
86
  processed_frames.append(np.array(processed_image))
87
+ # yield processed_image, None
88
 
89
  # Create a new video from the processed frames
90
  processed_video = mp.ImageSequenceClip(processed_frames, fps=fps)
 
101
 
102
  # yield gr.update(visible=False), gr.update(visible=True)
103
  # Return the path to the temporary file
104
+ # yield processed_image, temp_filepath
105
+ return processed_image, temp_filepath
106
 
107
  except Exception as e:
108
  print(f"Error: {e}")
109
  # yield gr.update(visible=False), gr.update(visible=True)
110
+ #yield None, f"Error processing video: {e}"
111
+ return None, f"Error processing video: {e}"
112
 
113
 
114