SpyC0der77 commited on
Commit
dec9875
·
verified ·
1 Parent(s): 2b55597

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
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 starts automatically and progress/logs update every 2 seconds.")
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
- # Automatically poll status every 2 seconds.
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()