H-Liu1997 commited on
Commit
3e5e0c1
1 Parent(s): 1164b79

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -476,7 +476,6 @@ character_name_to_yaml = {
476
 
477
  cfg = prepare_all("./configs/gradio.yaml")
478
  seed_everything(cfg.seed)
479
- experiment_ckpt_dir = experiment_log_dir = os.path.join(cfg.output_dir, cfg.exp_name)
480
 
481
  smplx_model = smplx.create(
482
  "./emage/smplx_models/",
@@ -501,7 +500,9 @@ state_dict = checkpoint['model_state_dict']
501
  model.load_state_dict(state_dict, strict=False)
502
 
503
  @spaces.GPU(duration=1000)
504
- def tango(audio_path, character_name, create_graph=False, video_folder_path=None):
 
 
505
  saved_audio_path = "./saved_audio.wav"
506
  sample_rate, audio_waveform = audio_path
507
  sf.write(saved_audio_path, audio_waveform, sample_rate)
@@ -563,8 +564,9 @@ examples_video = [
563
  ]
564
 
565
  combined_examples = [
566
- [audio, video] for audio in examples_audio for video in examples_video
567
  ]
 
568
  def make_demo():
569
  with gr.Blocks(analytics_enabled=False) as Interface:
570
  # First row: Audio upload and Audio examples with adjusted ratio
@@ -664,6 +666,7 @@ def make_demo():
664
 
665
  with gr.Row():
666
  with gr.Column(scale=4):
 
667
  gr.Examples(
668
  examples=combined_examples,
669
  inputs=[audio_input, video_input], # Both audio and video as inputs
 
476
 
477
  cfg = prepare_all("./configs/gradio.yaml")
478
  seed_everything(cfg.seed)
 
479
 
480
  smplx_model = smplx.create(
481
  "./emage/smplx_models/",
 
500
  model.load_state_dict(state_dict, strict=False)
501
 
502
  @spaces.GPU(duration=1000)
503
+ def tango(audio_path, character_name, create_graph=False, video_folder_path=None, smplx_model=smplx_model, model=model, cfg=cfg):
504
+
505
+ experiment_ckpt_dir = experiment_log_dir = os.path.join(cfg.output_dir, cfg.exp_name)
506
  saved_audio_path = "./saved_audio.wav"
507
  sample_rate, audio_waveform = audio_path
508
  sf.write(saved_audio_path, audio_waveform, sample_rate)
 
564
  ]
565
 
566
  combined_examples = [
567
+ [audio[0], video[0]] for audio in examples_audio for video in examples_video
568
  ]
569
+
570
  def make_demo():
571
  with gr.Blocks(analytics_enabled=False) as Interface:
572
  # First row: Audio upload and Audio examples with adjusted ratio
 
666
 
667
  with gr.Row():
668
  with gr.Column(scale=4):
669
+ print(combined_examples)
670
  gr.Examples(
671
  examples=combined_examples,
672
  inputs=[audio_input, video_input], # Both audio and video as inputs