Spaces:
Running
on
T4
Running
on
T4
Add markdown, add run on one click
Browse files
app.py
CHANGED
@@ -239,6 +239,13 @@ def reset_components():
|
|
239 |
|
240 |
|
241 |
with gr.Blocks() as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
242 |
original_frame_list = gr.State([])
|
243 |
mask_list = gr.State([])
|
244 |
# constants
|
@@ -251,7 +258,7 @@ with gr.Blocks() as demo:
|
|
251 |
with gr.Row():
|
252 |
first_frame = gr.ImageMask()
|
253 |
with gr.Row():
|
254 |
-
approve_mask = gr.Button(value="
|
255 |
with gr.Column(scale=1):
|
256 |
with gr.Row():
|
257 |
original_image = gr.Image(interactive=False)
|
@@ -260,18 +267,21 @@ with gr.Blocks() as demo:
|
|
260 |
with gr.Column(scale=2):
|
261 |
out_video = gr.Video()
|
262 |
out_video_inpaint = gr.Video()
|
263 |
-
track_mask = gr.Button(value="Track and Mask")
|
264 |
-
inpaint = gr.Button(value="Inpaint")
|
265 |
|
266 |
in_video.change(fn=get_first_frame, inputs=[
|
267 |
in_video], outputs=[first_frame])
|
268 |
in_video.clear(fn=reset_components, outputs=[first_frame, original_image, masked_image, original_frame_list, mask_list, in_fps, dt_string])
|
269 |
approve_mask.click(lambda x: [x['image'], x['mask']], first_frame, [
|
270 |
original_image, masked_image])
|
271 |
-
|
272 |
in_video, masked_image, original_frame_list, mask_list, in_fps, dt_string], outputs=[original_frame_list, mask_list, in_fps, out_video])
|
273 |
-
|
274 |
-
|
|
|
|
|
|
|
275 |
|
276 |
|
277 |
demo.launch(debug=True)
|
|
|
239 |
|
240 |
|
241 |
with gr.Blocks() as demo:
|
242 |
+
gr.Markdown(
|
243 |
+
"""
|
244 |
+
# Video Object Remover
|
245 |
+
Start uploading the video you wanted to edit.
|
246 |
+
Select the object you want to remove from the video.
|
247 |
+
Click on Run to start the process.
|
248 |
+
""")
|
249 |
original_frame_list = gr.State([])
|
250 |
mask_list = gr.State([])
|
251 |
# constants
|
|
|
258 |
with gr.Row():
|
259 |
first_frame = gr.ImageMask()
|
260 |
with gr.Row():
|
261 |
+
approve_mask = gr.Button(value="Run")
|
262 |
with gr.Column(scale=1):
|
263 |
with gr.Row():
|
264 |
original_image = gr.Image(interactive=False)
|
|
|
267 |
with gr.Column(scale=2):
|
268 |
out_video = gr.Video()
|
269 |
out_video_inpaint = gr.Video()
|
270 |
+
# track_mask = gr.Button(value="Track and Mask")
|
271 |
+
# inpaint = gr.Button(value="Inpaint")
|
272 |
|
273 |
in_video.change(fn=get_first_frame, inputs=[
|
274 |
in_video], outputs=[first_frame])
|
275 |
in_video.clear(fn=reset_components, outputs=[first_frame, original_image, masked_image, original_frame_list, mask_list, in_fps, dt_string])
|
276 |
approve_mask.click(lambda x: [x['image'], x['mask']], first_frame, [
|
277 |
original_image, masked_image])
|
278 |
+
masked_image.change(fn=track_and_mask,inputs=[
|
279 |
in_video, masked_image, original_frame_list, mask_list, in_fps, dt_string], outputs=[original_frame_list, mask_list, in_fps, out_video])
|
280 |
+
out_video.change(fn=inpaint_video, inputs=[original_frame_list, mask_list, in_fps, dt_string], outputs=[out_video_inpaint, original_frame_list, mask_list])
|
281 |
+
# track_mask.click(fn=track_and_mask, inputs=[
|
282 |
+
# in_video, masked_image, original_frame_list, mask_list, in_fps, dt_string], outputs=[original_frame_list, mask_list, in_fps, out_video])
|
283 |
+
# inpaint.click(fn=inpaint_video, inputs=[original_frame_list, mask_list, in_fps, dt_string],
|
284 |
+
# outputs=[out_video_inpaint, original_frame_list, mask_list])
|
285 |
|
286 |
|
287 |
demo.launch(debug=True)
|