From e138d701a0df99eed43c83b7a63671a5c1c43656 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 4 Mar 2024 01:08:41 +0100 Subject: [PATCH] `ultralytics 8.1.22` HUB model `pathlib` fix (#8621) Signed-off-by: Glenn Jocher --- ultralytics/__init__.py | 2 +- ultralytics/hub/__init__.py | 2 +- ultralytics/hub/auth.py | 2 +- ultralytics/models/yolo/model.py | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ultralytics/__init__.py b/ultralytics/__init__.py index 81a263efd..e65cb8a89 100644 --- a/ultralytics/__init__.py +++ b/ultralytics/__init__.py @@ -1,6 +1,6 @@ # Ultralytics YOLO 🚀, AGPL-3.0 license -__version__ = "8.1.21" +__version__ = "8.1.22" from ultralytics.data.explorer.explorer import Explorer from ultralytics.models import RTDETR, SAM, YOLO, YOLOWorld diff --git a/ultralytics/hub/__init__.py b/ultralytics/hub/__init__.py index 6c8afc6f7..b46bea408 100644 --- a/ultralytics/hub/__init__.py +++ b/ultralytics/hub/__init__.py @@ -48,7 +48,7 @@ def login(api_key: str = None, save=True) -> bool: return True else: # Failed to authenticate with HUB - LOGGER.info(f"{PREFIX}Retrieve API key from {api_key_url}") + LOGGER.info(f"{PREFIX}Get API key from {api_key_url} and then run 'yolo hub login API_KEY'") return False diff --git a/ultralytics/hub/auth.py b/ultralytics/hub/auth.py index 340f58413..6ede3035b 100644 --- a/ultralytics/hub/auth.py +++ b/ultralytics/hub/auth.py @@ -64,7 +64,7 @@ class Auth: if verbose: LOGGER.info(f"{PREFIX}New authentication successful ✅") elif verbose: - LOGGER.info(f"{PREFIX}Retrieve API key from {API_KEY_URL}") + LOGGER.info(f"{PREFIX}Get API key from {API_KEY_URL} and then run 'yolo hub login API_KEY'") def request_api_key(self, max_attempts=3): """ diff --git a/ultralytics/models/yolo/model.py b/ultralytics/models/yolo/model.py index 5a2dc24f1..3a6445f45 100644 --- a/ultralytics/models/yolo/model.py +++ b/ultralytics/models/yolo/model.py @@ -13,9 +13,9 @@ class YOLO(Model): def __init__(self, model="yolov8n.pt", task=None, verbose=False): """Initialize YOLO model, switching to YOLOWorld if model filename contains '-world'.""" - model = Path(model) - if "-world" in model.stem and model.suffix in {".pt", ".yaml", ".yml"}: # if YOLOWorld PyTorch model - new_instance = YOLOWorld(model) + path = Path(model) + if "-world" in path.stem and path.suffix in {".pt", ".yaml", ".yml"}: # if YOLOWorld PyTorch model + new_instance = YOLOWorld(path) self.__class__ = type(new_instance) self.__dict__ = new_instance.__dict__ else: