sofianhw commited on
Commit
203648e
1 Parent(s): 2db16ac

change to hf_hub_download

Browse files
Files changed (1) hide show
  1. app.py +12 -4
app.py CHANGED
@@ -1,5 +1,5 @@
1
  import os
2
- os.system("wget https://huggingface.co/akhaliq/lama/resolve/main/best.ckpt")
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
- os.mkdir("data")
12
- os.rename("best.ckpt", "models/best.ckpt")
13
- os.mkdir("dataout")
 
 
 
 
 
 
 
 
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 = []