Skip to content

Commit

Permalink
added yolov8x download utils + update README.md (obss#898)
Browse files Browse the repository at this point in the history
Co-authored-by: fatih <[email protected]>
  • Loading branch information
pranavdurai10 and fcakyon authored Jun 10, 2023
1 parent df48856 commit 0414e47
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,4 +266,6 @@ python -m scripts.run_code_style format

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

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

</div>
16 changes: 16 additions & 0 deletions sahi/utils/yolov8.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ class Yolov8TestConstants:
YOLOV8M_MODEL_URL = "https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8l.pt"
YOLOV8M_MODEL_PATH = "tests/data/models/yolov8/yolov8l.pt"

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


def download_yolov8n_model(destination_path: Optional[str] = None):
if destination_path is None:
Expand Down Expand Up @@ -68,3 +71,16 @@ def download_yolov8l_model(destination_path: Optional[str] = None):
Yolov8TestConstants.YOLOV8L_MODEL_URL,
destination_path,
)


def download_yolov8x_model(destination_path: Optional[str] = None):
if destination_path is None:
destination_path = Yolov8TestConstants.YOLOV8X_MODEL_PATH

Path(destination_path).parent.mkdir(parents=True, exist_ok=True)

if not path.exists(destination_path):
urllib.request.urlretrieve(
Yolov8TestConstants.YOLOV8X_MODEL_URL,
destination_path,
)

0 comments on commit 0414e47

Please sign in to comment.