diff --git a/ultralytics/__init__.py b/ultralytics/__init__.py index 94be8f8..4cbd5cb 100644 --- a/ultralytics/__init__.py +++ b/ultralytics/__init__.py @@ -1,6 +1,6 @@ # Ultralytics YOLO 🚀, AGPL-3.0 license -__version__ = '8.0.117' +__version__ = '8.0.118' from ultralytics.hub import start from ultralytics.vit.rtdetr import RTDETR diff --git a/ultralytics/yolo/utils/checks.py b/ultralytics/yolo/utils/checks.py index 8d862a5..03b5048 100644 --- a/ultralytics/yolo/utils/checks.py +++ b/ultralytics/yolo/utils/checks.py @@ -19,9 +19,9 @@ import requests import torch from matplotlib import font_manager -from ultralytics.yolo.utils import (AUTOINSTALL, LOGGER, ONLINE, RANK, ROOT, USER_CONFIG_DIR, TryExcept, clean_url, - colorstr, downloads, emojis, is_colab, is_docker, is_kaggle, is_online, - is_pip_package, url2file) +from ultralytics.yolo.utils import (AUTOINSTALL, LOGGER, ONLINE, ROOT, USER_CONFIG_DIR, TryExcept, clean_url, colorstr, + downloads, emojis, is_colab, is_docker, is_kaggle, is_online, is_pip_package, + url2file) def is_ascii(s) -> bool: @@ -164,26 +164,23 @@ def check_font(font='Arial.ttf'): Returns: file (Path): Resolved font file path. """ - from ultralytics.yolo.utils.torch_utils import torch_distributed_zero_first - - with torch_distributed_zero_first(RANK): - name = Path(font).name - - # Check USER_CONFIG_DIR - file = USER_CONFIG_DIR / name - if file.exists(): - return file - - # Check system fonts - matches = [s for s in font_manager.findSystemFonts() if font in s] - if any(matches): - return matches[0] - - # Download to USER_CONFIG_DIR if missing - url = f'https://ultralytics.com/assets/{name}' - if downloads.is_url(url): - downloads.safe_download(url=url, file=file) - return file + name = Path(font).name + + # Check USER_CONFIG_DIR + file = USER_CONFIG_DIR / name + if file.exists(): + return file + + # Check system fonts + matches = [s for s in font_manager.findSystemFonts() if font in s] + if any(matches): + return matches[0] + + # Download to USER_CONFIG_DIR if missing + url = f'https://ultralytics.com/assets/{name}' + if downloads.is_url(url): + downloads.safe_download(url=url, file=file) + return file def check_python(minimum: str = '3.7.0') -> bool: