KingNish commited on
Commit
3d15a76
1 Parent(s): 26bcd6d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -45,7 +45,7 @@ def fn(vid, bg_type="Color", bg_image=None, color="#00FF00", fps=0):
45
  start_time = 0
46
 
47
  processed_frames = []
48
- yield gr.update(visible=True), gr.update(visible=False), gr.update(value=0)
49
 
50
  while start_time < total_duration:
51
  end_time = min(start_time + chunk_duration, total_duration)
@@ -69,9 +69,8 @@ def fn(vid, bg_type="Color", bg_image=None, color="#00FF00", fps=0):
69
 
70
  # Clear processed frames for the current chunk
71
  processed_frames = []
 
72
 
73
- # Update progress bar
74
- progress = start_time / total_duration
75
  yield None, None, gr.update(value=progress)
76
 
77
  start_time += chunk_duration
@@ -150,7 +149,7 @@ with gr.Blocks() as demo:
150
 
151
  bg_type.change(update_visibility, inputs=bg_type, outputs=[color_picker, bg_image])
152
 
153
- progress_bar = gr.ProgressBar(label="Processing Video")
154
 
155
  examples = gr.Examples(
156
  [["rickroll-2sec.mp4", "Image", "images.webp"], ["rickroll-2sec.mp4", "Color", None]],
 
45
  start_time = 0
46
 
47
  processed_frames = []
48
+ yield gr.update(visible=True), gr.update(visible=False), None
49
 
50
  while start_time < total_duration:
51
  end_time = min(start_time + chunk_duration, total_duration)
 
69
 
70
  # Clear processed frames for the current chunk
71
  processed_frames = []
72
+ progress = f'<div class="progress-container"><div class="progress-bar" style="--current: {start_time}; --total: {total_duration};"></div></div>'
73
 
 
 
74
  yield None, None, gr.update(value=progress)
75
 
76
  start_time += chunk_duration
 
149
 
150
  bg_type.change(update_visibility, inputs=bg_type, outputs=[color_picker, bg_image])
151
 
152
+ progress_bar = gr.Markdown(elem_id="progress")
153
 
154
  examples = gr.Examples(
155
  [["rickroll-2sec.mp4", "Image", "images.webp"], ["rickroll-2sec.mp4", "Color", None]],