Merge branch 'main' into yolov9

pull/8571/head
Glenn Jocher 9 months ago committed by GitHub
commit 5d87d28178
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      ultralytics/hub/__init__.py
  2. 2
      ultralytics/hub/auth.py
  3. 6
      ultralytics/models/yolo/model.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

@ -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):
"""

@ -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:

Loading…
Cancel
Save