cccornflake commited on
Commit
82b84fc
·
verified ·
1 Parent(s): 337fa18

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -6,12 +6,13 @@ import os
6
 
7
  REPO_ID = 'vaivTA/yolov8x_doclaynet'
8
  FILENAME = "weights/best.pt"
9
- if not os.path.exists('./weights/best.pt') or not os.path.exists('./weights'):
10
 
11
- os.makedirs('./weights', exist_ok=True)
 
12
  print("download model...")
13
  hf_hub_download(repo_id=REPO_ID, filename=FILENAME)
14
- model = YOLO('./weights/best.pt')
15
 
16
  def infer(img_path):
17
  results = model(img_path)
 
6
 
7
  REPO_ID = 'vaivTA/yolov8x_doclaynet'
8
  FILENAME = "weights/best.pt"
9
+ if not os.path.exists('/home/user/app/weights/best.pt') or not os.path.exists('/home/user/app/weights'):
10
 
11
+ os.makedirs('/home/user/app/weights', exist_ok=True)
12
+ os.chdir('/home/user/app')
13
  print("download model...")
14
  hf_hub_download(repo_id=REPO_ID, filename=FILENAME)
15
+ model = YOLO('/home/user/app/weights/best.pt')
16
 
17
  def infer(img_path):
18
  results = model(img_path)