diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml
index 10891c8..a1a779d 100644
--- a/.github/workflows/format.yml
+++ b/.github/workflows/format.yml
@@ -1,7 +1,7 @@
# 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
+# This workflow formats code and documentation in PRs to Ultralytics standards
name: Ultralytics Actions
@@ -12,48 +12,44 @@ on:
branches: [main, master]
types: [opened, closed, synchronize, review_requested]
+permissions:
+ contents: write # Modify code in PRs
+ pull-requests: write # Add comments and labels to PRs
+ issues: write # Add comments and labels to issues
+
jobs:
- format:
+ actions:
runs-on: ubuntu-latest
steps:
- - name: Run Ultralytics Formatting
+ - name: Run Ultralytics Actions
uses: ultralytics/actions@main
with:
- token: ${{ secrets._GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- labels: true # autolabel issues and PRs
- python: true # format Python code and docstrings
- prettier: true # format YAML, JSON, Markdown and CSS
- spelling: true # check spelling
- links: false # check broken links
- summary: true # print PR summary with GPT4o (requires 'openai_api_key')
- openai_api_key: ${{ secrets.OPENAI_API_KEY }}
+ token: ${{ secrets._GITHUB_TOKEN || secrets.GITHUB_TOKEN }} # Auto-generated token
+ labels: true # Auto-label issues/PRs using AI
+ python: true # Format Python with Ruff and docformatter
+ prettier: true # Format YAML, JSON, Markdown, CSS
+ spelling: true # Check spelling with codespell
+ links: false # Check broken links with Lychee
+ summary: true # Generate AI-powered PR summaries
+ openai_api_key: ${{ secrets.OPENAI_API_KEY }} # Powers PR summaries, labels and comments
+ brave_api_key: ${{ secrets.BRAVE_API_KEY }} # Used for broken link resolution
first_issue_response: |
👋 Hello @${{ github.actor }}, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ [Tutorials](https://docs.ultralytics.com/yolov5/) to get started, where you can find quickstart guides for simple tasks like [Custom Data Training](https://docs.ultralytics.com/yolov5/tutorials/train_custom_data/) all the way to advanced concepts like [Hyperparameter Evolution](https://docs.ultralytics.com/yolov5/tutorials/hyperparameter_evolution/).
-
If this is a 🐛 Bug Report, please provide a **minimum reproducible example** to help us debug it.
-
If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our [Tips for Best Training Results](https://docs.ultralytics.com/guides/model-training-tips/).
-
## Requirements
-
[**Python>=3.8.0**](https://www.python.org/) with all [requirements.txt](https://github.com/ultralytics/yolov5/blob/master/requirements.txt) installed including [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/). To get started:
```bash
git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install
```
-
## Environments
-
YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including [CUDA](https://developer.nvidia.com/cuda)/[CUDNN](https://developer.nvidia.com/cudnn), [Python](https://www.python.org/) and [PyTorch](https://pytorch.org/) preinstalled):
-
- **Notebooks** with free GPU:
- **Google Cloud** Deep Learning VM. See [GCP Quickstart Guide](https://docs.ultralytics.com/yolov5/environments/google_cloud_quickstart_tutorial/)
- **Amazon** Deep Learning AMI. See [AWS Quickstart Guide](https://docs.ultralytics.com/yolov5/environments/aws_quickstart_tutorial/)
- **Docker Image**. See [Docker Quickstart Guide](https://docs.ultralytics.com/yolov5/environments/docker_image_quickstart_tutorial/)
-
## Status
-
-
If this badge is green, all [YOLOv5 GitHub Actions](https://github.com/ultralytics/yolov5/actions) Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 [training](https://github.com/ultralytics/yolov5/blob/master/train.py), [validation](https://github.com/ultralytics/yolov5/blob/master/val.py), [inference](https://github.com/ultralytics/yolov5/blob/master/detect.py), [export](https://github.com/ultralytics/yolov5/blob/master/export.py) and [benchmarks](https://github.com/ultralytics/yolov5/blob/master/benchmarks.py) on macOS, Windows, and Ubuntu every 24 hours and on every commit.
diff --git a/benchmarks.py b/benchmarks.py
index 45ae55b..2bf39f5 100644
--- a/benchmarks.py
+++ b/benchmarks.py
@@ -1,4 +1,5 @@
# 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 59db133..8492b89 100644
--- a/classify/predict.py
+++ b/classify/predict.py
@@ -1,4 +1,5 @@
# 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 d454c71..1f990ff 100644
--- a/classify/train.py
+++ b/classify/train.py
@@ -1,4 +1,5 @@
# 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 72bd0e1..efbf3e1 100644
--- a/classify/val.py
+++ b/classify/val.py
@@ -1,4 +1,5 @@
# 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 24724a3..84c683c 100644
--- a/detect.py
+++ b/detect.py
@@ -1,4 +1,5 @@
# 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 5e713e1..43fd9a2 100644
--- a/export.py
+++ b/export.py
@@ -1,4 +1,5 @@
# 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 9d10630..b055606 100644
--- a/hubconf.py
+++ b/hubconf.py
@@ -1,4 +1,5 @@
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
+
"""
PyTorch Hub models https://pytorch.org/hub/ultralytics_yolov5.
diff --git a/models/common.py b/models/common.py
index 341e878..92ea830 100644
--- a/models/common.py
+++ b/models/common.py
@@ -1,4 +1,5 @@
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
+
"""Common modules."""
import ast
diff --git a/models/experimental.py b/models/experimental.py
index 63d9c46..5a86d2f 100644
--- a/models/experimental.py
+++ b/models/experimental.py
@@ -1,4 +1,5 @@
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
+
"""Experimental modules."""
import math
diff --git a/models/tf.py b/models/tf.py
index c2cad39..1fb57b5 100644
--- a/models/tf.py
+++ b/models/tf.py
@@ -1,4 +1,5 @@
# 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 13498ac..62e5ee1 100644
--- a/models/yolo.py
+++ b/models/yolo.py
@@ -1,4 +1,5 @@
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
+
"""
YOLO-specific modules.
diff --git a/segment/predict.py b/segment/predict.py
index e0e4336..76647a4 100644
--- a/segment/predict.py
+++ b/segment/predict.py
@@ -1,4 +1,5 @@
# 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 815c97c..dcfbcb4 100644
--- a/segment/train.py
+++ b/segment/train.py
@@ -1,4 +1,5 @@
# 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 edd6a08..0c9b320 100644
--- a/segment/val.py
+++ b/segment/val.py
@@ -1,4 +1,5 @@
# 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 1401ccb..fb548ed 100644
--- a/train.py
+++ b/train.py
@@ -1,4 +1,5 @@
# 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 3c43c9b..2072b40 100644
--- a/utils/__init__.py
+++ b/utils/__init__.py
@@ -1,4 +1,5 @@
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
+
"""utils/initialization."""
import contextlib
diff --git a/utils/activations.py b/utils/activations.py
index 4652540..b546040 100644
--- a/utils/activations.py
+++ b/utils/activations.py
@@ -1,4 +1,5 @@
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
+
"""Activation functions."""
import torch
diff --git a/utils/augmentations.py b/utils/augmentations.py
index 79e7afc..3b31b87 100644
--- a/utils/augmentations.py
+++ b/utils/augmentations.py
@@ -1,4 +1,5 @@
# 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 1fc4207..4a434dd 100644
--- a/utils/autoanchor.py
+++ b/utils/autoanchor.py
@@ -1,4 +1,5 @@
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
+
"""AutoAnchor utils."""
import random
diff --git a/utils/autobatch.py b/utils/autobatch.py
index 9d5ea0a..e9c39ea 100644
--- a/utils/autobatch.py
+++ b/utils/autobatch.py
@@ -1,4 +1,5 @@
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
+
"""Auto-batch utils."""
from copy import deepcopy
diff --git a/utils/callbacks.py b/utils/callbacks.py
index 1a60928..7e37607 100644
--- a/utils/callbacks.py
+++ b/utils/callbacks.py
@@ -1,4 +1,5 @@
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
+
"""Callback utils."""
import threading
diff --git a/utils/dataloaders.py b/utils/dataloaders.py
index e8341d6..4ef394f 100644
--- a/utils/dataloaders.py
+++ b/utils/dataloaders.py
@@ -1,4 +1,5 @@
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
+
"""Dataloaders and dataset utils."""
import contextlib
diff --git a/utils/downloads.py b/utils/downloads.py
index f51d67a..037eca0 100644
--- a/utils/downloads.py
+++ b/utils/downloads.py
@@ -1,4 +1,5 @@
# 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 db88e80..bf4fa0b 100644
--- a/utils/flask_rest_api/example_request.py
+++ b/utils/flask_rest_api/example_request.py
@@ -1,4 +1,5 @@
# 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 410ae26..09d4e72 100644
--- a/utils/flask_rest_api/restapi.py
+++ b/utils/flask_rest_api/restapi.py
@@ -1,4 +1,5 @@
# 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 89bbc61..b582044 100644
--- a/utils/general.py
+++ b/utils/general.py
@@ -1,4 +1,5 @@
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
+
"""General utils."""
import contextlib
diff --git a/utils/loggers/__init__.py b/utils/loggers/__init__.py
index 9ff5f56..aabdbae 100644
--- a/utils/loggers/__init__.py
+++ b/utils/loggers/__init__.py
@@ -1,4 +1,5 @@
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
+
"""Logging utils."""
import json
diff --git a/utils/loggers/clearml/clearml_utils.py b/utils/loggers/clearml/clearml_utils.py
index 67553bd..5969e96 100644
--- a/utils/loggers/clearml/clearml_utils.py
+++ b/utils/loggers/clearml/clearml_utils.py
@@ -1,4 +1,5 @@
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
+
"""Main Logger class for ClearML experiment tracking."""
import glob
diff --git a/utils/loss.py b/utils/loss.py
index 35ce6d7..a1317b4 100644
--- a/utils/loss.py
+++ b/utils/loss.py
@@ -1,4 +1,5 @@
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
+
"""Loss functions."""
import torch
diff --git a/utils/metrics.py b/utils/metrics.py
index 03013f4..e50eea0 100644
--- a/utils/metrics.py
+++ b/utils/metrics.py
@@ -1,4 +1,5 @@
# 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 f70775f..c3d604d 100644
--- a/utils/plots.py
+++ b/utils/plots.py
@@ -1,4 +1,5 @@
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
+
"""Plotting utils."""
import contextlib
diff --git a/utils/segment/augmentations.py b/utils/segment/augmentations.py
index 14a81cf..a530cd5 100644
--- a/utils/segment/augmentations.py
+++ b/utils/segment/augmentations.py
@@ -1,4 +1,5 @@
# 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 2363d72..7ed136e 100644
--- a/utils/segment/dataloaders.py
+++ b/utils/segment/dataloaders.py
@@ -1,4 +1,5 @@
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
+
"""Dataloaders."""
import os
diff --git a/utils/segment/metrics.py b/utils/segment/metrics.py
index 3bb7aee..6bd941e 100644
--- a/utils/segment/metrics.py
+++ b/utils/segment/metrics.py
@@ -1,4 +1,5 @@
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
+
"""Model validation metrics."""
import numpy as np
diff --git a/utils/torch_utils.py b/utils/torch_utils.py
index 8b3c43b..5090df7 100644
--- a/utils/torch_utils.py
+++ b/utils/torch_utils.py
@@ -1,4 +1,5 @@
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
+
"""PyTorch utils."""
import math
diff --git a/utils/triton.py b/utils/triton.py
index 88c0bd7..69bf3f8 100644
--- a/utils/triton.py
+++ b/utils/triton.py
@@ -1,4 +1,5 @@
# 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 600353b..2f95960 100644
--- a/val.py
+++ b/val.py
@@ -1,4 +1,5 @@
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
+
"""
Validate a trained YOLOv5 detection model on a detection dataset.