Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
| 579 |
-
except Exception as e:
|
| 580 |
-
|
| 581 |
-
|
| 582 |
|
| 583 |
-
|
| 584 |
-
try:
|
| 585 |
-
|
| 586 |
-
except Exception as e:
|
| 587 |
-
|
| 588 |
-
|
| 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)
|