退购1.1定位算法
This commit is contained in:
209
.github/workflows/ci.yaml
vendored
Normal file
209
.github/workflows/ci.yaml
vendored
Normal file
@ -0,0 +1,209 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
# YOLO Continuous Integration (CI) GitHub Actions tests
|
||||
|
||||
name: Ultralytics CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
schedule:
|
||||
- cron: '0 0 * * *' # runs at 00:00 UTC every day
|
||||
|
||||
jobs:
|
||||
HUB:
|
||||
if: github.repository == 'ultralytics/ultralytics' && (github.event_name == 'schedule' || github.event_name == 'push')
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
python-version: ['3.10']
|
||||
model: [yolov5n]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: 'pip' # caching pip dependencies
|
||||
- name: Install requirements
|
||||
shell: bash # for Windows compatibility
|
||||
run: |
|
||||
python -m pip install --upgrade pip wheel
|
||||
pip install -e . --extra-index-url https://download.pytorch.org/whl/cpu
|
||||
- name: Check environment
|
||||
run: |
|
||||
echo "RUNNER_OS is ${{ runner.os }}"
|
||||
echo "GITHUB_EVENT_NAME is ${{ github.event_name }}"
|
||||
echo "GITHUB_WORKFLOW is ${{ github.workflow }}"
|
||||
echo "GITHUB_ACTOR is ${{ github.actor }}"
|
||||
echo "GITHUB_REPOSITORY is ${{ github.repository }}"
|
||||
echo "GITHUB_REPOSITORY_OWNER is ${{ github.repository_owner }}"
|
||||
python --version
|
||||
pip --version
|
||||
pip list
|
||||
- name: Test HUB training
|
||||
shell: python
|
||||
env:
|
||||
API_KEY: ${{ secrets.ULTRALYTICS_HUB_API_KEY }}
|
||||
MODEL_ID: ${{ secrets.ULTRALYTICS_HUB_MODEL_ID }}
|
||||
run: |
|
||||
import os
|
||||
from ultralytics import YOLO, hub
|
||||
api_key, model_id = os.environ['API_KEY'], os.environ['MODEL_ID']
|
||||
hub.login(api_key)
|
||||
hub.reset_model(model_id)
|
||||
model = YOLO('https://hub.ultralytics.com/models/' + model_id)
|
||||
model.train()
|
||||
|
||||
Benchmarks:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
python-version: ['3.10']
|
||||
model: [yolov8n]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: 'pip' # caching pip dependencies
|
||||
- name: Install requirements
|
||||
shell: bash # for Windows compatibility
|
||||
run: |
|
||||
python -m pip install --upgrade pip wheel
|
||||
if [ "${{ matrix.os }}" == "macos-latest" ]; then
|
||||
pip install -e '.[export]' --extra-index-url https://download.pytorch.org/whl/cpu
|
||||
else
|
||||
pip install -e '.[export]' --extra-index-url https://download.pytorch.org/whl/cpu
|
||||
fi
|
||||
yolo export format=tflite imgsz=32
|
||||
- name: Check environment
|
||||
run: |
|
||||
echo "RUNNER_OS is ${{ runner.os }}"
|
||||
echo "GITHUB_EVENT_NAME is ${{ github.event_name }}"
|
||||
echo "GITHUB_WORKFLOW is ${{ github.workflow }}"
|
||||
echo "GITHUB_ACTOR is ${{ github.actor }}"
|
||||
echo "GITHUB_REPOSITORY is ${{ github.repository }}"
|
||||
echo "GITHUB_REPOSITORY_OWNER is ${{ github.repository_owner }}"
|
||||
python --version
|
||||
pip --version
|
||||
pip list
|
||||
- name: Benchmark DetectionModel
|
||||
shell: python
|
||||
run: |
|
||||
from ultralytics.yolo.utils.benchmarks import benchmark
|
||||
benchmark(model='${{ matrix.model }}.pt', imgsz=160, half=False, hard_fail=0.20)
|
||||
- name: Benchmark SegmentationModel
|
||||
shell: python
|
||||
run: |
|
||||
from ultralytics.yolo.utils.benchmarks import benchmark
|
||||
benchmark(model='${{ matrix.model }}-seg.pt', imgsz=160, half=False, hard_fail=0.14)
|
||||
- name: Benchmark ClassificationModel
|
||||
shell: python
|
||||
run: |
|
||||
from ultralytics.yolo.utils.benchmarks import benchmark
|
||||
benchmark(model='${{ matrix.model }}-cls.pt', imgsz=160, half=False, hard_fail=0.61)
|
||||
- name: Benchmark PoseModel
|
||||
shell: python
|
||||
run: |
|
||||
from ultralytics.yolo.utils.benchmarks import benchmark
|
||||
benchmark(model='${{ matrix.model }}-pose.pt', imgsz=160, half=False, hard_fail=0.0)
|
||||
- name: Benchmark Summary
|
||||
run: |
|
||||
cat benchmarks.log
|
||||
echo "$(cat benchmarks.log)" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
Tests:
|
||||
timeout-minutes: 60
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
model: [yolov8n]
|
||||
torch: [latest]
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
python-version: '3.8' # torch 1.7.0 requires python >=3.6, <=3.8
|
||||
model: yolov8n
|
||||
torch: '1.8.0' # min torch version CI https://pypi.org/project/torchvision/
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: 'pip' # caching pip dependencies
|
||||
- name: Install requirements
|
||||
shell: bash # for Windows compatibility
|
||||
run: |
|
||||
python -m pip install --upgrade pip wheel
|
||||
if [ "${{ matrix.torch }}" == "1.8.0" ]; then
|
||||
pip install -e . torch==1.8.0 torchvision==0.9.0 pytest --extra-index-url https://download.pytorch.org/whl/cpu
|
||||
else
|
||||
pip install -e . pytest --extra-index-url https://download.pytorch.org/whl/cpu
|
||||
fi
|
||||
- name: Check environment
|
||||
run: |
|
||||
echo "RUNNER_OS is ${{ runner.os }}"
|
||||
echo "GITHUB_EVENT_NAME is ${{ github.event_name }}"
|
||||
echo "GITHUB_WORKFLOW is ${{ github.workflow }}"
|
||||
echo "GITHUB_ACTOR is ${{ github.actor }}"
|
||||
echo "GITHUB_REPOSITORY is ${{ github.repository }}"
|
||||
echo "GITHUB_REPOSITORY_OWNER is ${{ github.repository_owner }}"
|
||||
python --version
|
||||
pip --version
|
||||
pip list
|
||||
- name: Test Detect
|
||||
shell: bash # for Windows compatibility
|
||||
run: |
|
||||
yolo detect train data=coco8.yaml model=yolov8n.yaml epochs=1 imgsz=32
|
||||
yolo detect train data=coco8.yaml model=yolov8n.pt epochs=1 imgsz=32
|
||||
yolo detect val data=coco8.yaml model=runs/detect/train/weights/last.pt imgsz=32
|
||||
yolo detect predict model=runs/detect/train/weights/last.pt imgsz=32 source=ultralytics/assets/bus.jpg
|
||||
yolo export model=runs/detect/train/weights/last.pt imgsz=32 format=torchscript
|
||||
- name: Test Segment
|
||||
shell: bash # for Windows compatibility
|
||||
run: |
|
||||
yolo segment train data=coco8-seg.yaml model=yolov8n-seg.yaml epochs=1 imgsz=32
|
||||
yolo segment train data=coco8-seg.yaml model=yolov8n-seg.pt epochs=1 imgsz=32
|
||||
yolo segment val data=coco8-seg.yaml model=runs/segment/train/weights/last.pt imgsz=32
|
||||
yolo segment predict model=runs/segment/train/weights/last.pt imgsz=32 source=ultralytics/assets/bus.jpg
|
||||
yolo export model=runs/segment/train/weights/last.pt imgsz=32 format=torchscript
|
||||
- name: Test Classify
|
||||
shell: bash # for Windows compatibility
|
||||
run: |
|
||||
yolo classify train data=imagenet10 model=yolov8n-cls.yaml epochs=1 imgsz=32
|
||||
yolo classify train data=imagenet10 model=yolov8n-cls.pt epochs=1 imgsz=32
|
||||
yolo classify val data=imagenet10 model=runs/classify/train/weights/last.pt imgsz=32
|
||||
yolo classify predict model=runs/classify/train/weights/last.pt imgsz=32 source=ultralytics/assets/bus.jpg
|
||||
yolo export model=runs/classify/train/weights/last.pt imgsz=32 format=torchscript
|
||||
- name: Test Pose
|
||||
shell: bash # for Windows compatibility
|
||||
run: |
|
||||
yolo pose train data=coco8-pose.yaml model=yolov8n-pose.yaml epochs=1 imgsz=32
|
||||
yolo pose train data=coco8-pose.yaml model=yolov8n-pose.pt epochs=1 imgsz=32
|
||||
yolo pose val data=coco8-pose.yaml model=runs/pose/train/weights/last.pt imgsz=32
|
||||
yolo pose predict model=runs/pose/train/weights/last.pt imgsz=32 source=ultralytics/assets/bus.jpg
|
||||
yolo export model=runs/pose/train/weights/last.pt imgsz=32 format=torchscript
|
||||
- name: Pytest tests
|
||||
shell: bash # for Windows compatibility
|
||||
run: pytest tests
|
||||
|
||||
Summary:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [HUB, Benchmarks, Tests] # Add job names that you want to check for failure
|
||||
if: always() # This ensures the job runs even if previous jobs fail
|
||||
steps:
|
||||
- name: Check for failure and notify
|
||||
if: (needs.HUB.result == 'failure' || needs.Benchmarks.result == 'failure' || needs.Tests.result == 'failure') && github.repository == 'ultralytics/ultralytics' && (github.event_name == 'schedule' || github.event_name == 'push')
|
||||
uses: slackapi/slack-github-action@v1.23.0
|
||||
with:
|
||||
payload: |
|
||||
{"text": "<!channel> GitHub Actions error for ${{ github.workflow }} ❌\n\n\n*Repository:* https://github.com/${{ github.repository }}\n*Action:* https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\n*Author:* ${{ github.actor }}\n*Event:* ${{ github.event_name }}\n"}
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_YOLO }}
|
37
.github/workflows/cla.yml
vendored
Normal file
37
.github/workflows/cla.yml
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
|
||||
name: CLA Assistant
|
||||
on:
|
||||
issue_comment:
|
||||
types:
|
||||
- created
|
||||
pull_request_target:
|
||||
types:
|
||||
- reopened
|
||||
- opened
|
||||
- synchronize
|
||||
|
||||
jobs:
|
||||
CLA:
|
||||
if: github.repository == 'ultralytics/ultralytics'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: CLA Assistant
|
||||
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I sign the CLA') || github.event_name == 'pull_request_target'
|
||||
uses: contributor-assistant/github-action@v2.3.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# must be repository secret token
|
||||
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
||||
with:
|
||||
path-to-signatures: 'signatures/version1/cla.json'
|
||||
path-to-document: 'https://docs.ultralytics.com/help/CLA' # CLA document
|
||||
# branch should not be protected
|
||||
branch: 'main'
|
||||
allowlist: dependabot[bot],github-actions,[pre-commit*,pre-commit*,bot*
|
||||
|
||||
remote-organization-name: ultralytics
|
||||
remote-repository-name: cla
|
||||
custom-pr-sign-comment: 'I have read the CLA Document and I sign the CLA'
|
||||
custom-allsigned-prcomment: All Contributors have signed the CLA. ✅
|
||||
#custom-notsigned-prcomment: 'pull request comment with Introductory message to ask new contributors to sign'
|
41
.github/workflows/codeql.yaml
vendored
Normal file
41
.github/workflows/codeql.yaml
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 1 * *'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ${{ 'ubuntu-latest' }}
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'python' ]
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
# queries: security-extended,security-and-quality
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
67
.github/workflows/docker.yaml
vendored
Normal file
67
.github/workflows/docker.yaml
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
# Builds ultralytics/ultralytics:latest images on DockerHub https://hub.docker.com/r/ultralytics
|
||||
|
||||
name: Publish Docker Images
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
if: github.repository == 'ultralytics/ultralytics'
|
||||
name: Push Docker image to Docker Hub
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build and push arm64 image
|
||||
uses: docker/build-push-action@v4
|
||||
continue-on-error: true
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/arm64
|
||||
file: docker/Dockerfile-arm64
|
||||
push: true
|
||||
tags: ultralytics/ultralytics:latest-arm64
|
||||
|
||||
- name: Build and push Jetson image
|
||||
uses: docker/build-push-action@v4
|
||||
continue-on-error: true
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/arm64
|
||||
file: docker/Dockerfile-jetson
|
||||
push: true
|
||||
tags: ultralytics/ultralytics:latest-jetson
|
||||
|
||||
- name: Build and push CPU image
|
||||
uses: docker/build-push-action@v4
|
||||
continue-on-error: true
|
||||
with:
|
||||
context: .
|
||||
file: docker/Dockerfile-cpu
|
||||
push: true
|
||||
tags: ultralytics/ultralytics:latest-cpu
|
||||
|
||||
- name: Build and push GPU image
|
||||
uses: docker/build-push-action@v4
|
||||
continue-on-error: true
|
||||
with:
|
||||
context: .
|
||||
file: docker/Dockerfile
|
||||
push: true
|
||||
tags: ultralytics/ultralytics:latest
|
56
.github/workflows/greetings.yml
vendored
Normal file
56
.github/workflows/greetings.yml
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
|
||||
name: Greetings
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
greeting:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/first-interaction@v1
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
pr-message: |
|
||||
👋 Hello @${{ github.actor }}, thank you for submitting a YOLOv8 🚀 PR! To allow your work to be integrated as seamlessly as possible, we advise you to:
|
||||
|
||||
- ✅ Verify your PR is **up-to-date** with `ultralytics/ultralytics` `main` branch. If your PR is behind you can update your code by clicking the 'Update branch' button or by running `git pull` and `git merge main` locally.
|
||||
- ✅ Verify all YOLOv8 Continuous Integration (CI) **checks are passing**.
|
||||
- ✅ Update YOLOv8 [Docs](https://docs.ultralytics.com) for any new or updated features.
|
||||
- ✅ Reduce changes to the absolute **minimum** required for your bug fix or feature addition. _"It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is."_ — Bruce Lee
|
||||
|
||||
See our [Contributing Guide](https://docs.ultralytics.com/help/contributing) for details and let us know if you have any questions!
|
||||
|
||||
issue-message: |
|
||||
👋 Hello @${{ github.actor }}, thank you for your interest in YOLOv8 🚀! We recommend a visit to the [YOLOv8 Docs](https://docs.ultralytics.com) for new users where you can find many [Python](https://docs.ultralytics.com/usage/python/) and [CLI](https://docs.ultralytics.com/usage/cli/) usage examples and where many of the most common questions may already be answered.
|
||||
|
||||
If this is a 🐛 Bug Report, please provide a [minimum reproducible example](https://docs.ultralytics.com/help/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/yolov5/tutorials/tips_for_best_training_results/).
|
||||
|
||||
## Install
|
||||
|
||||
Pip install the `ultralytics` package including all [requirements](https://github.com/ultralytics/ultralytics/blob/main/requirements.txt) in a [**Python>=3.7**](https://www.python.org/) environment with [**PyTorch>=1.7**](https://pytorch.org/get-started/locally/).
|
||||
|
||||
```bash
|
||||
pip install ultralytics
|
||||
```
|
||||
|
||||
## Environments
|
||||
|
||||
YOLOv8 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: <a href="https://console.paperspace.com/github/ultralytics/ultralytics"><img src="https://assets.paperspace.io/img/gradient-badge.svg" alt="Run on Gradient"/></a> <a href="https://colab.research.google.com/github/ultralytics/ultralytics/blob/main/examples/tutorial.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> <a href="https://www.kaggle.com/ultralytics/yolov8"><img src="https://kaggle.com/static/images/open-in-kaggle.svg" alt="Open In Kaggle"></a>
|
||||
- **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/) <a href="https://hub.docker.com/r/ultralytics/ultralytics"><img src="https://img.shields.io/docker/pulls/ultralytics/ultralytics?logo=docker" alt="Docker Pulls"></a>
|
||||
|
||||
## Status
|
||||
|
||||
<a href="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml?query=event%3Aschedule"><img src="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml/badge.svg" alt="Ultralytics CI"></a>
|
||||
|
||||
If this badge is green, all [Ultralytics CI](https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml?query=event%3Aschedule) tests are currently passing. CI tests verify correct operation of all YOLOv8 [Modes](https://docs.ultralytics.com/modes/) and [Tasks](https://docs.ultralytics.com/tasks/) on macOS, Windows, and Ubuntu every 24 hours and on every commit.
|
40
.github/workflows/links.yml
vendored
Normal file
40
.github/workflows/links.yml
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
# YOLO Continuous Integration (CI) GitHub Actions tests broken link checker
|
||||
# Accept 429(Instagram, 'too many requests'), 999(LinkedIn, 'unknown status code'), Timeout(Twitter)
|
||||
|
||||
name: Check Broken links
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 0 * * *' # runs at 00:00 UTC every day
|
||||
|
||||
jobs:
|
||||
Links:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Download and install lychee
|
||||
run: |
|
||||
LYCHEE_URL=$(curl -s https://api.github.com/repos/lycheeverse/lychee/releases/latest | grep "browser_download_url" | grep "x86_64-unknown-linux-gnu.tar.gz" | cut -d '"' -f 4)
|
||||
curl -L $LYCHEE_URL -o lychee.tar.gz
|
||||
tar xzf lychee.tar.gz
|
||||
sudo mv lychee /usr/local/bin
|
||||
|
||||
- name: Test Markdown and HTML links with retry
|
||||
uses: nick-invision/retry@v2
|
||||
with:
|
||||
timeout_minutes: 5
|
||||
retry_wait_seconds: 60
|
||||
max_attempts: 3
|
||||
command: lychee --accept 429,999 --exclude-loopback --exclude 'https?://(www\.)?(twitter\.com|instagram\.com)' --exclude-path '**/ci.yaml' --exclude-mail --github-token ${{ secrets.GITHUB_TOKEN }} './**/*.md' './**/*.html'
|
||||
|
||||
- name: Test Markdown, HTML, YAML, Python and Notebook links with retry
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
uses: nick-invision/retry@v2
|
||||
with:
|
||||
timeout_minutes: 5
|
||||
retry_wait_seconds: 60
|
||||
max_attempts: 3
|
||||
command: lychee --accept 429,999 --exclude-loopback --exclude 'https?://(www\.)?(twitter\.com|instagram\.com|url\.com)' --exclude-path '**/ci.yaml' --exclude-mail --github-token ${{ secrets.GITHUB_TOKEN }} './**/*.md' './**/*.html' './**/*.yml' './**/*.yaml' './**/*.py' './**/*.ipynb'
|
110
.github/workflows/publish.yml
vendored
Normal file
110
.github/workflows/publish.yml
vendored
Normal file
@ -0,0 +1,110 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
# Publish pip package to PyPI https://pypi.org/project/ultralytics/ and Docs to https://docs.ultralytics.com
|
||||
|
||||
name: Publish to PyPI and Deploy Docs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
pypi:
|
||||
type: boolean
|
||||
description: Publish to PyPI
|
||||
docs:
|
||||
type: boolean
|
||||
description: Deploy Docs
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
if: github.repository == 'ultralytics/ultralytics' && github.actor == 'glenn-jocher'
|
||||
name: Publish
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: "0" # pulls all commits (needed correct last updated dates in Docs)
|
||||
- name: Set up Python environment
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.10'
|
||||
cache: 'pip' # caching pip dependencies
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip wheel build twine
|
||||
pip install -e '.[dev]' --extra-index-url https://download.pytorch.org/whl/cpu
|
||||
- name: Check PyPI version
|
||||
shell: python
|
||||
run: |
|
||||
import os
|
||||
import pkg_resources as pkg
|
||||
import ultralytics
|
||||
from ultralytics.yolo.utils.checks import check_latest_pypi_version
|
||||
|
||||
v_local = pkg.parse_version(ultralytics.__version__).release
|
||||
v_pypi = pkg.parse_version(check_latest_pypi_version()).release
|
||||
print(f'Local version is {v_local}')
|
||||
print(f'PyPI version is {v_pypi}')
|
||||
d = [a - b for a, b in zip(v_local, v_pypi)] # diff
|
||||
increment = (d[0] == d[1] == 0) and d[2] == 1 # only publish if patch version increments by 1
|
||||
os.system(f'echo "increment={increment}" >> $GITHUB_OUTPUT')
|
||||
os.system(f'echo "version={ultralytics.__version__}" >> $GITHUB_OUTPUT')
|
||||
if increment:
|
||||
print('Local version is higher than PyPI version. Publishing new version to PyPI ✅.')
|
||||
id: check_pypi
|
||||
- name: Publish to PyPI
|
||||
continue-on-error: true
|
||||
if: (github.event_name == 'push' || github.event.inputs.pypi == 'true') && steps.check_pypi.outputs.increment == 'True'
|
||||
env:
|
||||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
|
||||
run: |
|
||||
python -m build
|
||||
python -m twine upload dist/* -u __token__ -p $PYPI_TOKEN
|
||||
- name: Deploy Docs
|
||||
continue-on-error: true
|
||||
if: (github.event_name == 'push' && steps.check_pypi.outputs.increment == 'True') || github.event.inputs.docs == 'true'
|
||||
env:
|
||||
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
||||
run: |
|
||||
mkdocs build
|
||||
git config --global user.name "Glenn Jocher"
|
||||
git config --global user.email "glenn.jocher@ultralytics.com"
|
||||
git clone https://github.com/ultralytics/docs.git docs-repo
|
||||
cd docs-repo
|
||||
git checkout gh-pages || git checkout -b gh-pages
|
||||
rm -rf *
|
||||
cp -R ../site/* .
|
||||
git add .
|
||||
git commit -m "Update Docs for 'ultralytics ${{ steps.check_pypi.outputs.version }}'"
|
||||
git push https://${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/ultralytics/docs.git gh-pages
|
||||
- name: Extract PR Details
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
||||
PR_JSON=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }})
|
||||
PR_NUMBER=${{ github.event.pull_request.number }}
|
||||
PR_TITLE=$(echo $PR_JSON | jq -r '.title')
|
||||
else
|
||||
COMMIT_SHA=${{ github.event.after }}
|
||||
PR_JSON=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/search/issues?q=repo:${{ github.repository }}+is:pr+is:merged+sha:$COMMIT_SHA")
|
||||
PR_NUMBER=$(echo $PR_JSON | jq -r '.items[0].number')
|
||||
PR_TITLE=$(echo $PR_JSON | jq -r '.items[0].title')
|
||||
fi
|
||||
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
|
||||
echo "PR_TITLE=$PR_TITLE" >> $GITHUB_ENV
|
||||
- name: Notify on Slack (Success)
|
||||
if: success() && github.event_name == 'push' && steps.check_pypi.outputs.increment == 'True'
|
||||
uses: slackapi/slack-github-action@v1.23.0
|
||||
with:
|
||||
payload: |
|
||||
{"text": "<!channel> GitHub Actions success for ${{ github.workflow }} ✅\n\n\n*Repository:* https://github.com/${{ github.repository }}\n*Action:* https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\n*Author:* ${{ github.actor }}\n*Event:* NEW 'ultralytics ${{ steps.check_pypi.outputs.version }}' pip package published 😃\n*Job Status:* ${{ job.status }}\n*Pull Request:* <https://github.com/${{ github.repository }}/pull/${{ env.PR_NUMBER }}> ${{ env.PR_TITLE }}\n"}
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_YOLO }}
|
||||
- name: Notify on Slack (Failure)
|
||||
if: failure()
|
||||
uses: slackapi/slack-github-action@v1.23.0
|
||||
with:
|
||||
payload: |
|
||||
{"text": "<!channel> GitHub Actions error for ${{ github.workflow }} ❌\n\n\n*Repository:* https://github.com/${{ github.repository }}\n*Action:* https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\n*Author:* ${{ github.actor }}\n*Event:* ${{ github.event_name }}\n*Job Status:* ${{ job.status }}\n*Pull Request:* <https://github.com/${{ github.repository }}/pull/${{ env.PR_NUMBER }}> ${{ env.PR_TITLE }}\n"}
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_YOLO }}
|
47
.github/workflows/stale.yml
vendored
Normal file
47
.github/workflows/stale.yml
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
|
||||
name: Close stale issues
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *' # Runs at 00:00 UTC every day
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v8
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
stale-issue-message: |
|
||||
👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.
|
||||
|
||||
For additional resources and information, please see the links below:
|
||||
|
||||
- **Docs**: https://docs.ultralytics.com
|
||||
- **HUB**: https://hub.ultralytics.com
|
||||
- **Community**: https://community.ultralytics.com
|
||||
|
||||
Feel free to inform us of any other **issues** you discover or **feature requests** that come to mind in the future. Pull Requests (PRs) are also always welcomed!
|
||||
|
||||
Thank you for your contributions to YOLO 🚀 and Vision AI ⭐
|
||||
|
||||
stale-pr-message: |
|
||||
👋 Hello there! We wanted to let you know that we've decided to close this pull request due to inactivity. We appreciate the effort you put into contributing to our project, but unfortunately, not all contributions are suitable or aligned with our product roadmap.
|
||||
|
||||
We hope you understand our decision, and please don't let it discourage you from contributing to open source projects in the future. We value all of our community members and their contributions, and we encourage you to keep exploring new projects and ways to get involved.
|
||||
|
||||
For additional resources and information, please see the links below:
|
||||
|
||||
- **Docs**: https://docs.ultralytics.com
|
||||
- **HUB**: https://hub.ultralytics.com
|
||||
- **Community**: https://community.ultralytics.com
|
||||
|
||||
Thank you for your contributions to YOLO 🚀 and Vision AI ⭐
|
||||
|
||||
days-before-issue-stale: 30
|
||||
days-before-issue-close: 10
|
||||
days-before-pr-stale: 90
|
||||
days-before-pr-close: 30
|
||||
exempt-issue-labels: 'documentation,tutorial,TODO'
|
||||
operations-per-run: 300 # The maximum number of operations per run, used to control rate limiting.
|
Reference in New Issue
Block a user