arxivgpt kim
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -207,63 +207,59 @@ footer {
|
|
| 207 |
"""
|
| 208 |
|
| 209 |
with gr.Blocks(css=css) as demo:
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
with gr.Row():
|
| 217 |
-
chosen_model = gr.Dropdown(label="Choose a model", choices=["MAGNet", "AudioLDM-2", "AudioGen", "Tango"], value="Tango")
|
| 218 |
-
submit_btn = gr.Button("Submit", scale=0)
|
| 219 |
-
with gr.Column():
|
| 220 |
-
caption_o = gr.Textbox(label="Scene caption", interactive=False)
|
| 221 |
-
retry_btn = gr.Button("Retry with edited scene caption", interactive=False)
|
| 222 |
-
audio_o = gr.Audio(label="Audio output")
|
| 223 |
with gr.Column():
|
| 224 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 225 |
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
)
|
| 238 |
|
| 239 |
video_in.change(
|
| 240 |
-
fn
|
| 241 |
-
inputs
|
| 242 |
-
outputs
|
| 243 |
-
queue
|
| 244 |
-
show_progress
|
| 245 |
)
|
| 246 |
|
| 247 |
video_in.clear(
|
| 248 |
-
fn
|
| 249 |
-
inputs
|
| 250 |
-
outputs
|
| 251 |
-
queue
|
| 252 |
-
show_progress
|
| 253 |
)
|
| 254 |
-
|
| 255 |
submit_btn.click(
|
| 256 |
fn=infer,
|
| 257 |
inputs=[video_in, chosen_model],
|
| 258 |
outputs=[caption_o, retry_btn, audio_o, video_o],
|
| 259 |
-
concurrency_limit
|
| 260 |
)
|
| 261 |
|
| 262 |
retry_btn.click(
|
| 263 |
fn=retry,
|
| 264 |
inputs=[caption_o, video_in, chosen_model],
|
| 265 |
outputs=[audio_o, video_o],
|
| 266 |
-
concurrency_limit
|
| 267 |
)
|
| 268 |
|
| 269 |
-
demo.queue(max_size=10).launch(show_api=False, debug=True, show_error=True)
|
|
|
|
| 207 |
"""
|
| 208 |
|
| 209 |
with gr.Blocks(css=css) as demo:
|
| 210 |
+
with gr.Row():
|
| 211 |
+
with gr.Column():
|
| 212 |
+
video_in = gr.Video(sources=["upload"], label="Video input")
|
| 213 |
+
with gr.Row():
|
| 214 |
+
chosen_model = gr.Dropdown(label="Choose a model", choices=["MAGNet", "AudioLDM-2", "AudioGen", "Tango"], value="Tango")
|
| 215 |
+
submit_btn = gr.Button("Submit", scale=0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 216 |
with gr.Column():
|
| 217 |
+
caption_o = gr.Textbox(label="Scene caption", interactive=False)
|
| 218 |
+
retry_btn = gr.Button("Retry with edited scene caption", interactive=False)
|
| 219 |
+
audio_o = gr.Audio(label="Audio output")
|
| 220 |
+
with gr.Column():
|
| 221 |
+
video_o = gr.Video(label="Video with soundFX")
|
| 222 |
|
| 223 |
+
gr.Examples(
|
| 224 |
+
examples=[
|
| 225 |
+
["examples/photoreal-train.mp4", "Tango"],
|
| 226 |
+
["examples/train-window.mp4", "Tango"],
|
| 227 |
+
["examples/chinese-new-year-dragon.mp4", "Tango"],
|
| 228 |
+
["examples/big-sur.mp4", "AudioLDM-2"]
|
| 229 |
+
],
|
| 230 |
+
fn=infer,
|
| 231 |
+
inputs=[video_in, chosen_model],
|
| 232 |
+
outputs=[caption_o, retry_btn, audio_o, video_o]
|
| 233 |
+
)
|
|
|
|
| 234 |
|
| 235 |
video_in.change(
|
| 236 |
+
fn=refresh,
|
| 237 |
+
inputs=None,
|
| 238 |
+
outputs=[caption_o, retry_btn, audio_o, video_o],
|
| 239 |
+
queue=False,
|
| 240 |
+
show_progress=False
|
| 241 |
)
|
| 242 |
|
| 243 |
video_in.clear(
|
| 244 |
+
fn=refresh,
|
| 245 |
+
inputs=None,
|
| 246 |
+
outputs=[caption_o, retry_btn, audio_o, video_o],
|
| 247 |
+
queue=False,
|
| 248 |
+
show_progress=False
|
| 249 |
)
|
| 250 |
+
|
| 251 |
submit_btn.click(
|
| 252 |
fn=infer,
|
| 253 |
inputs=[video_in, chosen_model],
|
| 254 |
outputs=[caption_o, retry_btn, audio_o, video_o],
|
| 255 |
+
concurrency_limit=2
|
| 256 |
)
|
| 257 |
|
| 258 |
retry_btn.click(
|
| 259 |
fn=retry,
|
| 260 |
inputs=[caption_o, video_in, chosen_model],
|
| 261 |
outputs=[audio_o, video_o],
|
| 262 |
+
concurrency_limit=2
|
| 263 |
)
|
| 264 |
|
| 265 |
+
demo.queue(max_size=10).launch(show_api=False, debug=True, show_error=True)
|