From 6420a1db87460d36fd2141a65659093df27c1996 Mon Sep 17 00:00:00 2001 From: Mohammed Yasin <32206511+Y-T-G@users.noreply.github.com> Date: Mon, 13 Jan 2025 02:05:20 +0800 Subject: [PATCH 1/4] Fix TFLite Segment inference (#13488) * Fix TFLite Segment inference * Auto-format by https://ultralytics.com --------- Co-authored-by: UltralyticsAssistant --- models/common.py | 3 +++ utils/dataloaders.py | 6 +++--- utils/general.py | 6 +++--- utils/loggers/clearml/clearml_utils.py | 8 +++++--- utils/torch_utils.py | 6 +++--- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/models/common.py b/models/common.py index 8ad53d5d1..1ae3280f9 100644 --- a/models/common.py +++ b/models/common.py @@ -750,6 +750,9 @@ class DetectMultiBackend(nn.Module): scale, zero_point = output["quantization"] x = (x.astype(np.float32) - zero_point) * scale # re-scale y.append(x) + if len(y) == 2: # segment with (det, proto) output order reversed + if len(y[1].shape) != 4: + y = list(reversed(y)) # should be y = (1, 116, 8400), (1, 160, 160, 32) y = [x if isinstance(x, np.ndarray) else x.numpy() for x in y] y[0][..., :4] *= [w, h, w, h] # xywh normalized to pixels diff --git a/utils/dataloaders.py b/utils/dataloaders.py index fc5da6bff..082404833 100644 --- a/utils/dataloaders.py +++ b/utils/dataloaders.py @@ -355,9 +355,9 @@ class LoadImages: self._new_video(videos[0]) # new video else: self.cap = None - assert self.nf > 0, ( - f"No images or videos found in {p}. Supported formats are:\nimages: {IMG_FORMATS}\nvideos: {VID_FORMATS}" - ) + assert ( + self.nf > 0 + ), f"No images or videos found in {p}. Supported formats are:\nimages: {IMG_FORMATS}\nvideos: {VID_FORMATS}" def __iter__(self): """Initializes iterator by resetting count and returns the iterator object itself.""" diff --git a/utils/general.py b/utils/general.py index 41cd2032c..db6ddacef 100644 --- a/utils/general.py +++ b/utils/general.py @@ -495,9 +495,9 @@ def check_file(file, suffix=""): assert Path(file).exists() and Path(file).stat().st_size > 0, f"File download failed: {url}" # check return file elif file.startswith("clearml://"): # ClearML Dataset ID - assert "clearml" in sys.modules, ( - "ClearML is not installed, so cannot use ClearML dataset. Try running 'pip install clearml'." - ) + assert ( + "clearml" in sys.modules + ), "ClearML is not installed, so cannot use ClearML dataset. Try running 'pip install clearml'." return file else: # search files = [] diff --git a/utils/loggers/clearml/clearml_utils.py b/utils/loggers/clearml/clearml_utils.py index 2ddf3a471..fc19c8cfe 100644 --- a/utils/loggers/clearml/clearml_utils.py +++ b/utils/loggers/clearml/clearml_utils.py @@ -41,9 +41,11 @@ def construct_dataset(clearml_info_string): with open(yaml_filenames[0]) as f: dataset_definition = yaml.safe_load(f) - assert set(dataset_definition.keys()).issuperset({"train", "test", "val", "nc", "names"}), ( - "The right keys were not found in the yaml file, make sure it at least has the following keys: ('train', 'test', 'val', 'nc', 'names')" - ) + assert set( + dataset_definition.keys() + ).issuperset( + {"train", "test", "val", "nc", "names"} + ), "The right keys were not found in the yaml file, make sure it at least has the following keys: ('train', 'test', 'val', 'nc', 'names')" data_dict = { "train": ( diff --git a/utils/torch_utils.py b/utils/torch_utils.py index 29877faa6..53e707607 100644 --- a/utils/torch_utils.py +++ b/utils/torch_utils.py @@ -121,9 +121,9 @@ def select_device(device="", batch_size=0, newline=True): os.environ["CUDA_VISIBLE_DEVICES"] = "-1" # force torch.cuda.is_available() = False elif device: # non-cpu device requested os.environ["CUDA_VISIBLE_DEVICES"] = device # set environment variable - must be before assert is_available() - assert torch.cuda.is_available() and torch.cuda.device_count() >= len(device.replace(",", "")), ( - f"Invalid CUDA '--device {device}' requested, use '--device cpu' or pass valid CUDA device(s)" - ) + assert torch.cuda.is_available() and torch.cuda.device_count() >= len( + device.replace(",", "") + ), f"Invalid CUDA '--device {device}' requested, use '--device cpu' or pass valid CUDA device(s)" if not cpu and not mps and torch.cuda.is_available(): # prefer GPU if available devices = device.split(",") if device else "0" # range(torch.cuda.device_count()) # i.e. 0,1,6,7 From c568972d597ee2fa14525a739d8acb284fc19c87 Mon Sep 17 00:00:00 2001 From: Paula Derrenger <107626595+pderrenger@users.noreply.github.com> Date: Wed, 15 Jan 2025 15:31:19 +0100 Subject: [PATCH 2/4] Standardize license headers in Python files (#13490) * Refactor code for speed and clarity * Auto-format by https://ultralytics.com/actions --------- Co-authored-by: Glenn Jocher Co-authored-by: UltralyticsAssistant --- benchmarks.py | 2 +- classify/predict.py | 2 +- classify/train.py | 2 +- classify/val.py | 2 +- detect.py | 2 +- export.py | 2 +- hubconf.py | 2 +- models/__init__.py | 1 + models/common.py | 7 +++---- models/experimental.py | 2 +- models/tf.py | 2 +- models/yolo.py | 2 +- segment/predict.py | 2 +- segment/train.py | 2 +- segment/val.py | 2 +- train.py | 2 +- utils/__init__.py | 2 +- utils/activations.py | 2 +- utils/augmentations.py | 2 +- utils/autoanchor.py | 2 +- utils/autobatch.py | 2 +- utils/aws/__init__.py | 1 + utils/aws/resume.py | 3 ++- utils/callbacks.py | 2 +- utils/dataloaders.py | 8 ++++---- utils/downloads.py | 2 +- utils/flask_rest_api/example_request.py | 2 +- utils/flask_rest_api/restapi.py | 2 +- utils/general.py | 8 ++++---- utils/loggers/__init__.py | 2 +- utils/loggers/clearml/README.md | 2 +- utils/loggers/clearml/__init__.py | 1 + utils/loggers/clearml/clearml_utils.py | 10 ++++------ utils/loggers/clearml/hpo.py | 2 +- utils/loggers/comet/__init__.py | 2 +- utils/loggers/comet/comet_utils.py | 2 +- utils/loggers/comet/hpo.py | 2 +- utils/loggers/wandb/__init__.py | 1 + utils/loggers/wandb/wandb_utils.py | 2 +- utils/loss.py | 2 +- utils/metrics.py | 2 +- utils/plots.py | 2 +- utils/segment/__init__.py | 1 + utils/segment/augmentations.py | 2 +- utils/segment/dataloaders.py | 2 +- utils/segment/general.py | 2 +- utils/segment/loss.py | 2 +- utils/segment/metrics.py | 2 +- utils/segment/plots.py | 2 +- utils/torch_utils.py | 8 ++++---- utils/triton.py | 2 +- val.py | 2 +- 52 files changed, 67 insertions(+), 64 deletions(-) diff --git a/benchmarks.py b/benchmarks.py index 996b8d438..45ae55b36 100644 --- a/benchmarks.py +++ b/benchmarks.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """ Run YOLOv5 benchmarks on all supported export formats. diff --git a/classify/predict.py b/classify/predict.py index ddc67ca80..59db1330a 100644 --- a/classify/predict.py +++ b/classify/predict.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """ Run YOLOv5 classification inference on images, videos, directories, globs, YouTube, webcam, streams, etc. diff --git a/classify/train.py b/classify/train.py index e56db8ce4..d454c7187 100644 --- a/classify/train.py +++ b/classify/train.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """ Train a YOLOv5 classifier model on a classification dataset. diff --git a/classify/val.py b/classify/val.py index 8ce48f064..72bd0e14e 100644 --- a/classify/val.py +++ b/classify/val.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """ Validate a trained YOLOv5 classification model on a classification dataset. diff --git a/detect.py b/detect.py index 6bc666dcc..24724a35f 100644 --- a/detect.py +++ b/detect.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """ Run YOLOv5 detection inference on images, videos, directories, globs, YouTube, webcam, streams, etc. diff --git a/export.py b/export.py index f617c7551..3ecb353b7 100644 --- a/export.py +++ b/export.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """ Export a YOLOv5 PyTorch model to other formats. TensorFlow exports authored by https://github.com/zldrobit. diff --git a/hubconf.py b/hubconf.py index e7ca62b04..2eeac4edd 100644 --- a/hubconf.py +++ b/hubconf.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """ PyTorch Hub models https://pytorch.org/hub/ultralytics_yolov5. diff --git a/models/__init__.py b/models/__init__.py index e69de29bb..77a19dcf0 100644 --- a/models/__init__.py +++ b/models/__init__.py @@ -0,0 +1 @@ +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license diff --git a/models/common.py b/models/common.py index 1ae3280f9..ea893db4b 100644 --- a/models/common.py +++ b/models/common.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """Common modules.""" import ast @@ -750,9 +750,8 @@ class DetectMultiBackend(nn.Module): scale, zero_point = output["quantization"] x = (x.astype(np.float32) - zero_point) * scale # re-scale y.append(x) - if len(y) == 2: # segment with (det, proto) output order reversed - if len(y[1].shape) != 4: - y = list(reversed(y)) # should be y = (1, 116, 8400), (1, 160, 160, 32) + if len(y) == 2 and len(y[1].shape) != 4: + y = list(reversed(y)) y = [x if isinstance(x, np.ndarray) else x.numpy() for x in y] y[0][..., :4] *= [w, h, w, h] # xywh normalized to pixels diff --git a/models/experimental.py b/models/experimental.py index ab9b0ed23..63d9c461a 100644 --- a/models/experimental.py +++ b/models/experimental.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """Experimental modules.""" import math diff --git a/models/tf.py b/models/tf.py index 59bb7e0f5..c2cad393e 100644 --- a/models/tf.py +++ b/models/tf.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """ TensorFlow, Keras and TFLite versions of YOLOv5 Authored by https://github.com/zldrobit in PR https://github.com/ultralytics/yolov5/pull/1127. diff --git a/models/yolo.py b/models/yolo.py index c0dd946e0..13498aced 100644 --- a/models/yolo.py +++ b/models/yolo.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """ YOLO-specific modules. diff --git a/segment/predict.py b/segment/predict.py index 1dd892a19..e0e4336c1 100644 --- a/segment/predict.py +++ b/segment/predict.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """ Run YOLOv5 segmentation inference on images, videos, directories, streams, etc. diff --git a/segment/train.py b/segment/train.py index f68249d92..815c97ce1 100644 --- a/segment/train.py +++ b/segment/train.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """ Train a YOLOv5 segment model on a segment dataset Models and datasets download automatically from the latest YOLOv5 release. diff --git a/segment/val.py b/segment/val.py index 60a7fe7cb..edd6a08fa 100644 --- a/segment/val.py +++ b/segment/val.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """ Validate a trained YOLOv5 segment model on a segment dataset. diff --git a/train.py b/train.py index fec0a239c..1401ccb96 100644 --- a/train.py +++ b/train.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """ Train a YOLOv5 model on a custom dataset. Models and datasets download automatically from the latest YOLOv5 release. diff --git a/utils/__init__.py b/utils/__init__.py index 185afd696..3c43c9b68 100644 --- a/utils/__init__.py +++ b/utils/__init__.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """utils/initialization.""" import contextlib diff --git a/utils/activations.py b/utils/activations.py index 44bec8cd1..4652540db 100644 --- a/utils/activations.py +++ b/utils/activations.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """Activation functions.""" import torch diff --git a/utils/augmentations.py b/utils/augmentations.py index e051ad66f..79e7afc8d 100644 --- a/utils/augmentations.py +++ b/utils/augmentations.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """Image augmentation functions.""" import math diff --git a/utils/autoanchor.py b/utils/autoanchor.py index 00eee2eb7..1fc420759 100644 --- a/utils/autoanchor.py +++ b/utils/autoanchor.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """AutoAnchor utils.""" import random diff --git a/utils/autobatch.py b/utils/autobatch.py index 08a0de841..9d5ea0a94 100644 --- a/utils/autobatch.py +++ b/utils/autobatch.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """Auto-batch utils.""" from copy import deepcopy diff --git a/utils/aws/__init__.py b/utils/aws/__init__.py index e69de29bb..77a19dcf0 100644 --- a/utils/aws/__init__.py +++ b/utils/aws/__init__.py @@ -0,0 +1 @@ +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license diff --git a/utils/aws/resume.py b/utils/aws/resume.py index ea432a161..5b80fd41f 100644 --- a/utils/aws/resume.py +++ b/utils/aws/resume.py @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # Resume all interrupted trainings in yolov5/ dir including DDP trainings # Usage: $ python utils/aws/resume.py diff --git a/utils/callbacks.py b/utils/callbacks.py index 21c587bd7..1a6092840 100644 --- a/utils/callbacks.py +++ b/utils/callbacks.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """Callback utils.""" import threading diff --git a/utils/dataloaders.py b/utils/dataloaders.py index 082404833..7ca5a8524 100644 --- a/utils/dataloaders.py +++ b/utils/dataloaders.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """Dataloaders and dataset utils.""" import contextlib @@ -355,9 +355,9 @@ class LoadImages: self._new_video(videos[0]) # new video else: self.cap = None - assert ( - self.nf > 0 - ), f"No images or videos found in {p}. Supported formats are:\nimages: {IMG_FORMATS}\nvideos: {VID_FORMATS}" + assert self.nf > 0, ( + f"No images or videos found in {p}. Supported formats are:\nimages: {IMG_FORMATS}\nvideos: {VID_FORMATS}" + ) def __iter__(self): """Initializes iterator by resetting count and returns the iterator object itself.""" diff --git a/utils/downloads.py b/utils/downloads.py index c7e2273c7..f51d67aa9 100644 --- a/utils/downloads.py +++ b/utils/downloads.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """Download utils.""" import logging diff --git a/utils/flask_rest_api/example_request.py b/utils/flask_rest_api/example_request.py index 104249002..db88e8040 100644 --- a/utils/flask_rest_api/example_request.py +++ b/utils/flask_rest_api/example_request.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """Perform test request.""" import pprint diff --git a/utils/flask_rest_api/restapi.py b/utils/flask_rest_api/restapi.py index 7e03d3a66..410ae26c5 100644 --- a/utils/flask_rest_api/restapi.py +++ b/utils/flask_rest_api/restapi.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """Run a Flask REST API exposing one or more YOLOv5s models.""" import argparse diff --git a/utils/general.py b/utils/general.py index db6ddacef..89bbc61f4 100644 --- a/utils/general.py +++ b/utils/general.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """General utils.""" import contextlib @@ -495,9 +495,9 @@ def check_file(file, suffix=""): assert Path(file).exists() and Path(file).stat().st_size > 0, f"File download failed: {url}" # check return file elif file.startswith("clearml://"): # ClearML Dataset ID - assert ( - "clearml" in sys.modules - ), "ClearML is not installed, so cannot use ClearML dataset. Try running 'pip install clearml'." + assert "clearml" in sys.modules, ( + "ClearML is not installed, so cannot use ClearML dataset. Try running 'pip install clearml'." + ) return file else: # search files = [] diff --git a/utils/loggers/__init__.py b/utils/loggers/__init__.py index 92b4bcb05..9ff5f56f2 100644 --- a/utils/loggers/__init__.py +++ b/utils/loggers/__init__.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """Logging utils.""" import json diff --git a/utils/loggers/clearml/README.md b/utils/loggers/clearml/README.md index 3dbaaa301..374765dfb 100644 --- a/utils/loggers/clearml/README.md +++ b/utils/loggers/clearml/README.md @@ -4,7 +4,7 @@ ## About ClearML -[ClearML](https://clear.ml/) is an [open-source](https://github.com/allegroai/clearml) toolbox designed to save you time ⏱️. +[ClearML](https://clear.ml/) is an [open-source](https://github.com/clearml/clearml) toolbox designed to save you time ⏱️. 🔨 Track every YOLOv5 training run in the experiment manager diff --git a/utils/loggers/clearml/__init__.py b/utils/loggers/clearml/__init__.py index e69de29bb..77a19dcf0 100644 --- a/utils/loggers/clearml/__init__.py +++ b/utils/loggers/clearml/__init__.py @@ -0,0 +1 @@ +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license diff --git a/utils/loggers/clearml/clearml_utils.py b/utils/loggers/clearml/clearml_utils.py index fc19c8cfe..67553bdb4 100644 --- a/utils/loggers/clearml/clearml_utils.py +++ b/utils/loggers/clearml/clearml_utils.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """Main Logger class for ClearML experiment tracking.""" import glob @@ -41,11 +41,9 @@ def construct_dataset(clearml_info_string): with open(yaml_filenames[0]) as f: dataset_definition = yaml.safe_load(f) - assert set( - dataset_definition.keys() - ).issuperset( - {"train", "test", "val", "nc", "names"} - ), "The right keys were not found in the yaml file, make sure it at least has the following keys: ('train', 'test', 'val', 'nc', 'names')" + assert set(dataset_definition.keys()).issuperset({"train", "test", "val", "nc", "names"}), ( + "The right keys were not found in the yaml file, make sure it at least has the following keys: ('train', 'test', 'val', 'nc', 'names')" + ) data_dict = { "train": ( diff --git a/utils/loggers/clearml/hpo.py b/utils/loggers/clearml/hpo.py index 5a9be757a..099a87fca 100644 --- a/utils/loggers/clearml/hpo.py +++ b/utils/loggers/clearml/hpo.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license from clearml import Task diff --git a/utils/loggers/comet/__init__.py b/utils/loggers/comet/__init__.py index f4940a1a2..1ad44b9a3 100644 --- a/utils/loggers/comet/__init__.py +++ b/utils/loggers/comet/__init__.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license import glob import json diff --git a/utils/loggers/comet/comet_utils.py b/utils/loggers/comet/comet_utils.py index cf936ab48..1dc572cca 100644 --- a/utils/loggers/comet/comet_utils.py +++ b/utils/loggers/comet/comet_utils.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license import logging import os diff --git a/utils/loggers/comet/hpo.py b/utils/loggers/comet/hpo.py index c225ebbd0..dc171e261 100644 --- a/utils/loggers/comet/hpo.py +++ b/utils/loggers/comet/hpo.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license import argparse import json diff --git a/utils/loggers/wandb/__init__.py b/utils/loggers/wandb/__init__.py index e69de29bb..77a19dcf0 100644 --- a/utils/loggers/wandb/__init__.py +++ b/utils/loggers/wandb/__init__.py @@ -0,0 +1 @@ +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license diff --git a/utils/loggers/wandb/wandb_utils.py b/utils/loggers/wandb/wandb_utils.py index 102228a67..83c5ee130 100644 --- a/utils/loggers/wandb/wandb_utils.py +++ b/utils/loggers/wandb/wandb_utils.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # WARNING ⚠️ wandb is deprecated and will be removed in future release. # See supported integrations at https://github.com/ultralytics/yolov5#integrations diff --git a/utils/loss.py b/utils/loss.py index c22018339..35ce6d792 100644 --- a/utils/loss.py +++ b/utils/loss.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """Loss functions.""" import torch diff --git a/utils/metrics.py b/utils/metrics.py index e8dc9df4c..03013f4e3 100644 --- a/utils/metrics.py +++ b/utils/metrics.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """Model validation metrics.""" import math diff --git a/utils/plots.py b/utils/plots.py index 44d103510..f70775f26 100644 --- a/utils/plots.py +++ b/utils/plots.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """Plotting utils.""" import contextlib diff --git a/utils/segment/__init__.py b/utils/segment/__init__.py index e69de29bb..77a19dcf0 100644 --- a/utils/segment/__init__.py +++ b/utils/segment/__init__.py @@ -0,0 +1 @@ +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license diff --git a/utils/segment/augmentations.py b/utils/segment/augmentations.py index 302e41379..14a81cf7d 100644 --- a/utils/segment/augmentations.py +++ b/utils/segment/augmentations.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """Image augmentation functions.""" import math diff --git a/utils/segment/dataloaders.py b/utils/segment/dataloaders.py index ee6e6186d..2363d7265 100644 --- a/utils/segment/dataloaders.py +++ b/utils/segment/dataloaders.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """Dataloaders.""" import os diff --git a/utils/segment/general.py b/utils/segment/general.py index c9dfaaabe..6a71c2551 100644 --- a/utils/segment/general.py +++ b/utils/segment/general.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license import cv2 import numpy as np diff --git a/utils/segment/loss.py b/utils/segment/loss.py index f63b262b5..6ef590620 100644 --- a/utils/segment/loss.py +++ b/utils/segment/loss.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license import torch import torch.nn as nn diff --git a/utils/segment/metrics.py b/utils/segment/metrics.py index 091b5b16a..3bb7aeec4 100644 --- a/utils/segment/metrics.py +++ b/utils/segment/metrics.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """Model validation metrics.""" import numpy as np diff --git a/utils/segment/plots.py b/utils/segment/plots.py index f5b81711c..5619e9de9 100644 --- a/utils/segment/plots.py +++ b/utils/segment/plots.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license import contextlib import math diff --git a/utils/torch_utils.py b/utils/torch_utils.py index 53e707607..8b3c43b5b 100644 --- a/utils/torch_utils.py +++ b/utils/torch_utils.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """PyTorch utils.""" import math @@ -121,9 +121,9 @@ def select_device(device="", batch_size=0, newline=True): os.environ["CUDA_VISIBLE_DEVICES"] = "-1" # force torch.cuda.is_available() = False elif device: # non-cpu device requested os.environ["CUDA_VISIBLE_DEVICES"] = device # set environment variable - must be before assert is_available() - assert torch.cuda.is_available() and torch.cuda.device_count() >= len( - device.replace(",", "") - ), f"Invalid CUDA '--device {device}' requested, use '--device cpu' or pass valid CUDA device(s)" + assert torch.cuda.is_available() and torch.cuda.device_count() >= len(device.replace(",", "")), ( + f"Invalid CUDA '--device {device}' requested, use '--device cpu' or pass valid CUDA device(s)" + ) if not cpu and not mps and torch.cuda.is_available(): # prefer GPU if available devices = device.split(",") if device else "0" # range(torch.cuda.device_count()) # i.e. 0,1,6,7 diff --git a/utils/triton.py b/utils/triton.py index 3230ecd8e..88c0bd7b2 100644 --- a/utils/triton.py +++ b/utils/triton.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """Utils to interact with the Triton Inference Server.""" import typing diff --git a/val.py b/val.py index b8db6122f..600353b1c 100644 --- a/val.py +++ b/val.py @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """ Validate a trained YOLOv5 detection model on a detection dataset. From de62f93c210aaaffd710f9afe3b43ab624f7a21b Mon Sep 17 00:00:00 2001 From: Paula Derrenger <107626595+pderrenger@users.noreply.github.com> Date: Wed, 15 Jan 2025 17:53:24 +0100 Subject: [PATCH 3/4] Standardize license headers in TOML/YAML files (#13491) Refactor code for speed and clarity Co-authored-by: Glenn Jocher --- .github/ISSUE_TEMPLATE/bug-report.yml | 2 +- .github/ISSUE_TEMPLATE/config.yml | 2 +- .github/ISSUE_TEMPLATE/feature-request.yml | 2 +- .github/ISSUE_TEMPLATE/question.yml | 2 +- .github/dependabot.yml | 3 ++- .github/workflows/ci-testing.yml | 3 ++- .github/workflows/cla.yml | 3 ++- .github/workflows/docker.yml | 3 ++- .github/workflows/format.yml | 3 ++- .github/workflows/links.yml | 3 ++- .github/workflows/merge-main-into-prs.yml | 3 ++- .github/workflows/stale.yml | 2 +- data/Argoverse.yaml | 3 ++- data/GlobalWheat2020.yaml | 3 ++- data/ImageNet.yaml | 3 ++- data/ImageNet10.yaml | 3 ++- data/ImageNet100.yaml | 3 ++- data/ImageNet1000.yaml | 3 ++- data/Objects365.yaml | 3 ++- data/SKU-110K.yaml | 3 ++- data/VOC.yaml | 3 ++- data/VisDrone.yaml | 3 ++- data/coco.yaml | 3 ++- data/coco128-seg.yaml | 3 ++- data/coco128.yaml | 3 ++- data/hyps/hyp.Objects365.yaml | 3 ++- data/hyps/hyp.VOC.yaml | 3 ++- data/hyps/hyp.no-augmentation.yaml | 3 ++- data/hyps/hyp.scratch-high.yaml | 3 ++- data/hyps/hyp.scratch-low.yaml | 3 ++- data/hyps/hyp.scratch-med.yaml | 3 ++- data/xView.yaml | 3 ++- models/hub/anchors.yaml | 3 ++- models/hub/yolov3-spp.yaml | 2 +- models/hub/yolov3-tiny.yaml | 2 +- models/hub/yolov3.yaml | 2 +- models/hub/yolov5-bifpn.yaml | 2 +- models/hub/yolov5-fpn.yaml | 2 +- models/hub/yolov5-p2.yaml | 2 +- models/hub/yolov5-p34.yaml | 2 +- models/hub/yolov5-p6.yaml | 2 +- models/hub/yolov5-p7.yaml | 2 +- models/hub/yolov5-panet.yaml | 2 +- models/hub/yolov5l6.yaml | 2 +- models/hub/yolov5m6.yaml | 2 +- models/hub/yolov5n6.yaml | 2 +- models/hub/yolov5s-LeakyReLU.yaml | 2 +- models/hub/yolov5s-ghost.yaml | 2 +- models/hub/yolov5s-transformer.yaml | 2 +- models/hub/yolov5s6.yaml | 2 +- models/hub/yolov5x6.yaml | 2 +- models/segment/yolov5l-seg.yaml | 2 +- models/segment/yolov5m-seg.yaml | 2 +- models/segment/yolov5n-seg.yaml | 2 +- models/segment/yolov5s-seg.yaml | 2 +- models/segment/yolov5x-seg.yaml | 2 +- models/yolov5l.yaml | 2 +- models/yolov5m.yaml | 2 +- models/yolov5n.yaml | 2 +- models/yolov5s.yaml | 2 +- models/yolov5x.yaml | 2 +- pyproject.toml | 2 +- utils/google_app_engine/app.yaml | 2 +- 63 files changed, 91 insertions(+), 63 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 76b426a19..3bd941761 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license name: 🐛 Bug Report # title: " " diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index e23dfcf9c..d05d057dc 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license blank_issues_enabled: true contact_links: diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index 9282e62d2..bf201809b 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license name: 🚀 Feature Request description: Suggest a YOLOv5 idea diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml index 5b62af675..0787bbea9 100644 --- a/.github/ISSUE_TEMPLATE/question.yml +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license name: ❓ Question description: Ask a YOLOv5 question diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 061d61f1b..233db72b0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # Dependabot for package version updates # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 89cc8e9a4..ae24eb11c 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # YOLOv5 Continuous Integration (CI) GitHub Actions tests name: YOLOv5 CI diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml index f725f5683..61b944167 100644 --- a/.github/workflows/cla.yml +++ b/.github/workflows/cla.yml @@ -1,4 +1,5 @@ -# Ultralytics YOLO 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # Ultralytics Contributor License Agreement (CLA) action https://docs.ultralytics.com/help/CLA # This workflow automatically requests Pull Requests (PR) authors to sign the Ultralytics CLA before PRs can be merged diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2cd1c13f7..b43c2bc28 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # Builds ultralytics/yolov5:latest images on DockerHub https://hub.docker.com/r/ultralytics/yolov5 name: Publish Docker Images diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index b9b910703..10891c878 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -1,4 +1,5 @@ -# Ultralytics 🚀 - AGPL-3.0 License https://ultralytics.com/license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # Ultralytics Actions https://github.com/ultralytics/actions # This workflow automatically formats code and documentation in PRs to official Ultralytics standards diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index 64f266929..07bf6db74 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # Continuous Integration (CI) GitHub Actions tests broken link checker using https://github.com/lycheeverse/lychee # Ignores the following status codes to reduce false positives: # - 403(OpenVINO, 'forbidden') diff --git a/.github/workflows/merge-main-into-prs.yml b/.github/workflows/merge-main-into-prs.yml index 29c0f9328..034c6c143 100644 --- a/.github/workflows/merge-main-into-prs.yml +++ b/.github/workflows/merge-main-into-prs.yml @@ -1,4 +1,5 @@ -# Ultralytics YOLO 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # Automatically merges repository 'main' branch into all open PRs to keep them up-to-date # Action runs on updates to main branch so when one PR merges to main all others update diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 374bc01ab..fda092a44 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license name: Close stale issues on: diff --git a/data/Argoverse.yaml b/data/Argoverse.yaml index 366552ea4..651b6431b 100644 --- a/data/Argoverse.yaml +++ b/data/Argoverse.yaml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # Argoverse-HD dataset (ring-front-center camera) http://www.cs.cmu.edu/~mengtial/proj/streaming/ by Argo AI # Example usage: python train.py --data Argoverse.yaml # parent diff --git a/data/GlobalWheat2020.yaml b/data/GlobalWheat2020.yaml index acb88290f..eb25871c6 100644 --- a/data/GlobalWheat2020.yaml +++ b/data/GlobalWheat2020.yaml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # Global Wheat 2020 dataset http://www.global-wheat.com/ by University of Saskatchewan # Example usage: python train.py --data GlobalWheat2020.yaml # parent diff --git a/data/ImageNet.yaml b/data/ImageNet.yaml index 979a0e4de..a3cf694bc 100644 --- a/data/ImageNet.yaml +++ b/data/ImageNet.yaml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # ImageNet-1k dataset https://www.image-net.org/index.php by Stanford University # Simplified class names from https://github.com/anishathalye/imagenet-simple-labels # Example usage: python classify/train.py --data imagenet diff --git a/data/ImageNet10.yaml b/data/ImageNet10.yaml index 2189def7d..e50e58888 100644 --- a/data/ImageNet10.yaml +++ b/data/ImageNet10.yaml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # ImageNet-1k dataset https://www.image-net.org/index.php by Stanford University # Simplified class names from https://github.com/anishathalye/imagenet-simple-labels # Example usage: python classify/train.py --data imagenet diff --git a/data/ImageNet100.yaml b/data/ImageNet100.yaml index 560cdecdb..e3891bcb4 100644 --- a/data/ImageNet100.yaml +++ b/data/ImageNet100.yaml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # ImageNet-1k dataset https://www.image-net.org/index.php by Stanford University # Simplified class names from https://github.com/anishathalye/imagenet-simple-labels # Example usage: python classify/train.py --data imagenet diff --git a/data/ImageNet1000.yaml b/data/ImageNet1000.yaml index aa17e9e05..8943d3312 100644 --- a/data/ImageNet1000.yaml +++ b/data/ImageNet1000.yaml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # ImageNet-1k dataset https://www.image-net.org/index.php by Stanford University # Simplified class names from https://github.com/anishathalye/imagenet-simple-labels # Example usage: python classify/train.py --data imagenet diff --git a/data/Objects365.yaml b/data/Objects365.yaml index f1f0a1ae4..248b6c775 100644 --- a/data/Objects365.yaml +++ b/data/Objects365.yaml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # Objects365 dataset https://www.objects365.org/ by Megvii # Example usage: python train.py --data Objects365.yaml # parent diff --git a/data/SKU-110K.yaml b/data/SKU-110K.yaml index b012bec31..695b89cd4 100644 --- a/data/SKU-110K.yaml +++ b/data/SKU-110K.yaml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # SKU-110K retail items dataset https://github.com/eg4000/SKU110K_CVPR19 by Trax Retail # Example usage: python train.py --data SKU-110K.yaml # parent diff --git a/data/VOC.yaml b/data/VOC.yaml index 227d91d76..9dad47777 100644 --- a/data/VOC.yaml +++ b/data/VOC.yaml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # PASCAL VOC dataset http://host.robots.ox.ac.uk/pascal/VOC by University of Oxford # Example usage: python train.py --data VOC.yaml # parent diff --git a/data/VisDrone.yaml b/data/VisDrone.yaml index 20ff1d39c..637433b50 100644 --- a/data/VisDrone.yaml +++ b/data/VisDrone.yaml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # VisDrone2019-DET dataset https://github.com/VisDrone/VisDrone-Dataset by Tianjin University # Example usage: python train.py --data VisDrone.yaml # parent diff --git a/data/coco.yaml b/data/coco.yaml index 816efa5cf..7f872e8ca 100644 --- a/data/coco.yaml +++ b/data/coco.yaml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # COCO 2017 dataset http://cocodataset.org by Microsoft # Example usage: python train.py --data coco.yaml # parent diff --git a/data/coco128-seg.yaml b/data/coco128-seg.yaml index 5b00f52a9..fa618d87e 100644 --- a/data/coco128-seg.yaml +++ b/data/coco128-seg.yaml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # COCO128-seg dataset https://www.kaggle.com/datasets/ultralytics/coco128 (first 128 images from COCO train2017) by Ultralytics # Example usage: python train.py --data coco128.yaml # parent diff --git a/data/coco128.yaml b/data/coco128.yaml index cf3d27b87..e81fb1ff4 100644 --- a/data/coco128.yaml +++ b/data/coco128.yaml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # COCO128 dataset https://www.kaggle.com/datasets/ultralytics/coco128 (first 128 images from COCO train2017) by Ultralytics # Example usage: python train.py --data coco128.yaml # parent diff --git a/data/hyps/hyp.Objects365.yaml b/data/hyps/hyp.Objects365.yaml index 7a6c507c7..7b26a053b 100644 --- a/data/hyps/hyp.Objects365.yaml +++ b/data/hyps/hyp.Objects365.yaml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # Hyperparameters for Objects365 training # python train.py --weights yolov5m.pt --data Objects365.yaml --evolve # See Hyperparameter Evolution tutorial for details https://github.com/ultralytics/yolov5#tutorials diff --git a/data/hyps/hyp.VOC.yaml b/data/hyps/hyp.VOC.yaml index c04c63e21..378bc4030 100644 --- a/data/hyps/hyp.VOC.yaml +++ b/data/hyps/hyp.VOC.yaml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # Hyperparameters for VOC training # python train.py --batch 128 --weights yolov5m6.pt --data VOC.yaml --epochs 50 --img 512 --hyp hyp.scratch-med.yaml --evolve # See Hyperparameter Evolution tutorial for details https://github.com/ultralytics/yolov5#tutorials diff --git a/data/hyps/hyp.no-augmentation.yaml b/data/hyps/hyp.no-augmentation.yaml index adc360bb8..08378961f 100644 --- a/data/hyps/hyp.no-augmentation.yaml +++ b/data/hyps/hyp.no-augmentation.yaml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # Hyperparameters when using Albumentations frameworks # python train.py --hyp hyp.no-augmentation.yaml # See https://github.com/ultralytics/yolov5/pull/3882 for YOLOv5 + Albumentations Usage examples diff --git a/data/hyps/hyp.scratch-high.yaml b/data/hyps/hyp.scratch-high.yaml index 3e913e36d..74536c297 100644 --- a/data/hyps/hyp.scratch-high.yaml +++ b/data/hyps/hyp.scratch-high.yaml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # Hyperparameters for high-augmentation COCO training from scratch # python train.py --batch 32 --cfg yolov5m6.yaml --weights '' --data coco.yaml --img 1280 --epochs 300 # See tutorials for hyperparameter evolution https://github.com/ultralytics/yolov5#tutorials diff --git a/data/hyps/hyp.scratch-low.yaml b/data/hyps/hyp.scratch-low.yaml index ff0d1e7ff..e89b3ba4e 100644 --- a/data/hyps/hyp.scratch-low.yaml +++ b/data/hyps/hyp.scratch-low.yaml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # Hyperparameters for low-augmentation COCO training from scratch # python train.py --batch 64 --cfg yolov5n6.yaml --weights '' --data coco.yaml --img 640 --epochs 300 --linear # See tutorials for hyperparameter evolution https://github.com/ultralytics/yolov5#tutorials diff --git a/data/hyps/hyp.scratch-med.yaml b/data/hyps/hyp.scratch-med.yaml index c2fba1fc2..7dfd2f306 100644 --- a/data/hyps/hyp.scratch-med.yaml +++ b/data/hyps/hyp.scratch-med.yaml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # Hyperparameters for medium-augmentation COCO training from scratch # python train.py --batch 32 --cfg yolov5m6.yaml --weights '' --data coco.yaml --img 1280 --epochs 300 # See tutorials for hyperparameter evolution https://github.com/ultralytics/yolov5#tutorials diff --git a/data/xView.yaml b/data/xView.yaml index 407159831..6bea7637e 100644 --- a/data/xView.yaml +++ b/data/xView.yaml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # DIUx xView 2018 Challenge https://challenge.xviewdataset.org by U.S. National Geospatial-Intelligence Agency (NGA) # -------- DOWNLOAD DATA MANUALLY and jar xf val_images.zip to 'datasets/xView' before running train command! -------- # Example usage: python train.py --data xView.yaml diff --git a/models/hub/anchors.yaml b/models/hub/anchors.yaml index c8089311b..0f3e288e1 100644 --- a/models/hub/anchors.yaml +++ b/models/hub/anchors.yaml @@ -1,4 +1,5 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license + # Default anchors for COCO data # P5 ------------------------------------------------------------------------------------------------------------------- diff --git a/models/hub/yolov3-spp.yaml b/models/hub/yolov3-spp.yaml index 0e073667b..34c2d517c 100644 --- a/models/hub/yolov3-spp.yaml +++ b/models/hub/yolov3-spp.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/hub/yolov3-tiny.yaml b/models/hub/yolov3-tiny.yaml index 0a74fff71..f1861012e 100644 --- a/models/hub/yolov3-tiny.yaml +++ b/models/hub/yolov3-tiny.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/hub/yolov3.yaml b/models/hub/yolov3.yaml index ce4a980c8..15cb68a83 100644 --- a/models/hub/yolov3.yaml +++ b/models/hub/yolov3.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/hub/yolov5-bifpn.yaml b/models/hub/yolov5-bifpn.yaml index bf05e434c..fba3fe5f7 100644 --- a/models/hub/yolov5-bifpn.yaml +++ b/models/hub/yolov5-bifpn.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/hub/yolov5-fpn.yaml b/models/hub/yolov5-fpn.yaml index dcfdd14a7..4411d1cc0 100644 --- a/models/hub/yolov5-fpn.yaml +++ b/models/hub/yolov5-fpn.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/hub/yolov5-p2.yaml b/models/hub/yolov5-p2.yaml index 2626e7348..e47d39e4e 100644 --- a/models/hub/yolov5-p2.yaml +++ b/models/hub/yolov5-p2.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/hub/yolov5-p34.yaml b/models/hub/yolov5-p34.yaml index fba35ec10..17e46f7bd 100644 --- a/models/hub/yolov5-p34.yaml +++ b/models/hub/yolov5-p34.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/hub/yolov5-p6.yaml b/models/hub/yolov5-p6.yaml index c997df2db..dbc1ae4d0 100644 --- a/models/hub/yolov5-p6.yaml +++ b/models/hub/yolov5-p6.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/hub/yolov5-p7.yaml b/models/hub/yolov5-p7.yaml index 14e6ce05d..2c1706992 100644 --- a/models/hub/yolov5-p7.yaml +++ b/models/hub/yolov5-p7.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/hub/yolov5-panet.yaml b/models/hub/yolov5-panet.yaml index f0857f92d..68a717566 100644 --- a/models/hub/yolov5-panet.yaml +++ b/models/hub/yolov5-panet.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/hub/yolov5l6.yaml b/models/hub/yolov5l6.yaml index 05501a9d1..223f681bf 100644 --- a/models/hub/yolov5l6.yaml +++ b/models/hub/yolov5l6.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/hub/yolov5m6.yaml b/models/hub/yolov5m6.yaml index 1512e2b6e..6878d8996 100644 --- a/models/hub/yolov5m6.yaml +++ b/models/hub/yolov5m6.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/hub/yolov5n6.yaml b/models/hub/yolov5n6.yaml index 11350413e..0d454c9ca 100644 --- a/models/hub/yolov5n6.yaml +++ b/models/hub/yolov5n6.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/hub/yolov5s-LeakyReLU.yaml b/models/hub/yolov5s-LeakyReLU.yaml index 6e9d4a882..61d6d3317 100644 --- a/models/hub/yolov5s-LeakyReLU.yaml +++ b/models/hub/yolov5s-LeakyReLU.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/hub/yolov5s-ghost.yaml b/models/hub/yolov5s-ghost.yaml index cc4336948..53695ae48 100644 --- a/models/hub/yolov5s-ghost.yaml +++ b/models/hub/yolov5s-ghost.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/hub/yolov5s-transformer.yaml b/models/hub/yolov5s-transformer.yaml index 1b2d62c5a..213e4dac1 100644 --- a/models/hub/yolov5s-transformer.yaml +++ b/models/hub/yolov5s-transformer.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/hub/yolov5s6.yaml b/models/hub/yolov5s6.yaml index 2a4c11625..6e69964a9 100644 --- a/models/hub/yolov5s6.yaml +++ b/models/hub/yolov5s6.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/hub/yolov5x6.yaml b/models/hub/yolov5x6.yaml index 0c8f29e60..33a8525f1 100644 --- a/models/hub/yolov5x6.yaml +++ b/models/hub/yolov5x6.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/segment/yolov5l-seg.yaml b/models/segment/yolov5l-seg.yaml index de430f4fb..824e8aec2 100644 --- a/models/segment/yolov5l-seg.yaml +++ b/models/segment/yolov5l-seg.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/segment/yolov5m-seg.yaml b/models/segment/yolov5m-seg.yaml index 288577778..c3c1e668a 100644 --- a/models/segment/yolov5m-seg.yaml +++ b/models/segment/yolov5m-seg.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/segment/yolov5n-seg.yaml b/models/segment/yolov5n-seg.yaml index faf5228fd..2461e4160 100644 --- a/models/segment/yolov5n-seg.yaml +++ b/models/segment/yolov5n-seg.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/segment/yolov5s-seg.yaml b/models/segment/yolov5s-seg.yaml index a199f1d82..fac7664a3 100644 --- a/models/segment/yolov5s-seg.yaml +++ b/models/segment/yolov5s-seg.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/segment/yolov5x-seg.yaml b/models/segment/yolov5x-seg.yaml index 75f426386..d3c457a6d 100644 --- a/models/segment/yolov5x-seg.yaml +++ b/models/segment/yolov5x-seg.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/yolov5l.yaml b/models/yolov5l.yaml index 7cac7ead2..c6c878a10 100644 --- a/models/yolov5l.yaml +++ b/models/yolov5l.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/yolov5m.yaml b/models/yolov5m.yaml index 820e60704..41d9c223a 100644 --- a/models/yolov5m.yaml +++ b/models/yolov5m.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/yolov5n.yaml b/models/yolov5n.yaml index d3b84ace2..588674923 100644 --- a/models/yolov5n.yaml +++ b/models/yolov5n.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/yolov5s.yaml b/models/yolov5s.yaml index 090cb67c2..11ff79001 100644 --- a/models/yolov5s.yaml +++ b/models/yolov5s.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/models/yolov5x.yaml b/models/yolov5x.yaml index 8c1a6be1b..817b4f911 100644 --- a/models/yolov5x.yaml +++ b/models/yolov5x.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Parameters nc: 80 # number of classes diff --git a/pyproject.toml b/pyproject.toml index 2bcf65929..9680857af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Overview: # This pyproject.toml file manages the build, packaging, and distribution of the Ultralytics library. diff --git a/utils/google_app_engine/app.yaml b/utils/google_app_engine/app.yaml index 4c1751f55..6fb9d5f9d 100644 --- a/utils/google_app_engine/app.yaml +++ b/utils/google_app_engine/app.yaml @@ -1,4 +1,4 @@ -# Ultralytics YOLOv5 🚀, AGPL-3.0 license +# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license runtime: custom env: flex From 5cdad8922c83b0ed49a0173cd1a8b0739acbb336 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Thu, 30 Jan 2025 17:42:46 +0100 Subject: [PATCH 4/4] Update links.yml (#13503) Signed-off-by: Glenn Jocher --- .github/workflows/links.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index 07bf6db74..2da3c066f 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -44,7 +44,7 @@ jobs: --github-token ${{ secrets.GITHUB_TOKEN }} \ --header "User-Agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.6478.183 Safari/537.36" \ './**/*.md' \ - './**/*.html' + './**/*.html' | tee -a $GITHUB_STEP_SUMMARY - name: Test Markdown, HTML, YAML, Python and Notebook links with retry if: github.event_name == 'workflow_dispatch' @@ -69,4 +69,4 @@ jobs: './**/*.yml' \ './**/*.yaml' \ './**/*.py' \ - './**/*.ipynb' + './**/*.ipynb' | tee -a $GITHUB_STEP_SUMMARY