Minimize GitHub assets API calls (#4523)
This commit is contained in:
parent
7e1f7a9d28
commit
a7419617a6
3 changed files with 23 additions and 29 deletions
|
|
@ -12,7 +12,7 @@ from ultralytics.nn.tasks import attempt_load_one_weight, guess_model_task, nn,
|
|||
from ultralytics.utils import (ASSETS, DEFAULT_CFG, DEFAULT_CFG_DICT, DEFAULT_CFG_KEYS, LOGGER, RANK, callbacks, emojis,
|
||||
yaml_load)
|
||||
from ultralytics.utils.checks import check_file, check_imgsz, check_pip_update_available, check_yaml
|
||||
from ultralytics.utils.downloads import GITHUB_ASSET_STEMS
|
||||
from ultralytics.utils.downloads import GITHUB_ASSETS_STEMS
|
||||
from ultralytics.utils.torch_utils import smart_inference_mode
|
||||
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ class Model:
|
|||
|
||||
# Load or create new YOLO model
|
||||
suffix = Path(model).suffix
|
||||
if not suffix and Path(model).stem in GITHUB_ASSET_STEMS:
|
||||
if not suffix and Path(model).stem in GITHUB_ASSETS_STEMS:
|
||||
model, suffix = Path(model).with_suffix('.pt'), '.pt' # add suffix, i.e. yolov8n -> yolov8n.pt
|
||||
if suffix in ('.yaml', '.yml'):
|
||||
self._new(model, task)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue