Spaces:
Runtime error
Runtime error
cocktailpeanut
commited on
Commit
·
d2ba806
1
Parent(s):
bc3d254
update
Browse files
app.py
CHANGED
@@ -48,7 +48,7 @@ def fn(vid, bg_type="Color", bg_image=None, bg_video=None, color="#00FF00", fps=
|
|
48 |
|
49 |
# Process each frame for background removal
|
50 |
processed_frames = []
|
51 |
-
yield gr.update(visible=True), gr.update(visible=False)
|
52 |
|
53 |
if bg_type == "Video":
|
54 |
background_video = mp.VideoFileClip(bg_video)
|
@@ -99,13 +99,13 @@ def fn(vid, bg_type="Color", bg_image=None, bg_video=None, color="#00FF00", fps=
|
|
99 |
temp_filepath = os.path.join(temp_dir, unique_filename)
|
100 |
processed_video.write_videofile(temp_filepath, codec="libx264")
|
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 |
|
|
|
48 |
|
49 |
# Process each frame for background removal
|
50 |
processed_frames = []
|
51 |
+
# yield gr.update(visible=True), gr.update(visible=False)
|
52 |
|
53 |
if bg_type == "Video":
|
54 |
background_video = mp.VideoFileClip(bg_video)
|
|
|
99 |
temp_filepath = os.path.join(temp_dir, unique_filename)
|
100 |
processed_video.write_videofile(temp_filepath, codec="libx264")
|
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 |
|