Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
| 3 |
import subprocess
|
|
@@ -7,6 +8,11 @@ import torch
|
|
| 7 |
import imageio
|
| 8 |
import cv2
|
| 9 |
import numpy as np
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
from first_order_model import load_checkpoints, make_animation
|
| 11 |
|
| 12 |
# Define model download links
|
|
@@ -38,7 +44,6 @@ def load_fomm_model():
|
|
| 38 |
"""
|
| 39 |
Loads the pre-trained First Order Motion Model.
|
| 40 |
"""
|
| 41 |
-
# Load the model checkpoint
|
| 42 |
print("Loading First Order Motion Model...")
|
| 43 |
generator, kp_detector = load_checkpoints(
|
| 44 |
config_path='configs/vox-256.yaml',
|
|
|
|
| 1 |
+
import sys
|
| 2 |
import gradio as gr
|
| 3 |
import os
|
| 4 |
import subprocess
|
|
|
|
| 8 |
import imageio
|
| 9 |
import cv2
|
| 10 |
import numpy as np
|
| 11 |
+
|
| 12 |
+
# Ensure the path to the first-order-model directory is added to sys.path
|
| 13 |
+
sys.path.append('/path/to/first-order-model') # Replace with the actual path where FOMM is located
|
| 14 |
+
|
| 15 |
+
# Now import the required functions
|
| 16 |
from first_order_model import load_checkpoints, make_animation
|
| 17 |
|
| 18 |
# Define model download links
|
|
|
|
| 44 |
"""
|
| 45 |
Loads the pre-trained First Order Motion Model.
|
| 46 |
"""
|
|
|
|
| 47 |
print("Loading First Order Motion Model...")
|
| 48 |
generator, kp_detector = load_checkpoints(
|
| 49 |
config_path='configs/vox-256.yaml',
|