Spaces:
Running
on
L40S
Running
on
L40S
Update gradio_app.py
Browse files- gradio_app.py +25 -10
gradio_app.py
CHANGED
@@ -95,21 +95,41 @@ def infer(input_video, input_mask):
|
|
95 |
|
96 |
torch.cuda.empty_cache()
|
97 |
|
98 |
-
return output_path
|
99 |
|
100 |
with gr.Blocks() as demo:
|
101 |
|
102 |
with gr.Column():
|
103 |
-
gr.Markdown("# DiffuEraser")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
|
105 |
with gr.Row():
|
106 |
|
107 |
with gr.Column():
|
108 |
|
109 |
-
input_video = gr.Video(label="Input Video (MP4 ONLY")
|
110 |
-
input_mask = gr.Video(label="Input Mask Video (MP4 ONLY")
|
111 |
submit_btn = gr.Button("Submit")
|
112 |
|
|
|
|
|
|
|
113 |
gr.Examples(
|
114 |
examples = [
|
115 |
["./examples/example1/video.mp4", "./examples/example1/mask.mp4"],
|
@@ -119,16 +139,11 @@ with gr.Blocks() as demo:
|
|
119 |
inputs = [input_video, input_mask]
|
120 |
)
|
121 |
|
122 |
-
with gr.Column():
|
123 |
-
|
124 |
-
video_result = gr.Video(label="Result")
|
125 |
-
priori_result = gr.Video(label="ProPainter pass")
|
126 |
-
|
127 |
|
128 |
submit_btn.click(
|
129 |
fn = infer,
|
130 |
inputs = [input_video, input_mask],
|
131 |
-
outputs = [video_result
|
132 |
)
|
133 |
|
134 |
demo.queue().launch(show_api=False, show_error=True)
|
|
|
95 |
|
96 |
torch.cuda.empty_cache()
|
97 |
|
98 |
+
return output_path
|
99 |
|
100 |
with gr.Blocks() as demo:
|
101 |
|
102 |
with gr.Column():
|
103 |
+
gr.Markdown("# DiffuEraser: A Diffusion Model for Video Inpainting")
|
104 |
+
gr.Markdown("DiffuEraser is a diffusion model for video inpainting, which outperforms state-of-the-art model Propainter in both content completeness and temporal consistency while maintaining acceptable efficiency.")
|
105 |
+
gr.HTML("""
|
106 |
+
<div style="display:flex;column-gap:4px;">
|
107 |
+
<a href="https://github.com/lixiaowen-xw/DiffuEraser">
|
108 |
+
<img src='https://img.shields.io/badge/GitHub-Repo-blue'>
|
109 |
+
</a>
|
110 |
+
<a href="https://lixiaowen-xw.github.io/DiffuEraser-page">
|
111 |
+
<img src='https://img.shields.io/badge/Project-Page-green'>
|
112 |
+
</a>
|
113 |
+
<a href="https://lixiaowen-xw.github.io/DiffuEraser-page">
|
114 |
+
<img src='https://img.shields.io/badge/ArXiv-Paper-red'>
|
115 |
+
</a>
|
116 |
+
<a href="https://huggingface.co/spaces/fffiloni/DiffuEraser-demo?duplicate=true">
|
117 |
+
<img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/duplicate-this-space-sm.svg" alt="Duplicate this Space">
|
118 |
+
</a>
|
119 |
+
</div>
|
120 |
+
""")
|
121 |
|
122 |
with gr.Row():
|
123 |
|
124 |
with gr.Column():
|
125 |
|
126 |
+
input_video = gr.Video(label="Input Video (MP4 ONLY)")
|
127 |
+
input_mask = gr.Video(label="Input Mask Video (MP4 ONLY)")
|
128 |
submit_btn = gr.Button("Submit")
|
129 |
|
130 |
+
with gr.Column():
|
131 |
+
|
132 |
+
video_result = gr.Video(label="Result")
|
133 |
gr.Examples(
|
134 |
examples = [
|
135 |
["./examples/example1/video.mp4", "./examples/example1/mask.mp4"],
|
|
|
139 |
inputs = [input_video, input_mask]
|
140 |
)
|
141 |
|
|
|
|
|
|
|
|
|
|
|
142 |
|
143 |
submit_btn.click(
|
144 |
fn = infer,
|
145 |
inputs = [input_video, input_mask],
|
146 |
+
outputs = [video_result]
|
147 |
)
|
148 |
|
149 |
demo.queue().launch(show_api=False, show_error=True)
|