Skip to content

Commit b95194c

Browse files
committed
update yolo model path
1 parent 1705b51 commit b95194c

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

core/load_model.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import open_clip
23
from ultralytics import YOLO
34
from rembg import new_session
@@ -6,7 +7,6 @@
67
from .config import DEVICE, MODEL_NAME, PRETRAINED, CLOTH_LABELS, RECORD_LABELS ,PROMPTS
78
from huggingface_hub import hf_hub_download
89

9-
model_path = hf_hub_download(repo_id="swwho/Fashion-YOLO", filename="fashion_2.pt")
1010

1111
# --- 전역 변수 (Global State) ---
1212
GLOBAL_MODEL = None
@@ -77,16 +77,17 @@ def load_clip_model():
7777

7878

7979

80-
def load_yolo_model(model_path: str = model_path):
80+
def load_yolo_model():
8181
"""
8282
YOLO 모델을 로드 함수
8383
"""
8484
global GLOBAL_YOLO_MODEL
8585

8686
if GLOBAL_YOLO_MODEL is not None:
8787
return GLOBAL_YOLO_MODEL
88-
89-
print(f"Loading YOLO model from: {model_path}...")
88+
hf_token = os.getenv("HF_TOKEN")
89+
model_path = hf_hub_download(repo_id="swwho/Fashion-YOLO", repo_type="model", filename="fashion_2.pt", token=hf_token)
90+
print(f"Loading YOLO model from huggingface...")
9091

9192
try:
9293
yolo_model = YOLO(model_path)

0 commit comments

Comments
 (0)