Update app.py
Browse files
app.py
CHANGED
@@ -218,7 +218,7 @@ def poll_status():
|
|
218 |
# Build the Gradio UI.
|
219 |
with gr.Blocks() as demo:
|
220 |
gr.Markdown("# AI-Powered Video Stabilization")
|
221 |
-
gr.Markdown("Upload a video and select a zoom factor. Processing
|
222 |
|
223 |
with gr.Row():
|
224 |
with gr.Column():
|
@@ -233,8 +233,7 @@ with gr.Blocks() as demo:
|
|
233 |
|
234 |
# When "Process Video" is clicked, start processing in the background.
|
235 |
start_button.click(fn=start_processing, inputs=[video_input, zoom_slider], outputs=[logs_output])
|
236 |
-
|
237 |
-
|
238 |
-
auto_poll = gr.Autoupdate(interval=2000, function=poll_status, outputs=[original_video, stabilized_video, logs_output, progress_bar])
|
239 |
|
240 |
demo.launch()
|
|
|
218 |
# Build the Gradio UI.
|
219 |
with gr.Blocks() as demo:
|
220 |
gr.Markdown("# AI-Powered Video Stabilization")
|
221 |
+
gr.Markdown("Upload a video and select a zoom factor. Processing will start automatically and the UI will update every 2 seconds.")
|
222 |
|
223 |
with gr.Row():
|
224 |
with gr.Column():
|
|
|
233 |
|
234 |
# When "Process Video" is clicked, start processing in the background.
|
235 |
start_button.click(fn=start_processing, inputs=[video_input, zoom_slider], outputs=[logs_output])
|
236 |
+
# Automatically poll status every 2 seconds using Blocks.load().
|
237 |
+
demo.load(fn=poll_status, inputs=[], outputs=[original_video, stabilized_video, logs_output, progress_bar], every=2)
|
|
|
238 |
|
239 |
demo.launch()
|