fffiloni commited on
Commit
35ba670
·
verified ·
1 Parent(s): 3f23930

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -192,7 +192,7 @@ with gr.Blocks(css=css) as demo:
192
  driving_video = gr.Video(label="Driving Video")
193
  with gr.Group():
194
  with gr.Row():
195
- best_frame = gr.Number(value=36, label="Best Frame", info="specify the frame index in the driving video where the head pose best matches the source image (note: precision of best_frame index might affect the final quality)")
196
  out_frames = gr.Number(value=-1, label="Out Frames", info="number of generation frames")
197
  with gr.Accordion("Driving video Frames", open=False) as frames_gallery_panel:
198
  driving_frames = gr.Gallery(show_label=True, columns=6, height=380, elem_id="frames-gallery")
@@ -232,6 +232,13 @@ with gr.Blocks(css=css) as demo:
232
  outputs = [driving_video, driving_frames, frames_gallery_panel],
233
  queue = False
234
  )
 
 
 
 
 
 
 
235
 
236
  submit_btn.click(
237
  fn = run_xportrait,
 
192
  driving_video = gr.Video(label="Driving Video")
193
  with gr.Group():
194
  with gr.Row():
195
+ best_frame = gr.Number(value=18, label="Best Frame", info="specify the frame index in the driving video where the head pose best matches the source image (note: precision of best_frame index might affect the final quality)")
196
  out_frames = gr.Number(value=-1, label="Out Frames", info="number of generation frames")
197
  with gr.Accordion("Driving video Frames", open=False) as frames_gallery_panel:
198
  driving_frames = gr.Gallery(show_label=True, columns=6, height=380, elem_id="frames-gallery")
 
232
  outputs = [driving_video, driving_frames, frames_gallery_panel],
233
  queue = False
234
  )
235
+
236
+ driving_video.change(
237
+ fn = load_driving_video,
238
+ inputs = [driving_video],
239
+ outputs = [driving_video, driving_frames, frames_gallery_panel],
240
+ queue = False
241
+ )
242
 
243
  submit_btn.click(
244
  fn = run_xportrait,