6Morpheus6 commited on
Commit
fb17e0e
·
verified ·
1 Parent(s): ce0b7dc

gradio compatibility

Browse files

- fix compatibility issue with latest gradio version
- fix ffmpeg error "FFmpeg cannot edit existing files in-place"

Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -55,7 +55,7 @@ def sadtalker_demo():
55
  with gr.Tabs(elem_id="sadtalker_source_image"):
56
  with gr.TabItem('Source image'):
57
  with gr.Row():
58
- source_image = gr.Image(label="Source image", source="upload", type="filepath", elem_id="img2img_image") # .style(width=512)
59
 
60
 
61
  with gr.Tabs(elem_id="sadtalker_driven_audio"):
@@ -63,8 +63,8 @@ def sadtalker_demo():
63
  gr.Markdown("Possible driving combinations: <br> 1. Audio only 2. Audio/IDLE Mode + Ref Video(pose, blink, pose+blink) 3. IDLE Mode only 4. Ref Video only (all) ")
64
 
65
  with gr.Row():
66
- driven_audio = gr.Audio(label="Input audio", source="upload", type="filepath", max_length=180) # 180s
67
- driven_audio_no = gr.Audio(label="Use IDLE mode, no audio is required", source="upload", type="filepath", visible=False)
68
 
69
  with gr.Column():
70
  use_idle_mode = gr.Checkbox(label="Use Idle Animation")
@@ -72,7 +72,7 @@ def sadtalker_demo():
72
  use_idle_mode.change(toggle_audio_file, inputs=use_idle_mode, outputs=[driven_audio, driven_audio_no]) # todo
73
 
74
  with gr.Row():
75
- ref_video = gr.Video(label="Reference Video", source="upload", type="filepath", elem_id="vidref") # .style(width=512)
76
 
77
  with gr.Column():
78
  use_ref_video = gr.Checkbox(label="Use Reference Video")
@@ -108,7 +108,7 @@ def sadtalker_demo():
108
  submit = gr.Button('Generate', elem_id="sadtalker_generate", variant='primary')
109
 
110
  with gr.Tabs(elem_id="sadtalker_genearted"):
111
- gen_video = gr.Video(label="Generated video", format="mp4", scale=1) # .style(width=256)
112
 
113
 
114
 
@@ -219,5 +219,3 @@ if __name__ == "__main__":
219
  demo = sadtalker_demo()
220
  demo.queue(max_size=10, api_open=True)
221
  demo.launch(debug=True)
222
-
223
-
 
55
  with gr.Tabs(elem_id="sadtalker_source_image"):
56
  with gr.TabItem('Source image'):
57
  with gr.Row():
58
+ source_image = gr.Image(label="Source image", sources="upload", type="filepath", elem_id="img2img_image") # .style(width=512)
59
 
60
 
61
  with gr.Tabs(elem_id="sadtalker_driven_audio"):
 
63
  gr.Markdown("Possible driving combinations: <br> 1. Audio only 2. Audio/IDLE Mode + Ref Video(pose, blink, pose+blink) 3. IDLE Mode only 4. Ref Video only (all) ")
64
 
65
  with gr.Row():
66
+ driven_audio = gr.Audio(label="Input audio", sources="upload", type="filepath", max_length=180) # 180s
67
+ driven_audio_no = gr.Audio(label="Use IDLE mode, no audio is required", sources="upload", type="filepath", visible=False)
68
 
69
  with gr.Column():
70
  use_idle_mode = gr.Checkbox(label="Use Idle Animation")
 
72
  use_idle_mode.change(toggle_audio_file, inputs=use_idle_mode, outputs=[driven_audio, driven_audio_no]) # todo
73
 
74
  with gr.Row():
75
+ ref_video = gr.Video(label="Reference Video", sources="upload", elem_id="vidref") # .style(width=512)
76
 
77
  with gr.Column():
78
  use_ref_video = gr.Checkbox(label="Use Reference Video")
 
108
  submit = gr.Button('Generate', elem_id="sadtalker_generate", variant='primary')
109
 
110
  with gr.Tabs(elem_id="sadtalker_genearted"):
111
+ gen_video = gr.Video(label="Generated video", scale=1) # .style(width=256)
112
 
113
 
114
 
 
219
  demo = sadtalker_demo()
220
  demo.queue(max_size=10, api_open=True)
221
  demo.launch(debug=True)