Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -56,7 +56,7 @@ def download_liveportrait():
|
|
| 56 |
print("Failed to initialize LivePortrait:", e)
|
| 57 |
raise
|
| 58 |
|
| 59 |
-
download_liveportrait()
|
| 60 |
|
| 61 |
|
| 62 |
def download_huggingface_resources():
|
|
@@ -85,7 +85,7 @@ def download_huggingface_resources():
|
|
| 85 |
print("General error in downloading resources:", e)
|
| 86 |
raise
|
| 87 |
|
| 88 |
-
download_huggingface_resources()
|
| 89 |
|
| 90 |
|
| 91 |
def get_project_root():
|
|
@@ -577,19 +577,19 @@ def compress_video(input_path, output_path, target_size_mb):
|
|
| 577 |
|
| 578 |
def process_video(video_file):
|
| 579 |
|
| 580 |
-
#
|
| 581 |
-
|
| 582 |
-
|
| 583 |
-
|
| 584 |
-
|
| 585 |
-
|
| 586 |
|
| 587 |
-
|
| 588 |
-
|
| 589 |
-
|
| 590 |
-
|
| 591 |
-
|
| 592 |
-
|
| 593 |
|
| 594 |
compressed_path = "./uploaded_video_compressed.mp4"
|
| 595 |
compress_video(video_file, compressed_path, target_size_mb=1)
|
|
|
|
| 56 |
print("Failed to initialize LivePortrait:", e)
|
| 57 |
raise
|
| 58 |
|
| 59 |
+
# download_liveportrait()
|
| 60 |
|
| 61 |
|
| 62 |
def download_huggingface_resources():
|
|
|
|
| 85 |
print("General error in downloading resources:", e)
|
| 86 |
raise
|
| 87 |
|
| 88 |
+
# download_huggingface_resources()
|
| 89 |
|
| 90 |
|
| 91 |
def get_project_root():
|
|
|
|
| 577 |
|
| 578 |
def process_video(video_file):
|
| 579 |
|
| 580 |
+
# εε§ε LivePortrait
|
| 581 |
+
try:
|
| 582 |
+
download_liveportrait()
|
| 583 |
+
except Exception as e:
|
| 584 |
+
print("Failed to initialize LivePortrait:", e)
|
| 585 |
+
return gr.update(value=None, visible=False)
|
| 586 |
|
| 587 |
+
# δΈθ½½ Hugging Face θ΅ζΊ
|
| 588 |
+
try:
|
| 589 |
+
download_huggingface_resources()
|
| 590 |
+
except Exception as e:
|
| 591 |
+
print("Failed to download Hugging Face resources:", e)
|
| 592 |
+
return gr.update(value=None, visible=False)
|
| 593 |
|
| 594 |
compressed_path = "./uploaded_video_compressed.mp4"
|
| 595 |
compress_video(video_file, compressed_path, target_size_mb=1)
|