Commit 7a650e36 authored by mashun1's avatar mashun1
Browse files

yolov5-qat

parents
Pipeline #821 canceled with stages
# Repo-specific DockerIgnore -------------------------------------------------------------------------------------------
.git
.cache
.idea
runs
output
coco
storage.googleapis.com
data/samples/*
**/results*.csv
*.jpg
# Neural Network weights -----------------------------------------------------------------------------------------------
**/*.pt
**/*.pth
**/*.onnx
**/*.engine
**/*.mlmodel
**/*.torchscript
**/*.torchscript.pt
**/*.tflite
**/*.h5
**/*.pb
*_saved_model/
*_web_model/
*_openvino_model/
# Below Copied From .gitignore -----------------------------------------------------------------------------------------
# Below Copied From .gitignore -----------------------------------------------------------------------------------------
# GitHub Python GitIgnore ----------------------------------------------------------------------------------------------
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
wandb/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# dotenv
.env
# virtualenv
.venv*
venv*/
ENV*/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
# https://github.com/github/gitignore/blob/master/Global/macOS.gitignore -----------------------------------------------
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
Icon?
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff:
.idea/*
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
.html # Bokeh Plots
.pg # TensorFlow Frozen Graphs
.avi # videos
# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
# Gradle:
.idea/**/gradle.xml
.idea/**/libraries
# CMake
cmake-build-debug/
cmake-build-release/
# Mongo Explorer plugin:
.idea/**/mongoSettings.xml
## File-based project format:
*.iws
## Plugin-specific files:
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# this drop notebooks from GitHub language stats
*.ipynb linguist-vendored
name: 🐛 Bug Report
# title: " "
description: Problems with YOLOv5
labels: [bug, triage]
body:
- type: markdown
attributes:
value: |
Thank you for submitting a YOLOv5 🐛 Bug Report!
- type: checkboxes
attributes:
label: Search before asking
description: >
Please search the [issues](https://github.com/ultralytics/yolov5/issues) to see if a similar bug report already exists.
options:
- label: >
I have searched the YOLOv5 [issues](https://github.com/ultralytics/yolov5/issues) and found no similar bug report.
required: true
- type: dropdown
attributes:
label: YOLOv5 Component
description: |
Please select the part of YOLOv5 where you found the bug.
multiple: true
options:
- "Training"
- "Validation"
- "Detection"
- "Export"
- "PyTorch Hub"
- "Multi-GPU"
- "Evolution"
- "Integrations"
- "Other"
validations:
required: false
- type: textarea
attributes:
label: Bug
description: Provide console output with error messages and/or screenshots of the bug.
placeholder: |
💡 ProTip! Include as much information as possible (screenshots, logs, tracebacks etc.) to receive the most helpful response.
validations:
required: true
- type: textarea
attributes:
label: Environment
description: Please specify the software and hardware you used to produce the bug.
placeholder: |
- YOLO: YOLOv5 🚀 v6.0-67-g60e42e1 torch 1.9.0+cu111 CUDA:0 (A100-SXM4-40GB, 40536MiB)
- OS: Ubuntu 20.04
- Python: 3.9.0
validations:
required: false
- type: textarea
attributes:
label: Minimal Reproducible Example
description: >
When asking a question, people will be better able to provide help if you provide code that they can easily understand and use to **reproduce** the problem.
This is referred to by community members as creating a [minimal reproducible example](https://docs.ultralytics.com/help/minimum_reproducible_example/).
placeholder: |
```
# Code to reproduce your issue here
```
validations:
required: false
- type: textarea
attributes:
label: Additional
description: Anything else you would like to share?
- type: checkboxes
attributes:
label: Are you willing to submit a PR?
description: >
(Optional) We encourage you to submit a [Pull Request](https://github.com/ultralytics/yolov5/pulls) (PR) to help improve YOLOv5 for everyone, especially if you have a good understanding of how to implement a fix or feature.
See the YOLOv5 [Contributing Guide](https://docs.ultralytics.com/help/contributing) to get started.
options:
- label: Yes I'd like to help by submitting a PR!
blank_issues_enabled: true
contact_links:
- name: 📄 Docs
url: https://docs.ultralytics.com/yolov5
about: View Ultralytics YOLOv5 Docs
- name: 💬 Forum
url: https://community.ultralytics.com/
about: Ask on Ultralytics Community Forum
- name: 🎧 Discord
url: https://ultralytics.com/discord
about: Ask on Ultralytics Discord
name: 🚀 Feature Request
description: Suggest a YOLOv5 idea
# title: " "
labels: [enhancement]
body:
- type: markdown
attributes:
value: |
Thank you for submitting a YOLOv5 🚀 Feature Request!
- type: checkboxes
attributes:
label: Search before asking
description: >
Please search the [issues](https://github.com/ultralytics/yolov5/issues) to see if a similar feature request already exists.
options:
- label: >
I have searched the YOLOv5 [issues](https://github.com/ultralytics/yolov5/issues) and found no similar feature requests.
required: true
- type: textarea
attributes:
label: Description
description: A short description of your feature.
placeholder: |
What new feature would you like to see in YOLOv5?
validations:
required: true
- type: textarea
attributes:
label: Use case
description: |
Describe the use case of your feature request. It will help us understand and prioritize the feature request.
placeholder: |
How would this feature be used, and who would use it?
- type: textarea
attributes:
label: Additional
description: Anything else you would like to share?
- type: checkboxes
attributes:
label: Are you willing to submit a PR?
description: >
(Optional) We encourage you to submit a [Pull Request](https://github.com/ultralytics/yolov5/pulls) (PR) to help improve YOLOv5 for everyone, especially if you have a good understanding of how to implement a fix or feature.
See the YOLOv5 [Contributing Guide](https://docs.ultralytics.com/help/contributing) to get started.
options:
- label: Yes I'd like to help by submitting a PR!
name: ❓ Question
description: Ask a YOLOv5 question
# title: " "
labels: [question]
body:
- type: markdown
attributes:
value: |
Thank you for asking a YOLOv5 ❓ Question!
- type: checkboxes
attributes:
label: Search before asking
description: >
Please search the [issues](https://github.com/ultralytics/yolov5/issues) and [discussions](https://github.com/ultralytics/yolov5/discussions) to see if a similar question already exists.
options:
- label: >
I have searched the YOLOv5 [issues](https://github.com/ultralytics/yolov5/issues) and [discussions](https://github.com/ultralytics/yolov5/discussions) and found no similar questions.
required: true
- type: textarea
attributes:
label: Question
description: What is your question?
placeholder: |
💡 ProTip! Include as much information as possible (screenshots, logs, tracebacks etc.) to receive the most helpful response.
validations:
required: true
- type: textarea
attributes:
label: Additional
description: Anything else you would like to share?
# Ultralytics YOLO 🚀, AGPL-3.0 license
# Dependabot for package version updates
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: weekly
time: "04:00"
open-pull-requests-limit: 10
reviewers:
- glenn-jocher
labels:
- dependencies
- package-ecosystem: github-actions
directory: "/.github/workflows"
schedule:
interval: weekly
time: "04:00"
open-pull-requests-limit: 5
reviewers:
- glenn-jocher
labels:
- dependencies
# YOLOv5 🚀 by Ultralytics, AGPL-3.0 license
# YOLOv5 Continuous Integration (CI) GitHub Actions tests
name: YOLOv5 CI
on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
- cron: "0 0 * * *" # runs at 00:00 UTC every day
jobs:
Benchmarks:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.11"] # requires python<=3.10
model: [yolov5n]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip" # caching pip dependencies
- name: Install requirements
run: |
python -m pip install --upgrade pip wheel
pip install -r requirements.txt coremltools openvino-dev tensorflow-cpu --extra-index-url https://download.pytorch.org/whl/cpu
yolo checks
pip list
- name: Benchmark DetectionModel
run: |
python benchmarks.py --data coco128.yaml --weights ${{ matrix.model }}.pt --img 320 --hard-fail 0.29
- name: Benchmark SegmentationModel
run: |
python benchmarks.py --data coco128-seg.yaml --weights ${{ matrix.model }}-seg.pt --img 320 --hard-fail 0.22
- name: Test predictions
run: |
python export.py --weights ${{ matrix.model }}-cls.pt --include onnx --img 224
python detect.py --weights ${{ matrix.model }}.onnx --img 320
python segment/predict.py --weights ${{ matrix.model }}-seg.onnx --img 320
python classify/predict.py --weights ${{ matrix.model }}-cls.onnx --img 224
Tests:
timeout-minutes: 60
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest] # macos-latest bug https://github.com/ultralytics/yolov5/pull/9049
python-version: ["3.11"]
model: [yolov5n]
include:
- os: ubuntu-latest
python-version: "3.8" # '3.6.8' min
model: yolov5n
- os: ubuntu-latest
python-version: "3.9"
model: yolov5n
- os: ubuntu-latest
python-version: "3.8" # torch 1.8.0 requires python >=3.6, <=3.8
model: yolov5n
torch: "1.8.0" # min torch version CI https://pypi.org/project/torchvision/
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip" # caching pip dependencies
- name: Install requirements
run: |
python -m pip install --upgrade pip wheel
if [ "${{ matrix.torch }}" == "1.8.0" ]; then
pip install -r requirements.txt torch==1.8.0 torchvision==0.9.0 --extra-index-url https://download.pytorch.org/whl/cpu
else
pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu
fi
shell: bash # for Windows compatibility
- name: Check environment
run: |
yolo checks
pip list
- name: Test detection
shell: bash # for Windows compatibility
run: |
# export PYTHONPATH="$PWD" # to run '$ python *.py' files in subdirectories
m=${{ matrix.model }} # official weights
b=runs/train/exp/weights/best # best.pt checkpoint
python train.py --imgsz 64 --batch 32 --weights $m.pt --cfg $m.yaml --epochs 1 --device cpu # train
for d in cpu; do # devices
for w in $m $b; do # weights
python val.py --imgsz 64 --batch 32 --weights $w.pt --device $d # val
python detect.py --imgsz 64 --weights $w.pt --device $d # detect
done
done
python hubconf.py --model $m # hub
# python models/tf.py --weights $m.pt # build TF model
python models/yolo.py --cfg $m.yaml # build PyTorch model
python export.py --weights $m.pt --img 64 --include torchscript # export
python - <<EOF
import torch
im = torch.zeros([1, 3, 64, 64])
for path in '$m', '$b':
model = torch.hub.load('.', 'custom', path=path, source='local')
print(model('data/images/bus.jpg'))
model(im) # warmup, build grids for trace
torch.jit.trace(model, [im])
EOF
- name: Test segmentation
shell: bash # for Windows compatibility
run: |
m=${{ matrix.model }}-seg # official weights
b=runs/train-seg/exp/weights/best # best.pt checkpoint
python segment/train.py --imgsz 64 --batch 32 --weights $m.pt --cfg $m.yaml --epochs 1 --device cpu # train
python segment/train.py --imgsz 64 --batch 32 --weights '' --cfg $m.yaml --epochs 1 --device cpu # train
for d in cpu; do # devices
for w in $m $b; do # weights
python segment/val.py --imgsz 64 --batch 32 --weights $w.pt --device $d # val
python segment/predict.py --imgsz 64 --weights $w.pt --device $d # predict
python export.py --weights $w.pt --img 64 --include torchscript --device $d # export
done
done
- name: Test classification
shell: bash # for Windows compatibility
run: |
m=${{ matrix.model }}-cls.pt # official weights
b=runs/train-cls/exp/weights/best.pt # best.pt checkpoint
python classify/train.py --imgsz 32 --model $m --data mnist160 --epochs 1 # train
python classify/val.py --imgsz 32 --weights $b --data ../datasets/mnist160 # val
python classify/predict.py --imgsz 32 --weights $b --source ../datasets/mnist160/test/7/60.png # predict
python classify/predict.py --imgsz 32 --weights $m --source data/images/bus.jpg # predict
python export.py --weights $b --img 64 --include torchscript # export
python - <<EOF
import torch
for path in '$m', '$b':
model = torch.hub.load('.', 'custom', path=path, source='local')
EOF
Summary:
runs-on: ubuntu-latest
needs: [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.Benchmarks.result == 'failure' || needs.Tests.result == 'failure' || needs.Benchmarks.result == 'cancelled' || needs.Tests.result == 'cancelled') && github.repository == 'ultralytics/yolov5' && (github.event_name == 'schedule' || github.event_name == 'push')
uses: slackapi/slack-github-action@v1.25.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 }}
# This action runs GitHub's industry-leading static analysis engine, CodeQL, against a repository's source code to find security vulnerabilities.
# https://github.com/github/codeql-action
name: "CodeQL"
on:
schedule:
- cron: "0 0 1 * *" # Runs at 00:00 UTC on the 1st of every month
workflow_dispatch:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: ["python"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
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: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
# YOLOv5 🚀 by Ultralytics, AGPL-3.0 license
# Builds ultralytics/yolov5:latest images on DockerHub https://hub.docker.com/r/ultralytics/yolov5
name: Publish Docker Images
on:
push:
branches: [master]
workflow_dispatch:
jobs:
docker:
if: github.repository == 'ultralytics/yolov5'
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # copy full .git directory to access full git history in Docker images
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push arm64 image
uses: docker/build-push-action@v5
continue-on-error: true
with:
context: .
platforms: linux/arm64
file: utils/docker/Dockerfile-arm64
push: true
tags: ultralytics/yolov5:latest-arm64
- name: Build and push CPU image
uses: docker/build-push-action@v5
continue-on-error: true
with:
context: .
file: utils/docker/Dockerfile-cpu
push: true
tags: ultralytics/yolov5:latest-cpu
- name: Build and push GPU image
uses: docker/build-push-action@v5
continue-on-error: true
with:
context: .
file: utils/docker/Dockerfile
push: true
tags: ultralytics/yolov5:latest
# Ultralytics 🚀 - AGPL-3.0 license
# Ultralytics Actions https://github.com/ultralytics/actions
# This workflow automatically formats code and documentation in PRs to official Ultralytics standards
name: Ultralytics Actions
on:
push:
branches: [main, master]
pull_request_target:
branches: [main, master]
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Run Ultralytics Formatting
uses: ultralytics/actions@main
with:
token: ${{ secrets.GITHUB_TOKEN }} # automatically generated, do not modify
python: true # format Python code and docstrings
markdown: true # format Markdown and YAML
spelling: true # check spelling
links: false # check broken links
summary: true # print PR summary with GPT4 (requires 'openai_api_key' or 'openai_azure_api_key' and 'openai_azure_endpoint')
openai_azure_api_key: ${{ secrets.OPENAI_AZURE_API_KEY }}
openai_azure_endpoint: ${{ secrets.OPENAI_AZURE_ENDPOINT }}
# YOLOv5 🚀 by Ultralytics, 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 YOLOv5 🚀 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/yolov5` `master` 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 master` locally.
- ✅ Verify all YOLOv5 Continuous Integration (CI) **checks are passing**.
- ✅ 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
issue-message: |
👋 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/yolov5/tutorials/tips_for_best_training_results/).
## 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: <a href="https://bit.ly/yolov5-paperspace-notebook"><img src="https://assets.paperspace.io/img/gradient-badge.svg" alt="Run on Gradient"></a> <a href="https://colab.research.google.com/github/ultralytics/yolov5/blob/master/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/yolov5"><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/yolov5"><img src="https://img.shields.io/docker/pulls/ultralytics/yolov5?logo=docker" alt="Docker Pulls"></a>
## Status
<a href="https://github.com/ultralytics/yolov5/actions/workflows/ci-testing.yml"><img src="https://github.com/ultralytics/yolov5/actions/workflows/ci-testing.yml/badge.svg" alt="YOLOv5 CI"></a>
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.
## Introducing YOLOv8 🚀
We're excited to announce the launch of our latest state-of-the-art (SOTA) object detection model for 2023 - [YOLOv8](https://github.com/ultralytics/ultralytics) 🚀!
Designed to be fast, accurate, and easy to use, YOLOv8 is an ideal choice for a wide range of object detection, image segmentation and image classification tasks. With YOLOv8, you'll be able to quickly and accurately detect objects in real-time, streamline your workflows, and achieve new levels of accuracy in your projects.
Check out our [YOLOv8 Docs](https://docs.ultralytics.com/) for details and get started with:
```bash
pip install ultralytics
```
# Ultralytics YOLO 🚀, AGPL-3.0 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')
# - 429(Instagram, 'too many requests')
# - 500(Zenodo, 'cached')
# - 502(Zenodo, 'bad gateway')
# - 999(LinkedIn, 'unknown status code')
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@v4
- 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@v3
with:
timeout_minutes: 5
retry_wait_seconds: 60
max_attempts: 3
command: |
lychee \
--scheme 'https' \
--timeout 60 \
--insecure \
--accept 403,429,500,502,999 \
--exclude-all-private \
--exclude 'https?://(www\.)?(linkedin\.com|twitter\.com|instagram\.com|kaggle\.com|fonts\.gstatic\.com|url\.com)' \
--exclude-path '**/ci.yaml' \
--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@v3
with:
timeout_minutes: 5
retry_wait_seconds: 60
max_attempts: 3
command: |
lychee \
--scheme 'https' \
--timeout 60 \
--insecure \
--accept 429,999 \
--exclude-all-private \
--exclude 'https?://(www\.)?(linkedin\.com|twitter\.com|instagram\.com|kaggle\.com|fonts\.gstatic\.com|url\.com)' \
--exclude-path '**/ci.yaml' \
--github-token ${{ secrets.GITHUB_TOKEN }} \
'./**/*.md' \
'./**/*.html' \
'./**/*.yml' \
'./**/*.yaml' \
'./**/*.py' \
'./**/*.ipynb'
# YOLOv5 🚀 by Ultralytics, 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@v9
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.
# Repo-specific GitIgnore ----------------------------------------------------------------------------------------------
*.jpg
*.jpeg
# *.png
*.bmp
*.tif
*.tiff
*.heic
*.JPG
*.JPEG
*.PNG
*.BMP
*.TIF
*.TIFF
*.HEIC
*.mp4
*.mov
*.MOV
*.avi
*.data
*.json
*.cfg
!setup.cfg
!cfg/yolov3*.cfg
storage.googleapis.com
runs/*
data/*
data/images/*
!data/*.yaml
!data/hyps
!data/scripts
!data/images
!data/images/zidane.jpg
!data/images/bus.jpg
!data/*.sh
results*.csv
# Datasets -------------------------------------------------------------------------------------------------------------
coco/
coco128/
VOC/
# MATLAB GitIgnore -----------------------------------------------------------------------------------------------------
*.m~
*.mat
!targets*.mat
# Neural Network weights -----------------------------------------------------------------------------------------------
*.weights
*.pt
*.pb
*.onnx
*.engine
*.mlmodel
*.torchscript
*.tflite
*.h5
*_saved_model/
*_web_model/
*_openvino_model/
*_paddle_model/
darknet53.conv.74
yolov3-tiny.conv.15
# GitHub Python GitIgnore ----------------------------------------------------------------------------------------------
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
/wandb/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# dotenv
.env
# virtualenv
.venv*
venv*/
ENV*/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
# https://github.com/github/gitignore/blob/master/Global/macOS.gitignore -----------------------------------------------
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
Icon?
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff:
.idea/*
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
.html # Bokeh Plots
.pg # TensorFlow Frozen Graphs
.avi # videos
# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
# Gradle:
.idea/**/gradle.xml
.idea/**/libraries
# CMake
cmake-build-debug/
cmake-build-release/
# Mongo Explorer plugin:
.idea/**/mongoSettings.xml
## File-based project format:
*.iws
## Plugin-specific files:
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
*.onnx
*.pt
*.pth
*.trt
nohup*.txt
checkpoints/
run/
\ No newline at end of file
nohup: ignoring input
&&&& RUNNING TensorRT.trtexec [TensorRT v8503] # trtexec --onnx=checkpoints/yolov5x/yolov5x.onnx --saveEngine=checkpoints/yolov5x/yolov5x.trt --int8
[03/20/2024-05:59:19] [I] === Model Options ===
[03/20/2024-05:59:19] [I] Format: ONNX
[03/20/2024-05:59:19] [I] Model: checkpoints/yolov5x/yolov5x.onnx
[03/20/2024-05:59:19] [I] Output:
[03/20/2024-05:59:19] [I] === Build Options ===
[03/20/2024-05:59:19] [I] Max batch: explicit batch
[03/20/2024-05:59:19] [I] Memory Pools: workspace: default, dlaSRAM: default, dlaLocalDRAM: default, dlaGlobalDRAM: default
[03/20/2024-05:59:19] [I] minTiming: 1
[03/20/2024-05:59:19] [I] avgTiming: 8
[03/20/2024-05:59:19] [I] Precision: FP32+INT8
[03/20/2024-05:59:19] [I] LayerPrecisions:
[03/20/2024-05:59:19] [I] Calibration: Dynamic
[03/20/2024-05:59:19] [I] Refit: Disabled
[03/20/2024-05:59:19] [I] Sparsity: Disabled
[03/20/2024-05:59:19] [I] Safe mode: Disabled
[03/20/2024-05:59:19] [I] DirectIO mode: Disabled
[03/20/2024-05:59:19] [I] Restricted mode: Disabled
[03/20/2024-05:59:19] [I] Build only: Disabled
[03/20/2024-05:59:19] [I] Save engine: checkpoints/yolov5x/yolov5x.trt
[03/20/2024-05:59:19] [I] Load engine:
[03/20/2024-05:59:19] [I] Profiling verbosity: 0
[03/20/2024-05:59:19] [I] Tactic sources: Using default tactic sources
[03/20/2024-05:59:19] [I] timingCacheMode: local
[03/20/2024-05:59:19] [I] timingCacheFile:
[03/20/2024-05:59:19] [I] Heuristic: Disabled
[03/20/2024-05:59:19] [I] Preview Features: Use default preview flags.
[03/20/2024-05:59:19] [I] Input(s)s format: fp32:CHW
[03/20/2024-05:59:19] [I] Output(s)s format: fp32:CHW
[03/20/2024-05:59:19] [I] Input build shapes: model
[03/20/2024-05:59:19] [I] Input calibration shapes: model
[03/20/2024-05:59:19] [I] === System Options ===
[03/20/2024-05:59:19] [I] Device: 0
[03/20/2024-05:59:19] [I] DLACore:
[03/20/2024-05:59:19] [I] Plugins:
[03/20/2024-05:59:19] [I] === Inference Options ===
[03/20/2024-05:59:19] [I] Batch: Explicit
[03/20/2024-05:59:19] [I] Input inference shapes: model
[03/20/2024-05:59:19] [I] Iterations: 10
[03/20/2024-05:59:19] [I] Duration: 3s (+ 200ms warm up)
[03/20/2024-05:59:19] [I] Sleep time: 0ms
[03/20/2024-05:59:19] [I] Idle time: 0ms
[03/20/2024-05:59:19] [I] Streams: 1
[03/20/2024-05:59:19] [I] ExposeDMA: Disabled
[03/20/2024-05:59:19] [I] Data transfers: Enabled
[03/20/2024-05:59:19] [I] Spin-wait: Disabled
[03/20/2024-05:59:19] [I] Multithreading: Disabled
[03/20/2024-05:59:19] [I] CUDA Graph: Disabled
[03/20/2024-05:59:19] [I] Separate profiling: Disabled
[03/20/2024-05:59:19] [I] Time Deserialize: Disabled
[03/20/2024-05:59:19] [I] Time Refit: Disabled
[03/20/2024-05:59:19] [I] NVTX verbosity: 0
[03/20/2024-05:59:19] [I] Persistent Cache Ratio: 0
[03/20/2024-05:59:19] [I] Inputs:
[03/20/2024-05:59:19] [I] === Reporting Options ===
[03/20/2024-05:59:19] [I] Verbose: Disabled
[03/20/2024-05:59:19] [I] Averages: 10 inferences
[03/20/2024-05:59:19] [I] Percentiles: 90,95,99
[03/20/2024-05:59:19] [I] Dump refittable layers:Disabled
[03/20/2024-05:59:19] [I] Dump output: Disabled
[03/20/2024-05:59:19] [I] Profile: Disabled
[03/20/2024-05:59:19] [I] Export timing to JSON file:
[03/20/2024-05:59:19] [I] Export output to JSON file:
[03/20/2024-05:59:19] [I] Export profile to JSON file:
[03/20/2024-05:59:19] [I]
[03/20/2024-05:59:48] [I] === Device Information ===
[03/20/2024-05:59:48] [I] Selected Device: NVIDIA A800 80GB PCIe
[03/20/2024-05:59:48] [I] Compute Capability: 8.0
[03/20/2024-05:59:48] [I] SMs: 108
[03/20/2024-05:59:48] [I] Compute Clock Rate: 1.41 GHz
[03/20/2024-05:59:48] [I] Device Global Memory: 81050 MiB
[03/20/2024-05:59:48] [I] Shared Memory per SM: 164 KiB
[03/20/2024-05:59:48] [I] Memory Bus Width: 5120 bits (ECC enabled)
[03/20/2024-05:59:48] [I] Memory Clock Rate: 1.512 GHz
[03/20/2024-05:59:48] [I]
[03/20/2024-05:59:48] [I] TensorRT version: 8.5.3
[03/20/2024-06:00:17] [I] [TRT] [MemUsageChange] Init CUDA: CPU +14, GPU +0, now: CPU 27, GPU 24558 (MiB)
[03/20/2024-06:00:32] [I] [TRT] [MemUsageChange] Init builder kernel library: CPU +661, GPU +166, now: CPU 740, GPU 24724 (MiB)
[03/20/2024-06:00:32] [I] Start parsing network model
[03/20/2024-06:00:32] [I] [TRT] ----------------------------------------------------------------
[03/20/2024-06:00:32] [I] [TRT] Input filename: checkpoints/yolov5x/yolov5x.onnx
[03/20/2024-06:00:32] [I] [TRT] ONNX IR version: 0.0.7
[03/20/2024-06:00:32] [I] [TRT] Opset version: 13
[03/20/2024-06:00:32] [I] [TRT] Producer name: pytorch
[03/20/2024-06:00:32] [I] [TRT] Producer version: 2.0.1
[03/20/2024-06:00:32] [I] [TRT] Domain:
[03/20/2024-06:00:32] [I] [TRT] Model version: 0
[03/20/2024-06:00:32] [I] [TRT] Doc string:
[03/20/2024-06:00:32] [I] [TRT] ----------------------------------------------------------------
[03/20/2024-06:00:35] [W] [TRT] parsers/onnx/onnx2trt_utils.cpp:375: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32.
[03/20/2024-06:00:35] [I] Finish parsing network model
[03/20/2024-06:00:38] [I] FP32 and INT8 precisions have been specified - more performance might be enabled by additionally specifying --fp16 or --best
[03/20/2024-06:00:41] [W] [TRT] Calibrator won't be used in explicit precision mode. Use quantization aware training to generate network with Quantize/Dequantize nodes.
[03/20/2024-17:33:14] [I] [TRT] [MemUsageChange] Init cuBLAS/cuBLASLt: CPU +6, GPU -21, now: CPU 1416, GPU 25098 (MiB)
[03/20/2024-17:33:19] [I] [TRT] [MemUsageChange] Init cuDNN: CPU +2, GPU +26, now: CPU 1418, GPU 25124 (MiB)
[03/20/2024-17:33:20] [I] [TRT] Local timing cache in use. Profiling results in this builder pass will not be stored.
[03/20/2024-18:11:03] [I] [TRT] Detected 1 inputs and 7 output network tensors.
[03/20/2024-18:14:25] [I] [TRT] Total Host Persistent Memory: 372224
[03/20/2024-18:14:25] [I] [TRT] Total Device Persistent Memory: 0
[03/20/2024-18:14:25] [I] [TRT] Total Scratch Memory: 0
[03/20/2024-18:14:25] [I] [TRT] [MemUsageStats] Peak memory usage of TRT CPU/GPU memory allocators: CPU 418 MiB, GPU 216 MiB
[03/20/2024-18:14:26] [I] [TRT] [BlockAssignment] Algorithm ShiftNTopDown took 45.2042ms to assign 7 blocks to 184 nodes requiring 34969600 bytes.
[03/20/2024-18:14:26] [I] [TRT] Total Activation Memory: 34969600
[03/20/2024-18:14:28] [W] [TRT] TensorRT encountered issues when converting weights between types and that could affect accuracy.
[03/20/2024-18:14:28] [W] [TRT] If this is not the desired behavior, please modify the weights or retrain with regularization to adjust the magnitude of the weights.
[03/20/2024-18:14:28] [W] [TRT] Check verbose logs for the list of affected weights.
[03/20/2024-18:14:28] [W] [TRT] - 25 weights are affected by this issue: Detected values which are outside of int8_t range and clipped them to int8_t range.
[03/20/2024-18:14:28] [I] [TRT] [MemUsageChange] TensorRT-managed allocation in building engine: CPU +83, GPU +84, now: CPU 83, GPU 84 (MiB)
[03/20/2024-18:20:20] [I] Engine built in 44431.5 sec.
[03/20/2024-18:20:26] [I] [TRT] Loaded engine size: 86 MiB
[03/20/2024-18:20:32] [I] [TRT] [MemUsageChange] TensorRT-managed allocation in engine deserialization: CPU +0, GPU +83, now: CPU 0, GPU 83 (MiB)
[03/20/2024-18:20:32] [I] Engine deserialized in 5.81573 sec.
[03/20/2024-18:20:35] [I] [TRT] [MemUsageChange] TensorRT-managed allocation in IExecutionContext creation: CPU +1, GPU +34, now: CPU 1, GPU 117 (MiB)
[03/20/2024-18:20:35] [I] Setting persistentCacheLimit to 0 bytes.
[03/20/2024-18:20:35] [I] Using random values for input images
[03/20/2024-18:20:36] [I] Created input binding for images with dimensions 1x3x640x640
[03/20/2024-18:20:36] [I] Using random values for output onnx::Sigmoid_2177
[03/20/2024-18:20:37] [I] Created output binding for onnx::Sigmoid_2177 with dimensions 1x3x80x80x85
[03/20/2024-18:20:37] [I] Using random values for output onnx::Sigmoid_2229
[03/20/2024-18:20:38] [I] Created output binding for onnx::Sigmoid_2229 with dimensions 1x3x40x40x85
[03/20/2024-18:20:38] [I] Using random values for output onnx::Sigmoid_2281
[03/20/2024-18:20:38] [I] Created output binding for onnx::Sigmoid_2281 with dimensions 1x3x20x20x85
[03/20/2024-18:20:38] [I] Using random values for output outputs
[03/20/2024-18:20:38] [I] Created output binding for outputs with dimensions 1x25200x85
[03/20/2024-18:20:38] [I] Starting inference
[03/20/2024-18:20:41] [I] Warmup completed 82 queries over 200 ms
[03/20/2024-18:20:41] [I] Timing trace has 1239 queries over 3.00919 s
[03/20/2024-18:20:41] [I]
[03/20/2024-18:20:41] [I] === Trace details ===
[03/20/2024-18:20:41] [I] Trace averages of 10 runs:
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42463 ms - Host latency: 3.67126 ms (enqueue 0.945071 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42299 ms - Host latency: 3.67298 ms (enqueue 1.04116 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.43364 ms - Host latency: 3.68269 ms (enqueue 0.956358 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.436 ms - Host latency: 3.6895 ms (enqueue 0.948724 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42319 ms - Host latency: 3.6725 ms (enqueue 0.954166 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42237 ms - Host latency: 3.67505 ms (enqueue 0.967197 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.43375 ms - Host latency: 3.67804 ms (enqueue 0.954947 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42954 ms - Host latency: 3.67611 ms (enqueue 0.972562 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42268 ms - Host latency: 3.67251 ms (enqueue 0.950684 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42064 ms - Host latency: 3.66315 ms (enqueue 0.958334 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42104 ms - Host latency: 3.6598 ms (enqueue 0.942892 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.4232 ms - Host latency: 3.66109 ms (enqueue 0.94252 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42339 ms - Host latency: 3.66243 ms (enqueue 0.94342 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42147 ms - Host latency: 3.66012 ms (enqueue 0.945453 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42648 ms - Host latency: 3.66543 ms (enqueue 0.945605 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42227 ms - Host latency: 3.66091 ms (enqueue 0.942908 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42288 ms - Host latency: 3.66246 ms (enqueue 0.946649 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42267 ms - Host latency: 3.66882 ms (enqueue 0.947675 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42556 ms - Host latency: 3.6711 ms (enqueue 0.948084 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42576 ms - Host latency: 3.6694 ms (enqueue 1.19636 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42053 ms - Host latency: 3.66154 ms (enqueue 0.956055 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42329 ms - Host latency: 3.67522 ms (enqueue 0.951782 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42267 ms - Host latency: 3.66431 ms (enqueue 0.946771 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42607 ms - Host latency: 3.66413 ms (enqueue 0.940643 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.41919 ms - Host latency: 3.65739 ms (enqueue 0.941699 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42064 ms - Host latency: 3.65871 ms (enqueue 0.941052 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.4236 ms - Host latency: 3.66242 ms (enqueue 0.942377 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42146 ms - Host latency: 3.65906 ms (enqueue 0.943616 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42391 ms - Host latency: 3.66592 ms (enqueue 0.94458 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42299 ms - Host latency: 3.66309 ms (enqueue 0.949152 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42217 ms - Host latency: 3.6623 ms (enqueue 0.950781 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42043 ms - Host latency: 3.65912 ms (enqueue 0.965393 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42288 ms - Host latency: 3.66077 ms (enqueue 0.941821 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42422 ms - Host latency: 3.66156 ms (enqueue 0.939288 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42157 ms - Host latency: 3.65942 ms (enqueue 0.946912 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.41923 ms - Host latency: 3.65651 ms (enqueue 0.942017 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.41962 ms - Host latency: 3.65717 ms (enqueue 0.943994 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42388 ms - Host latency: 3.66847 ms (enqueue 1.00292 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42343 ms - Host latency: 3.66206 ms (enqueue 0.913086 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42021 ms - Host latency: 3.6624 ms (enqueue 0.91488 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42246 ms - Host latency: 3.67434 ms (enqueue 1.00906 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42062 ms - Host latency: 3.65934 ms (enqueue 0.919775 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42391 ms - Host latency: 3.66812 ms (enqueue 0.916284 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42493 ms - Host latency: 3.66461 ms (enqueue 0.911426 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.43384 ms - Host latency: 3.67771 ms (enqueue 0.915234 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42354 ms - Host latency: 3.66333 ms (enqueue 0.913477 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42145 ms - Host latency: 3.66732 ms (enqueue 0.9245 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42568 ms - Host latency: 3.66515 ms (enqueue 0.917236 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.4236 ms - Host latency: 3.66152 ms (enqueue 0.911279 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42297 ms - Host latency: 3.66169 ms (enqueue 0.90813 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.41912 ms - Host latency: 3.65688 ms (enqueue 0.908411 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42267 ms - Host latency: 3.66293 ms (enqueue 0.986707 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42141 ms - Host latency: 3.6601 ms (enqueue 0.938635 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42107 ms - Host latency: 3.65969 ms (enqueue 0.921899 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42311 ms - Host latency: 3.66389 ms (enqueue 1.01439 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42207 ms - Host latency: 3.6714 ms (enqueue 1.00046 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42186 ms - Host latency: 3.67098 ms (enqueue 0.940332 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42271 ms - Host latency: 3.65981 ms (enqueue 0.934937 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42104 ms - Host latency: 3.65934 ms (enqueue 0.932422 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42106 ms - Host latency: 3.6592 ms (enqueue 0.934497 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42246 ms - Host latency: 3.66042 ms (enqueue 0.937061 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.41971 ms - Host latency: 3.65696 ms (enqueue 0.936389 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42206 ms - Host latency: 3.66028 ms (enqueue 0.932471 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42167 ms - Host latency: 3.65941 ms (enqueue 0.934399 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42402 ms - Host latency: 3.66168 ms (enqueue 0.936987 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42183 ms - Host latency: 3.66056 ms (enqueue 0.938965 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.4229 ms - Host latency: 3.66044 ms (enqueue 0.936267 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42228 ms - Host latency: 3.65992 ms (enqueue 0.936157 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42115 ms - Host latency: 3.6614 ms (enqueue 0.935718 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42229 ms - Host latency: 3.66204 ms (enqueue 0.9771 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42228 ms - Host latency: 3.65969 ms (enqueue 0.935083 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.41992 ms - Host latency: 3.65706 ms (enqueue 0.935071 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42136 ms - Host latency: 3.65869 ms (enqueue 0.93512 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.41971 ms - Host latency: 3.6576 ms (enqueue 0.934998 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42156 ms - Host latency: 3.66012 ms (enqueue 0.936743 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42523 ms - Host latency: 3.66317 ms (enqueue 0.933447 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42057 ms - Host latency: 3.65875 ms (enqueue 0.934448 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42085 ms - Host latency: 3.65979 ms (enqueue 0.937305 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42146 ms - Host latency: 3.65918 ms (enqueue 0.936401 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42334 ms - Host latency: 3.66221 ms (enqueue 0.938501 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42651 ms - Host latency: 3.66423 ms (enqueue 0.935229 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.43682 ms - Host latency: 3.67505 ms (enqueue 0.934497 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.41895 ms - Host latency: 3.65618 ms (enqueue 0.93313 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.41904 ms - Host latency: 3.65657 ms (enqueue 0.94397 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42024 ms - Host latency: 3.66345 ms (enqueue 0.938745 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42075 ms - Host latency: 3.66128 ms (enqueue 0.939771 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.43738 ms - Host latency: 3.68162 ms (enqueue 0.951147 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.41826 ms - Host latency: 3.65764 ms (enqueue 0.9375 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.41931 ms - Host latency: 3.65972 ms (enqueue 0.948682 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42058 ms - Host latency: 3.65789 ms (enqueue 0.936865 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.41924 ms - Host latency: 3.65674 ms (enqueue 0.937549 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.41836 ms - Host latency: 3.65586 ms (enqueue 0.937134 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.41853 ms - Host latency: 3.6564 ms (enqueue 0.936279 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42043 ms - Host latency: 3.65774 ms (enqueue 0.938257 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.41963 ms - Host latency: 3.65896 ms (enqueue 0.941895 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42056 ms - Host latency: 3.66707 ms (enqueue 1.01245 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.41853 ms - Host latency: 3.6614 ms (enqueue 0.958081 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42051 ms - Host latency: 3.66458 ms (enqueue 1.04944 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42004 ms - Host latency: 3.66091 ms (enqueue 0.931348 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42075 ms - Host latency: 3.66101 ms (enqueue 0.930615 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.41948 ms - Host latency: 3.66685 ms (enqueue 0.936377 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42754 ms - Host latency: 3.67422 ms (enqueue 0.940063 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42412 ms - Host latency: 3.67114 ms (enqueue 0.937329 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42029 ms - Host latency: 3.66443 ms (enqueue 0.936279 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.41902 ms - Host latency: 3.67385 ms (enqueue 1.0353 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42273 ms - Host latency: 3.67058 ms (enqueue 0.9573 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.41768 ms - Host latency: 3.66528 ms (enqueue 0.940088 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42485 ms - Host latency: 3.6843 ms (enqueue 1.11968 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.4313 ms - Host latency: 3.6865 ms (enqueue 1.58699 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42156 ms - Host latency: 3.68008 ms (enqueue 1.09146 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42075 ms - Host latency: 3.6707 ms (enqueue 0.981885 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42014 ms - Host latency: 3.65872 ms (enqueue 0.933691 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42341 ms - Host latency: 3.68196 ms (enqueue 0.946704 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42031 ms - Host latency: 3.66436 ms (enqueue 0.951001 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42014 ms - Host latency: 3.6584 ms (enqueue 0.936011 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.41819 ms - Host latency: 3.65571 ms (enqueue 0.936182 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.41885 ms - Host latency: 3.65647 ms (enqueue 0.933203 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42004 ms - Host latency: 3.65845 ms (enqueue 0.93501 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.41921 ms - Host latency: 3.65681 ms (enqueue 0.936646 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.4207 ms - Host latency: 3.65876 ms (enqueue 0.933789 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42468 ms - Host latency: 3.66323 ms (enqueue 0.934644 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.42092 ms - Host latency: 3.65869 ms (enqueue 0.93501 ms)
[03/20/2024-18:20:41] [I] Average on 10 runs - GPU latency: 2.41921 ms - Host latency: 3.66094 ms (enqueue 0.93877 ms)
[03/20/2024-18:20:41] [I]
[03/20/2024-18:20:41] [I] === Performance summary ===
[03/20/2024-18:20:41] [I] Throughput: 411.738 qps
[03/20/2024-18:20:41] [I] Latency: min = 3.6438 ms, max = 3.81909 ms, mean = 3.66416 ms, median = 3.66025 ms, percentile(90%) = 3.67578 ms, percentile(95%) = 3.68628 ms, percentile(99%) = 3.71466 ms
[03/20/2024-18:20:41] [I] Enqueue Time: min = 0.897339 ms, max = 3.44153 ms, mean = 0.954946 ms, median = 0.938965 ms, percentile(90%) = 0.954285 ms, percentile(95%) = 0.984131 ms, percentile(99%) = 1.58911 ms
[03/20/2024-18:20:41] [I] H2D Latency: min = 0.245483 ms, max = 0.280029 ms, mean = 0.247243 ms, median = 0.246582 ms, percentile(90%) = 0.249084 ms, percentile(95%) = 0.250122 ms, percentile(99%) = 0.254517 ms
[03/20/2024-18:20:41] [I] GPU Compute Time: min = 2.41064 ms, max = 2.57324 ms, mean = 2.4225 ms, median = 2.42072 ms, percentile(90%) = 2.42993 ms, percentile(95%) = 2.43298 ms, percentile(99%) = 2.44116 ms
[03/20/2024-18:20:41] [I] D2H Latency: min = 0.986084 ms, max = 1.06665 ms, mean = 0.994418 ms, median = 0.991882 ms, percentile(90%) = 1.00171 ms, percentile(95%) = 1.01141 ms, percentile(99%) = 1.03223 ms
[03/20/2024-18:20:41] [I] Total Host Walltime: 3.00919 s
[03/20/2024-18:20:41] [I] Total GPU Compute Time: 3.00148 s
[03/20/2024-18:20:41] [I] Explanations of the performance metrics are printed in the verbose logs.
[03/20/2024-18:20:41] [I]
&&&& PASSED TensorRT.trtexec [TensorRT v8503] # trtexec --onnx=checkpoints/yolov5x/yolov5x.onnx --saveEngine=checkpoints/yolov5x/yolov5x.trt --int8
cff-version: 1.2.0
preferred-citation:
type: software
message: If you use YOLOv5, please cite it as below.
authors:
- family-names: Jocher
given-names: Glenn
orcid: "https://orcid.org/0000-0001-5950-6979"
title: "YOLOv5 by Ultralytics"
version: 7.0
doi: 10.5281/zenodo.3908559
date-released: 2020-5-29
license: AGPL-3.0
url: "https://github.com/ultralytics/yolov5"
## Contributing to YOLOv5 🚀
We love your input! We want to make contributing to YOLOv5 as easy and transparent as possible, whether it's:
- Reporting a bug
- Discussing the current state of the code
- Submitting a fix
- Proposing a new feature
- Becoming a maintainer
YOLOv5 works so well due to our combined community effort, and for every small improvement you contribute you will be helping push the frontiers of what's possible in AI 😃!
## Submitting a Pull Request (PR) 🛠️
Submitting a PR is easy! This example shows how to submit a PR for updating `requirements.txt` in 4 steps:
### 1. Select File to Update
Select `requirements.txt` to update by clicking on it in GitHub.
<p align="center"><img width="800" alt="PR_step1" src="https://user-images.githubusercontent.com/26833433/122260847-08be2600-ced4-11eb-828b-8287ace4136c.png"></p>
### 2. Click 'Edit this file'
The button is in the top-right corner.
<p align="center"><img width="800" alt="PR_step2" src="https://user-images.githubusercontent.com/26833433/122260844-06f46280-ced4-11eb-9eec-b8a24be519ca.png"></p>
### 3. Make Changes
Change the `matplotlib` version from `3.2.2` to `3.3`.
<p align="center"><img width="800" alt="PR_step3" src="https://user-images.githubusercontent.com/26833433/122260853-0a87e980-ced4-11eb-9fd2-3650fb6e0842.png"></p>
### 4. Preview Changes and Submit PR
Click on the **Preview changes** tab to verify your updates. At the bottom of the screen select 'Create a **new branch** for this commit', assign your branch a descriptive name such as `fix/matplotlib_version` and click the green **Propose changes** button. All done, your PR is now submitted to YOLOv5 for review and approval 😃!
<p align="center"><img width="800" alt="PR_step4" src="https://user-images.githubusercontent.com/26833433/122260856-0b208000-ced4-11eb-8e8e-77b6151cbcc3.png"></p>
### PR recommendations
To allow your work to be integrated as seamlessly as possible, we advise you to:
- ✅ Verify your PR is **up-to-date** with `ultralytics/yolov5` `master` 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 master` locally.
<p align="center"><img width="751" alt="Screenshot 2022-08-29 at 22 47 15" src="https://user-images.githubusercontent.com/26833433/187295893-50ed9f44-b2c9-4138-a614-de69bd1753d7.png"></p>
- ✅ Verify all YOLOv5 Continuous Integration (CI) **checks are passing**.
<p align="center"><img width="751" alt="Screenshot 2022-08-29 at 22 47 03" src="https://user-images.githubusercontent.com/26833433/187296922-545c5498-f64a-4d8c-8300-5fa764360da6.png"></p>
- ✅ 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
## Submitting a Bug Report 🐛
If you spot a problem with YOLOv5 please submit a Bug Report!
For us to start investigating a possible problem we need to be able to reproduce it ourselves first. We've created a few short guidelines below to help users provide what we need to get started.
When asking a question, people will be better able to provide help if you provide **code** that they can easily understand and use to **reproduce** the problem. This is referred to by community members as creating a [minimum reproducible example](https://docs.ultralytics.com/help/minimum_reproducible_example/). Your code that reproduces the problem should be:
-**Minimal** – Use as little code as possible that still produces the same problem
-**Complete** – Provide **all** parts someone else needs to reproduce your problem in the question itself
-**Reproducible** – Test the code you're about to provide to make sure it reproduces the problem
In addition to the above requirements, for [Ultralytics](https://ultralytics.com/) to provide assistance your code should be:
-**Current** – Verify that your code is up-to-date with the current GitHub [master](https://github.com/ultralytics/yolov5/tree/master), and if necessary `git pull` or `git clone` a new copy to ensure your problem has not already been resolved by previous commits.
-**Unmodified** – Your problem must be reproducible without any modifications to the codebase in this repository. [Ultralytics](https://ultralytics.com/) does not provide support for custom code ⚠️.
If you believe your problem meets all of the above criteria, please close this issue and raise a new one using the 🐛 **Bug Report** [template](https://github.com/ultralytics/yolov5/issues/new/choose) and provide a [minimum reproducible example](https://docs.ultralytics.com/help/minimum_reproducible_example/) to help us better understand and diagnose your problem.
## License
By contributing, you agree that your contributions will be licensed under the [AGPL-3.0 license](https://choosealicense.com/licenses/agpl-3.0/)
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.
# Yolov5-QAT
本项目旨在对Yolov5模型执行量化感知训练,将其转换为onnx模型,并在TensorRT上运行。
## 论文
## 模型结构
yolov5模型由三个部分组成,分别是`Backbone``Neck`以及`Head`。其中`Backbone`网络用于获取不同大小的特征图,`Neck`
融合这些特征,最终生成三个特征图P3、P4和P5(在YOLOv5中,维度用80×80、40×40和20×20表示),分别用于检测图片中的小、中、大物体,`Head`对特征图中的每个像素使用预设的先验锚点进行置信度计算和边界框回归,从而得到一个包含目标类别、类别置信度、边界框坐标、宽度和高度信息的多维数组(BBoxes)。
![alt text](readme_imgs/image-1.png)
## 算法原理
YOLOv5 是一种基于单阶段目标检测算法,通过将图像划分为不同大小的网格,预测每个网格中的目标类别和边界框,利用特征金字塔结构和自适应的模型缩放来实现高效准确的实时目标检测。
![alt text](readme_imgs/image-2.png)
## 环境配置
### Anaconda (方法一)
1、本项目目前仅支持在N卡环境运行
python 3.9.18
torch 2.0.1
cuda 11
pip install -r requirements.txt
pip install --no-cache-dir --extra-index-url https://pypi.nvidia.com pytorch-quantization
2、TensorRT
wget https://github.com/NVIDIA/TensorRT/archive/refs/tags/8.5.3.zip
unzip [下载的压缩包] -d [解压路径]
pip install 解压路径/python/tensorrt-8.5.3.1-cp39-none-linux_x86_64.whl
ln -s 解压路径(绝对路径)/bin/trtexec /usr/local/bin/trtexec
注意:若需要`cu12`则将`requirements.txt`中的相关注释关闭,并安装。
## 数据集
本项目使用coco2017数据集.
数据结构如下
images
├── train2017s
├── val2017
labels
├── train2017
├── val2017
annotations
├── instances_train2017.json
├── instances_val2017.json
train2017.txt
val2017.txt
其中`train2017.txt, val2017.txt`可运行脚本`scripts/coco2yolo.py`生成,
python scripts/coco2yolo.py \
--json_path=path/to/instances_[val/train]2017.json \
--save_path=path/to/labels/[val/train]2017.txt
## 训练
# 训练QAT模型
python scripts/qat.py quantize yolov5[s|m|n|x|l].pt \
--qat=/path/to/save/qat/model --cocodir=/path/to/train/data --eval-origin
# 导出 onnx 模型
python scripts/qat.py export /path/to/load/qat/model --size=640 --save=/path/to/save/onnx/model
# 获取tensorrt模型
trtexec --onnx=/path/to/load/onnx/model --saveEngine=/path/to/save/trt/model --int8
注意:更多选项参考`参考资料部分`
## 推理
python evaluate.py --data_list=/path/to/load/trainlist --label_dir=/path/to/labeldir
--weight=/path/to/load/model --mtype=[ori|onnx|trt|qat]
注意:mtype和weight类型需要严格对应,ori表示原始模型,qat表示基于原始模型得到的qat模型。
## result
![alt text](readme_imgs/trt.png)
### 精度
平台:A800
精度:FP32 + INT8
|模型名称|模型类型|size|map@50-95|map@50|推理速度
|:---|:---|:---|:---|:---|:---|
|yolov5n|原始 <br> ONNX <br> TRT|640|0.276 <br> 0.267 <br> 0.267 | 0.453 <br> 0.444 <br> 0.443 | 8.98ms/sample <br> 9.9ms/sample <br> 3.9ms/sample|
|yolov5s|原始 <br> ONNX <br> TRT|640| 0.369 <br> 0.361 <br> 0.362| 0.562 <br> 0.557 <br> 0.557| 10.0ms/sample <br> 11.4ms/sample <br> 3.74ms/sample|
|yolov5m|原始 <br> ONNX <br> TRT|640|0.445 <br> 0.437 <br> 0.438| 0.633 <br> 0.628 <br> 0.628| 12.8ms/sample <br> 13.2ms/sample <br> 4.4ms/sample|
|yolov5l|原始 <br> ONNX <br> TRT|640|0.482 <br> 0.473 <br> 0.473| 0.663 <br> 0.659 <br> 0.659| 15.6ms/sample <br> 17ms/sample <br> 4.73ms/sample|
|yolov5x|原始 <br> ONNX <br> TRT|640|0.498 <br> 0.492 <br> 0.491| 0.679 <br> 0.676 <br> 0.675| 18ms/sample <br> 20.2ms/sample <br> 5.62ms/sample|
注意:该评测结果不代表模型的真正结果,仅展示不同模型之间的指标差异。
## 应用场景
### 算法类别
`目标检测`
### 热点应用行业
`金融,交通,教育`
## 源码仓库及问题反馈
* https://developer.hpccube.com/codes/modelzoo/vgg16-qat_pytorch
## 参考资料
* https://docs.nvidia.com/deeplearning/tensorrt/pytorch-quantization-toolkit/docs/index.html
* https://github.com/NVIDIA-AI-IOT/cuDLA-samples/
* https://github.com/ultralytics/yolov5
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment