ultralytics 8.2.66 HUB model autodownload (#14702)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
1d5d105c62
commit
9130399974
5 changed files with 14 additions and 11 deletions
|
|
@ -17,6 +17,7 @@ from ultralytics.utils import (
|
|||
DEFAULT_CFG_DICT,
|
||||
LOGGER,
|
||||
RANK,
|
||||
SETTINGS,
|
||||
callbacks,
|
||||
checks,
|
||||
emojis,
|
||||
|
|
@ -286,7 +287,7 @@ class Model(nn.Module):
|
|||
>>> model._load('path/to/weights.pth', task='detect')
|
||||
"""
|
||||
if weights.lower().startswith(("https://", "http://", "rtsp://", "rtmp://", "tcp://")):
|
||||
weights = checks.check_file(weights) # automatically download and return local filename
|
||||
weights = checks.check_file(weights, download_dir=SETTINGS["weights_dir"]) # download and return local file
|
||||
weights = checks.check_model_file_from_stem(weights) # add suffix, i.e. yolov8n -> yolov8n.pt
|
||||
|
||||
if Path(weights).suffix == ".pt":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue