From 0b485f8f2c3e60cb045c2c50ecd7efd39e9c0edc Mon Sep 17 00:00:00 2001 From: fcakyon <34196005+fcakyon@users.noreply.github.com> Date: Sat, 3 Jul 2021 03:12:17 +0300 Subject: [PATCH] remove `check_requirements` (#37) * remove `check_requirements` * update to v0.5.7 --- yolov5/__init__.py | 2 +- yolov5/detect.py | 4 ++-- yolov5/export.py | 4 ++-- yolov5/hubconf.py | 6 +++--- yolov5/test.py | 6 +++--- yolov5/train.py | 4 ++-- yolov5/utils/datasets.py | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/yolov5/__init__.py b/yolov5/__init__.py index ed5584c..b97f6a5 100644 --- a/yolov5/__init__.py +++ b/yolov5/__init__.py @@ -1,4 +1,4 @@ from yolov5.helpers import YOLOv5 from yolov5.helpers import load_model as load -__version__ = "5.0.6" +__version__ = "5.0.7" diff --git a/yolov5/detect.py b/yolov5/detect.py index 4405571..e878c6a 100644 --- a/yolov5/detect.py +++ b/yolov5/detect.py @@ -16,7 +16,7 @@ from yolov5.models.experimental import attempt_load from yolov5.utils.datasets import LoadStreams, LoadImages -from yolov5.utils.general import check_img_size, check_requirements, check_imshow, colorstr, non_max_suppression, \ +from yolov5.utils.general import check_img_size, check_imshow, colorstr, non_max_suppression, \ apply_classifier, scale_coords, xyxy2xywh, strip_optimizer, set_logging, increment_path, save_one_box, yolov5_in_syspath from yolov5.utils.plots import colors, plot_one_box from yolov5.utils.torch_utils import select_device, load_classifier, time_synchronized @@ -213,7 +213,7 @@ def parse_opt(): def main(): opt = parse_opt() print(colorstr('detect: ') + ', '.join(f'{k}={v}' for k, v in vars(opt).items())) - check_requirements(exclude=('tensorboard', 'thop')) + #check_requirements(exclude=('tensorboard', 'thop')) run(**vars(opt)) diff --git a/yolov5/export.py b/yolov5/export.py index 37fc035..9235339 100644 --- a/yolov5/export.py +++ b/yolov5/export.py @@ -17,7 +17,7 @@ from yolov5.models.yolo import Detect from yolov5.models.experimental import attempt_load from yolov5.utils.activations import Hardswish, SiLU -from yolov5.utils.general import colorstr, check_img_size, check_requirements, file_size, set_logging +from yolov5.utils.general import colorstr, check_img_size, file_size, set_logging from yolov5.utils.torch_utils import select_device @@ -106,7 +106,7 @@ def run(weights='./yolov5s.pt', # weights path # Simplify if simplify: try: - check_requirements(['onnx-simplifier']) + #check_requirements(['onnx-simplifier']) import onnxsim print(f'{prefix} simplifying with onnx-simplifier {onnxsim.__version__}...') diff --git a/yolov5/hubconf.py b/yolov5/hubconf.py index b0fee2c..03f6571 100644 --- a/yolov5/hubconf.py +++ b/yolov5/hubconf.py @@ -26,12 +26,12 @@ def _create(name, pretrained=True, channels=3, classes=80, autoshape=True, verbo from pathlib import Path from yolov5.models.yolo import Model, attempt_load - from yolov5.utils.general import check_requirements, set_logging, yolov5_in_syspath + from yolov5.utils.general import set_logging, yolov5_in_syspath from yolov5.utils.google_utils import attempt_download from yolov5.utils.torch_utils import select_device - check_requirements(requirements=Path(__file__).parent / 'requirements.txt', - exclude=('tensorboard', 'thop', 'opencv-python')) + #check_requirements(requirements=Path(__file__).parent / 'requirements.txt', + # exclude=('tensorboard', 'thop', 'opencv-python')) set_logging(verbose=verbose) fname = Path(name).with_suffix('.pt') # checkpoint filename diff --git a/yolov5/test.py b/yolov5/test.py index c6ed276..f61c6f9 100644 --- a/yolov5/test.py +++ b/yolov5/test.py @@ -19,7 +19,7 @@ from yolov5.models.experimental import attempt_load from yolov5.utils.datasets import create_dataloader -from yolov5.utils.general import coco80_to_coco91_class, check_dataset, check_file, check_img_size, check_requirements, \ +from yolov5.utils.general import coco80_to_coco91_class, check_dataset, check_file, check_img_size, \ box_iou, non_max_suppression, scale_coords, xyxy2xywh, xywh2xyxy, set_logging, increment_path, colorstr from yolov5.utils.metrics import ap_per_class, ConfusionMatrix from yolov5.utils.plots import plot_images, output_to_target, plot_study_txt @@ -274,7 +274,7 @@ def run(data, json.dump(jdict, f) try: # https://github.com/cocodataset/cocoapi/blob/master/PythonAPI/pycocoEvalDemo.ipynb - check_requirements(['pycocotools']) + #check_requirements(['pycocotools']) from pycocotools.coco import COCO from pycocotools.cocoeval import COCOeval @@ -333,7 +333,7 @@ def main(): opt = parse_opt() set_logging() print(colorstr('test: ') + ', '.join(f'{k}={v}' for k, v in vars(opt).items())) - check_requirements(exclude=('tensorboard', 'thop')) + #check_requirements(exclude=('tensorboard', 'thop')) if opt.task in ('train', 'val', 'test'): # run normally run(**vars(opt)) diff --git a/yolov5/train.py b/yolov5/train.py index 2933dba..bc9f885 100644 --- a/yolov5/train.py +++ b/yolov5/train.py @@ -37,7 +37,7 @@ from yolov5.utils.datasets import create_dataloader from yolov5.utils.general import labels_to_class_weights, increment_path, labels_to_image_weights, init_seeds, \ fitness, strip_optimizer, get_latest_run, check_dataset, check_file, check_git_status, check_img_size, \ - check_requirements, print_mutation, set_logging, one_cycle, colorstr, yolov5_in_syspath + print_mutation, set_logging, one_cycle, colorstr, yolov5_in_syspath from yolov5.utils.google_utils import attempt_download from yolov5.utils.loss import ComputeLoss from yolov5.utils.plots import plot_images, plot_labels, plot_results, plot_evolution @@ -549,7 +549,7 @@ def main(opt): if RANK in [-1, 0]: print(colorstr('train: ') + ', '.join(f'{k}={v}' for k, v in vars(opt).items())) check_git_status() - check_requirements(exclude=['thop']) + #check_requirements(exclude=['thop']) # Resume wandb_run = check_wandb_resume(opt) diff --git a/yolov5/utils/datasets.py b/yolov5/utils/datasets.py index 3b2db41..30a9736 100755 --- a/yolov5/utils/datasets.py +++ b/yolov5/utils/datasets.py @@ -23,7 +23,7 @@ from torch.utils.data import Dataset from tqdm import tqdm -from yolov5.utils.general import check_requirements, check_file, check_dataset, xyxy2xywh, xywh2xyxy, xywhn2xyxy, xyn2xy, \ +from yolov5.utils.general import check_file, check_dataset, xyxy2xywh, xywh2xyxy, xywhn2xyxy, xyn2xy, \ segment2box, segments2boxes, resample_segments, clean_str, yolov5_in_syspath from yolov5.utils.torch_utils import torch_distributed_zero_first @@ -283,7 +283,7 @@ def __init__(self, sources='streams.txt', img_size=640, stride=32): # Start thread to read frames from video stream print(f'{i + 1}/{n}: {s}... ', end='') if 'youtube.com/' in s or 'youtu.be/' in s: # if source is YouTube video - check_requirements(('pafy', 'youtube_dl')) + #check_requirements(('pafy', 'youtube_dl')) import pafy s = pafy.new(s).getbest(preftype="mp4").url # YouTube URL s = eval(s) if s.isnumeric() else s # i.e. s = '0' local webcam