ultralytics 8.0.191 fix yolo checks for missing packages (#5179)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Muhammad Rizwan Munawar <62513924+RizwanMunawar@users.noreply.github.com>
This commit is contained in:
parent
9aaa5d5ed0
commit
525c8b0294
17 changed files with 110 additions and 74 deletions
|
|
@ -917,6 +917,7 @@ def url2file(url):
|
|||
PREFIX = colorstr('Ultralytics: ')
|
||||
SETTINGS = SettingsManager() # initialize settings
|
||||
DATASETS_DIR = Path(SETTINGS['datasets_dir']) # global datasets directory
|
||||
WEIGHTS_DIR = Path(SETTINGS['weights_dir'])
|
||||
ENVIRONMENT = 'Colab' if is_colab() else 'Kaggle' if is_kaggle() else 'Jupyter' if is_jupyter() else \
|
||||
'Docker' if is_docker() else platform.system()
|
||||
TESTS_RUNNING = is_pytest_running() or is_github_actions_ci()
|
||||
|
|
|
|||
|
|
@ -36,13 +36,13 @@ import torch.cuda
|
|||
from ultralytics import YOLO
|
||||
from ultralytics.cfg import TASK2DATA, TASK2METRIC
|
||||
from ultralytics.engine.exporter import export_formats
|
||||
from ultralytics.utils import ASSETS, LINUX, LOGGER, MACOS, SETTINGS, TQDM
|
||||
from ultralytics.utils import ASSETS, LINUX, LOGGER, MACOS, TQDM, WEIGHTS_DIR
|
||||
from ultralytics.utils.checks import check_requirements, check_yolo
|
||||
from ultralytics.utils.files import file_size
|
||||
from ultralytics.utils.torch_utils import select_device
|
||||
|
||||
|
||||
def benchmark(model=Path(SETTINGS['weights_dir']) / 'yolov8n.pt',
|
||||
def benchmark(model=WEIGHTS_DIR / 'yolov8n.pt',
|
||||
data=None,
|
||||
imgsz=160,
|
||||
half=False,
|
||||
|
|
|
|||
|
|
@ -516,8 +516,12 @@ def collect_system_info():
|
|||
f"{'CUDA':<20}{torch.version.cuda if torch and torch.cuda.is_available() else None}\n")
|
||||
|
||||
for r in parse_requirements(package='ultralytics'):
|
||||
current = metadata.version(r.name)
|
||||
is_met = '✅ ' if check_version(current, str(r.specifier)) else '❌ '
|
||||
try:
|
||||
current = metadata.version(r.name)
|
||||
is_met = '✅ ' if check_version(current, str(r.specifier), hard=True) else '❌ '
|
||||
except metadata.PackageNotFoundError:
|
||||
current = '(not installed)'
|
||||
is_met = '❌ '
|
||||
LOGGER.info(f'{r.name:<20}{is_met}{current}{r.specifier}')
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue