From eef637cd04096c6e8eee029491c32ca7dfbe0173 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 21 May 2023 00:18:12 +0200 Subject: [PATCH] Update `check_requirements()` ROOT (#11557) --- classify/predict.py | 2 +- classify/val.py | 2 +- data/Objects365.yaml | 2 +- detect.py | 2 +- hubconf.py | 4 ++-- segment/predict.py | 2 +- segment/val.py | 2 +- val.py | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/classify/predict.py b/classify/predict.py index c1b6650d4bd0..9b64810d4d63 100644 --- a/classify/predict.py +++ b/classify/predict.py @@ -217,7 +217,7 @@ def parse_opt(): def main(opt): - check_requirements(exclude=('tensorboard', 'thop')) + check_requirements(ROOT / 'requirements.txt', exclude=('tensorboard', 'thop')) run(**vars(opt)) diff --git a/classify/val.py b/classify/val.py index 643489d64d36..4b92e9f105db 100644 --- a/classify/val.py +++ b/classify/val.py @@ -161,7 +161,7 @@ def parse_opt(): def main(opt): - check_requirements(exclude=('tensorboard', 'thop')) + check_requirements(ROOT / 'requirements.txt', exclude=('tensorboard', 'thop')) run(**vars(opt)) diff --git a/data/Objects365.yaml b/data/Objects365.yaml index bb2aa34cd4a4..990f5a56b39e 100644 --- a/data/Objects365.yaml +++ b/data/Objects365.yaml @@ -388,7 +388,7 @@ download: | from utils.general import Path, check_requirements, download, np, xyxy2xywhn - check_requirements(('pycocotools>=2.0',)) + check_requirements('pycocotools>=2.0') from pycocotools.coco import COCO # Make Directories diff --git a/detect.py b/detect.py index 64d6f149a614..216c9dbd5880 100644 --- a/detect.py +++ b/detect.py @@ -252,7 +252,7 @@ def parse_opt(): def main(opt): - check_requirements(exclude=('tensorboard', 'thop')) + check_requirements(ROOT / 'requirements.txt', exclude=('tensorboard', 'thop')) run(**vars(opt)) diff --git a/hubconf.py b/hubconf.py index 73caf06685da..f0192698fbe3 100644 --- a/hubconf.py +++ b/hubconf.py @@ -34,12 +34,12 @@ def _create(name, pretrained=True, channels=3, classes=80, autoshape=True, verbo from models.experimental import attempt_load from models.yolo import ClassificationModel, DetectionModel, SegmentationModel from utils.downloads import attempt_download - from utils.general import LOGGER, check_requirements, intersect_dicts, logging + from utils.general import LOGGER, ROOT, check_requirements, intersect_dicts, logging from utils.torch_utils import select_device if not verbose: LOGGER.setLevel(logging.WARNING) - check_requirements(exclude=('opencv-python', 'tensorboard', 'thop')) + check_requirements(ROOT / 'requirements.txt', exclude=('opencv-python', 'tensorboard', 'thop')) name = Path(name) path = name.with_suffix('.pt') if name.suffix == '' and not name.is_dir() else name # checkpoint path try: diff --git a/segment/predict.py b/segment/predict.py index 4d4d6036358a..6a4d5eff3fc1 100644 --- a/segment/predict.py +++ b/segment/predict.py @@ -275,7 +275,7 @@ def parse_opt(): def main(opt): - check_requirements(exclude=('tensorboard', 'thop')) + check_requirements(ROOT / 'requirements.txt', exclude=('tensorboard', 'thop')) run(**vars(opt)) diff --git a/segment/val.py b/segment/val.py index c0575fd59a91..dc8081840e37 100644 --- a/segment/val.py +++ b/segment/val.py @@ -434,7 +434,7 @@ def parse_opt(): def main(opt): - check_requirements(requirements=ROOT / 'requirements.txt', exclude=('tensorboard', 'thop')) + check_requirements(ROOT / 'requirements.txt', exclude=('tensorboard', 'thop')) if opt.task in ('train', 'val', 'test'): # run normally if opt.conf_thres > 0.001: # https://github.com/ultralytics/yolov5/issues/1466 diff --git a/val.py b/val.py index 3d01f1a5996d..71268651d29b 100644 --- a/val.py +++ b/val.py @@ -370,7 +370,7 @@ def parse_opt(): def main(opt): - check_requirements(exclude=('tensorboard', 'thop')) + check_requirements(ROOT / 'requirements.txt', exclude=('tensorboard', 'thop')) if opt.task in ('train', 'val', 'test'): # run normally if opt.conf_thres > 0.001: # https://github.com/ultralytics/yolov5/issues/1466