saicharan1234 commited on
Commit
614db49
1 Parent(s): abf7479

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -54,7 +54,7 @@ def run_inference(source_image, driving_audio, pose_weight, face_weight, lip_wei
54
  with gr.Blocks(theme='freddyaboulton/dracula_revamped@0.3.8') as demo:
55
  gr.Markdown(
56
  """
57
- # Talking Head Generation :🗣️📢
58
  Upload a face image and driving audio, and adjust the weights to generate a talking head video.
59
 
60
  > **Note:**
@@ -67,9 +67,9 @@ with gr.Blocks(theme='freddyaboulton/dracula_revamped@0.3.8') as demo:
67
 
68
  with gr.Row():
69
  with gr.Column():
70
- avatar_face = gr.Image(type="filepath", label="Face", elem_id="face-input").change(check_image_square, avatar_face)
71
- driving_audio = gr.Audio(type="filepath", label="Driving Audio", elem_id="audio-input").change(convert_audio_to_wav, driving_audio)
72
-
73
  with gr.Column():
74
  with gr.Accordion("Advanced Settings", open=False):
75
  pose_weight = gr.Slider(minimum=0.0, value=1.5, label="Pose Weight")
@@ -80,6 +80,9 @@ with gr.Blocks(theme='freddyaboulton/dracula_revamped@0.3.8') as demo:
80
  generate = gr.Button("Generate", elem_id="generate-button")
81
  output_video = gr.Video(label="Your Talking Head", elem_id="output-video")
82
 
 
 
 
83
  generate.click(
84
  fn=run_inference,
85
  inputs=[avatar_face, driving_audio, pose_weight, face_weight, lip_weight, face_expand_ratio],
 
54
  with gr.Blocks(theme='freddyaboulton/dracula_revamped@0.3.8') as demo:
55
  gr.Markdown(
56
  """
57
+ # Talking Head Generation
58
  Upload a face image and driving audio, and adjust the weights to generate a talking head video.
59
 
60
  > **Note:**
 
67
 
68
  with gr.Row():
69
  with gr.Column():
70
+ avatar_face = gr.Image(type="filepath", label="Face", elem_id="face-input")
71
+ driving_audio = gr.Audio(type="filepath", label="Driving Audio", elem_id="audio-input")
72
+
73
  with gr.Column():
74
  with gr.Accordion("Advanced Settings", open=False):
75
  pose_weight = gr.Slider(minimum=0.0, value=1.5, label="Pose Weight")
 
80
  generate = gr.Button("Generate", elem_id="generate-button")
81
  output_video = gr.Video(label="Your Talking Head", elem_id="output-video")
82
 
83
+ avatar_face.change(fn=check_image_square, inputs=avatar_face, outputs=avatar_face)
84
+ driving_audio.change(fn=convert_audio_to_wav, inputs=driving_audio, outputs=driving_audio)
85
+
86
  generate.click(
87
  fn=run_inference,
88
  inputs=[avatar_face, driving_audio, pose_weight, face_weight, lip_weight, face_expand_ratio],