Xuanyou commited on
Commit
1245425
·
verified ·
1 Parent(s): 3c8f777

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -13
app.py CHANGED
@@ -55,7 +55,7 @@ def download_liveportrait():
55
  except Exception as e:
56
  print("Failed to initialize LivePortrait:", e)
57
  raise
58
-
59
 
60
  def download_huggingface_resources():
61
  """
@@ -83,6 +83,7 @@ def download_huggingface_resources():
83
  print("General error in downloading resources:", e)
84
  raise
85
 
 
86
 
87
  def get_project_root():
88
  """Get the root directory of the current project."""
@@ -573,19 +574,19 @@ def compress_video(input_path, output_path, target_size_mb):
573
 
574
  def process_video(video_file):
575
 
576
- # 初始化 LivePortrait
577
- try:
578
- download_liveportrait()
579
- except Exception as e:
580
- print("Failed to initialize LivePortrait:", e)
581
- return gr.update(value=None, visible=False)
582
 
583
- # 下载 Hugging Face 资源
584
- try:
585
- download_huggingface_resources()
586
- except Exception as e:
587
- print("Failed to download Hugging Face resources:", e)
588
- return gr.update(value=None, visible=False)
589
 
590
  compressed_path = "./uploaded_video_compressed.mp4"
591
  compress_video(video_file, compressed_path, target_size_mb=1)
 
55
  except Exception as e:
56
  print("Failed to initialize LivePortrait:", e)
57
  raise
58
+ download_liveportrait()
59
 
60
  def download_huggingface_resources():
61
  """
 
83
  print("General error in downloading resources:", e)
84
  raise
85
 
86
+ download_huggingface_resources()
87
 
88
  def get_project_root():
89
  """Get the root directory of the current project."""
 
574
 
575
  def process_video(video_file):
576
 
577
+ # # 初始化 LivePortrait
578
+ # try:
579
+ # download_liveportrait()
580
+ # except Exception as e:
581
+ # print("Failed to initialize LivePortrait:", e)
582
+ # return gr.update(value=None, visible=False)
583
 
584
+ # # 下载 Hugging Face 资源
585
+ # try:
586
+ # download_huggingface_resources()
587
+ # except Exception as e:
588
+ # print("Failed to download Hugging Face resources:", e)
589
+ # return gr.update(value=None, visible=False)
590
 
591
  compressed_path = "./uploaded_video_compressed.mp4"
592
  compress_video(video_file, compressed_path, target_size_mb=1)