์ „์›ํ‘œ commited on
Commit
62e4927
ยท
2 Parent(s): 381164a 66ffe62

add code to download the model downloading from hf

Browse files
Files changed (2) hide show
  1. app.py +5 -1
  2. models/best.pt +0 -3
app.py CHANGED
@@ -1,9 +1,13 @@
1
  import gradio as gr
2
  import PIL.Image as Image
3
  from ultralytics import YOLO
 
4
 
5
 
6
- model = YOLO('./models/best.pt')
 
 
 
7
 
8
  def infer(img_path):
9
  results = model(img_path)
 
1
  import gradio as gr
2
  import PIL.Image as Image
3
  from ultralytics import YOLO
4
+ from huggingface_hub import hf_hub_download
5
 
6
 
7
+ REPO_ID = 'vaivTA/yolov8x_doclaynet'
8
+ FILENAME = "weights/best.pt"
9
+ hf_hub_download(repo_id=REPO_ID, filename=FILENAME)
10
+ model = YOLO('./weights/best.pt')
11
 
12
  def infer(img_path):
13
  results = model(img_path)
models/best.pt DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:1dd302218b154d57bb4971bb9c5908d64484af51703a90bd427377841a481811
3
- size 6258543