Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -95,20 +95,6 @@ def process(image, color_hex):
|
|
95 |
return image, mask # Return both the processed image and the mask
|
96 |
|
97 |
|
98 |
-
def process_file(f, color="#00FF00"):
|
99 |
-
name_path = f.rsplit(".", 1)[0] + ".png"
|
100 |
-
im = load_img(f, output_type="pil")
|
101 |
-
im = im.convert("RGB")
|
102 |
-
transparent = process(im, color)
|
103 |
-
transparent.save(name_path)
|
104 |
-
return name_path
|
105 |
-
|
106 |
-
|
107 |
-
def change_color(in_video, fps_slider, color_picker):
|
108 |
-
no_bg_video_path, changed_bg_video_path = fn(in_video, fps_slider, color_picker)
|
109 |
-
return no_bg_video_path, changed_bg_video_path
|
110 |
-
|
111 |
-
|
112 |
with gr.Blocks() as demo:
|
113 |
with gr.Row():
|
114 |
in_video = gr.Video(label="Input Video")
|
@@ -121,7 +107,7 @@ with gr.Blocks() as demo:
|
|
121 |
|
122 |
|
123 |
submit_button.click(
|
124 |
-
|
125 |
)
|
126 |
|
127 |
if __name__ == "__main__":
|
|
|
95 |
return image, mask # Return both the processed image and the mask
|
96 |
|
97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
with gr.Blocks() as demo:
|
99 |
with gr.Row():
|
100 |
in_video = gr.Video(label="Input Video")
|
|
|
107 |
|
108 |
|
109 |
submit_button.click(
|
110 |
+
fn, inputs=[in_video, fps_slider, color_picker], outputs=[no_bg_video, out_video]
|
111 |
)
|
112 |
|
113 |
if __name__ == "__main__":
|