Create model_loader.py
Browse files- utils/model_loader.py +9 -0
utils/model_loader.py
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from huggingface_hub import hf_hub_download
|
2 |
+
|
3 |
+
def load_model():
|
4 |
+
model_path = hf_hub_download(
|
5 |
+
repo_id="your-username/your-repo",
|
6 |
+
filename="best.pt",
|
7 |
+
revision="main"
|
8 |
+
)
|
9 |
+
return YOLO(model_path)
|