Skip to content

Commit 0414e47

Browse files
added yolov8x download utils + update README.md (#898)
Co-authored-by: fatih <34196005+fcakyon@users.noreply.github.com>
1 parent df48856 commit 0414e47

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,4 +266,6 @@ python -m scripts.run_code_style format
266266

267267
<a align="left" href="https://github.com/aynursusuz" target="_blank">Aynur Susuz</a>
268268

269-
</div>
269+
<a align="left" href="https://github.com/pranavdurai10" target="_blank">Pranav Durai</a>
270+
271+
</div>

sahi/utils/yolov8.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ class Yolov8TestConstants:
1717
YOLOV8M_MODEL_URL = "https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8l.pt"
1818
YOLOV8M_MODEL_PATH = "tests/data/models/yolov8/yolov8l.pt"
1919

20+
YOLOV8M_MODEL_URL = "https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8x.pt"
21+
YOLOV8M_MODEL_PATH = "tests/data/models/yolov8/yolov8x.pt"
22+
2023

2124
def download_yolov8n_model(destination_path: Optional[str] = None):
2225
if destination_path is None:
@@ -68,3 +71,16 @@ def download_yolov8l_model(destination_path: Optional[str] = None):
6871
Yolov8TestConstants.YOLOV8L_MODEL_URL,
6972
destination_path,
7073
)
74+
75+
76+
def download_yolov8x_model(destination_path: Optional[str] = None):
77+
if destination_path is None:
78+
destination_path = Yolov8TestConstants.YOLOV8X_MODEL_PATH
79+
80+
Path(destination_path).parent.mkdir(parents=True, exist_ok=True)
81+
82+
if not path.exists(destination_path):
83+
urllib.request.urlretrieve(
84+
Yolov8TestConstants.YOLOV8X_MODEL_URL,
85+
destination_path,
86+
)

0 commit comments

Comments
 (0)