Spaces:
Runtime error
Runtime error
change to hf_hub_download
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import os
|
2 |
-
|
3 |
import cv2
|
4 |
import paddlehub as hub
|
5 |
import gradio as gr
|
@@ -8,9 +8,17 @@ from PIL import Image, ImageOps
|
|
8 |
import numpy as np
|
9 |
import imageio
|
10 |
from moviepy.editor import *
|
11 |
-
|
12 |
-
os.
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
def get_frames(video_in):
|
16 |
frames = []
|
|
|
1 |
import os
|
2 |
+
from huggingface_hub import hf_hub_download
|
3 |
import cv2
|
4 |
import paddlehub as hub
|
5 |
import gradio as gr
|
|
|
8 |
import numpy as np
|
9 |
import imageio
|
10 |
from moviepy.editor import *
|
11 |
+
|
12 |
+
os.makedirs("models", exist_ok=True)
|
13 |
+
|
14 |
+
model_path = hf_hub_download(
|
15 |
+
repo_id="akhaliq/lama",
|
16 |
+
filename="best.ckpt",
|
17 |
+
local_dir="models" # This will download it directly into 'models' directory
|
18 |
+
)
|
19 |
+
|
20 |
+
|
21 |
+
print(f"Model downloaded to: {model_path}")
|
22 |
|
23 |
def get_frames(video_in):
|
24 |
frames = []
|