Commit Graph

192 Commits (master)

Author SHA1 Message Date
Paula Derrenger c568972d59
Standardize license headers in Python files ()
* Refactor code for speed and clarity

* Auto-format by https://ultralytics.com/actions

---------

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
2025-01-15 15:31:19 +01:00
Glenn Jocher 86fd1ab270
Apply `ruff==0.9.0` formatting ()
* Refactor code for speed and clarity

* Auto-format by https://ultralytics.com/actions

---------

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
2025-01-10 01:42:04 +01:00
Ali Ghanbari f003c3df9e
Update detect.py (Fix save-csv: Ensure header is written to CSV) ()
This commit resolves an issue where the save-csv command did not write the CSV header. The code now correctly saves the header in the CSV file.

Signed-off-by: Ali Ghanbari <alighanbari446@gmail.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2025-01-01 21:46:59 +01:00
Glenn Jocher f44db01005
PyUpgrade 3.8 updates ()
* PyUpgrade 3.8 updates

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Auto-format by https://ultralytics.com/actions

---------

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
2024-09-01 17:35:08 +02:00
Harsh Dhamecha 41b5f45096
Provide option for saving box coordinates in Pascal-VOC format. ()
* Provide option for saaving box coordinates in Pascal-VOC format.
- Added save-format argument for saving box coordinates in Pascal-VOC format (Xmin, Ymin, Xmax, Ymax) when save_txt is True, 0 for YOLO and 1 for Pascal-VOC, By default - 0

* Auto-format by https://ultralytics.com/actions

---------

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
2024-08-25 05:40:38 +08:00
Ryan Hirasaki 6096750fcc
Update CoreML exports to support newer *.mlpackage outputs ()
* Implement and default mlpackage generation for CoreML model exports

Signed-off-by: Ryan Hirasaki <ryanhirasaki@gmail.com>

* Provide command line argument to export as *.mlmodel instead of *.mlpackage for CoreML

Signed-off-by: Ryan Hirasaki <ryanhirasaki@gmail.com>

* Remove macOS check for CoreML quantization

Requirements for macOS during quantization was removed from coremltools 6.0

Signed-off-by: Ryan Hirasaki <ryanhirasaki@gmail.com>

* Undo removal of warning catching

Signed-off-by: Ryan Hirasaki <ryanhirasaki@gmail.com>

* Change file extension references from mlmodel to mlpackage

Signed-off-by: Ryan Hirasaki <ryanhirasaki@gmail.com>

* Auto-format by https://ultralytics.com/actions

---------

Signed-off-by: Ryan Hirasaki <ryanhirasaki@gmail.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: Ultralytics Assistant <135830346+UltralyticsAssistant@users.noreply.github.com>
2024-07-29 02:09:57 +02:00
Glenn Jocher 12be49963c
Ultralytics Code Refactor https://ultralytics.com/actions ()
* Refactor code for speed and clarity

* Auto-format by https://ultralytics.com/actions

---------

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
2024-07-16 01:20:57 +02:00
Glenn Jocher ff06328498
Ultralytics Code Refactor https://ultralytics.com/actions ()
* Refactor code for speed and clarity

* Update export.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update export.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Add missing Python function docstrings

* Auto-format by https://ultralytics.com/actions

* Update export.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Add missing Python function docstrings

* Auto-format by https://ultralytics.com/actions

---------

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
2024-07-08 22:05:56 +02:00
Glenn Jocher 8257e0a68c
Ultralytics Code Refactor https://ultralytics.com/actions ()
Refactor code for speed and clarity
2024-07-08 21:19:04 +02:00
Glenn Jocher 100a423b66
Ultralytics Code Refactor https://ultralytics.com/actions ()
* Refactor code for speed and clarity

* Update dataloaders.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

---------

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2024-07-01 00:17:24 +02:00
Ultralytics Assistant 3ec95f9e3d
Update header line in Python files ()
* Add license line to .github/ISSUE_TEMPLATE/bug-report.yml

* Add license line to .github/ISSUE_TEMPLATE/config.yml

* Add license line to .github/ISSUE_TEMPLATE/feature-request.yml

* Add license line to .github/ISSUE_TEMPLATE/question.yml

* Add license line to .github/dependabot.yml

* Add license line to .github/workflows/ci-testing.yml

* Add license line to .github/workflows/cla.yml

* Add license line to .github/workflows/codeql-analysis.yml

* Add license line to .github/workflows/docker.yml

* Add license line to .github/workflows/format.yml

* Add license line to .github/workflows/greetings.yml

* Add license line to .github/workflows/links.yml

* Add license line to .github/workflows/merge-main-into-prs.yml

* Add license line to .github/workflows/stale.yml

* Add license line to benchmarks.py

* Add license line to classify/predict.py

* Add license line to classify/train.py

* Add license line to classify/val.py

* Add license line to data/Argoverse.yaml

* Add license line to data/GlobalWheat2020.yaml

* Add license line to data/ImageNet.yaml

* Add license line to data/ImageNet10.yaml

* Add license line to data/ImageNet100.yaml

* Add license line to data/ImageNet1000.yaml

* Add license line to data/Objects365.yaml

* Add license line to data/SKU-110K.yaml

* Add license line to data/VOC.yaml

* Add license line to data/VisDrone.yaml

* Add license line to data/coco.yaml

* Add license line to data/coco128-seg.yaml

* Add license line to data/coco128.yaml

* Add license line to data/hyps/hyp.Objects365.yaml

* Add license line to data/hyps/hyp.VOC.yaml

* Add license line to data/hyps/hyp.no-augmentation.yaml

* Add license line to data/hyps/hyp.scratch-high.yaml

* Add license line to data/hyps/hyp.scratch-low.yaml

* Add license line to data/hyps/hyp.scratch-med.yaml

* Add license line to data/xView.yaml

* Add license line to detect.py

* Add license line to export.py

* Add license line to hubconf.py

* Add license line to models/common.py

* Add license line to models/experimental.py

* Add license line to models/hub/anchors.yaml

* Add license line to models/hub/yolov3-spp.yaml

* Add license line to models/hub/yolov3-tiny.yaml

* Add license line to models/hub/yolov3.yaml

* Add license line to models/hub/yolov5-bifpn.yaml

* Add license line to models/hub/yolov5-fpn.yaml

* Add license line to models/hub/yolov5-p2.yaml

* Add license line to models/hub/yolov5-p34.yaml

* Add license line to models/hub/yolov5-p6.yaml

* Add license line to models/hub/yolov5-p7.yaml

* Add license line to models/hub/yolov5-panet.yaml

* Add license line to models/hub/yolov5l6.yaml

* Add license line to models/hub/yolov5m6.yaml

* Add license line to models/hub/yolov5n6.yaml

* Add license line to models/hub/yolov5s-LeakyReLU.yaml

* Add license line to models/hub/yolov5s-ghost.yaml

* Add license line to models/hub/yolov5s-transformer.yaml

* Add license line to models/hub/yolov5s6.yaml

* Add license line to models/hub/yolov5x6.yaml

* Add license line to models/segment/yolov5l-seg.yaml

* Add license line to models/segment/yolov5m-seg.yaml

* Add license line to models/segment/yolov5n-seg.yaml

* Add license line to models/segment/yolov5s-seg.yaml

* Add license line to models/segment/yolov5x-seg.yaml

* Add license line to models/tf.py

* Add license line to models/yolo.py

* Add license line to models/yolov5l.yaml

* Add license line to models/yolov5m.yaml

* Add license line to models/yolov5n.yaml

* Add license line to models/yolov5s.yaml

* Add license line to models/yolov5x.yaml

* Add license line to pyproject.toml

* Add license line to segment/predict.py

* Add license line to segment/train.py

* Add license line to segment/val.py

* Add license line to train.py

* Add license line to utils/__init__.py

* Add license line to utils/activations.py

* Add license line to utils/augmentations.py

* Add license line to utils/autoanchor.py

* Add license line to utils/autobatch.py

* Add license line to utils/aws/resume.py

* Add license line to utils/callbacks.py

* Add license line to utils/dataloaders.py

* Add license line to utils/downloads.py

* Add license line to utils/flask_rest_api/example_request.py

* Add license line to utils/flask_rest_api/restapi.py

* Add license line to utils/general.py

* Add license line to utils/google_app_engine/app.yaml

* Add license line to utils/loggers/__init__.py

* Add license line to utils/loggers/clearml/clearml_utils.py

* Add license line to utils/loggers/clearml/hpo.py

* Add license line to utils/loggers/comet/__init__.py

* Add license line to utils/loggers/comet/comet_utils.py

* Add license line to utils/loggers/comet/hpo.py

* Add license line to utils/loggers/wandb/wandb_utils.py

* Add license line to utils/loss.py

* Add license line to utils/metrics.py

* Add license line to utils/plots.py

* Add license line to utils/segment/augmentations.py

* Add license line to utils/segment/dataloaders.py

* Add license line to utils/segment/general.py

* Add license line to utils/segment/loss.py

* Add license line to utils/segment/metrics.py

* Add license line to utils/segment/plots.py

* Add license line to utils/torch_utils.py

* Add license line to utils/triton.py

* Add license line to val.py

* Auto-format by https://ultralytics.com/actions

* Update ImageNet1000.yaml

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Auto-format by https://ultralytics.com/actions

---------

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2024-06-08 22:29:29 +02:00
Glenn Jocher 41603da162
Add docstrings to YOLOv5 functions ()
* Add docstrings to top level files

* Auto-format by https://ultralytics.com/actions

* Add docstrings

* Auto-format by https://ultralytics.com/actions

* Add docstrings

* Auto-format by https://ultralytics.com/actions

* Add docstrings

* Add docstrings

* Auto-format by https://ultralytics.com/actions

* Add docstrings

* Add docstrings

* Auto-format by https://ultralytics.com/actions

* Add docstrings

* Auto-format by https://ultralytics.com/actions

* Add docstrings

* Auto-format by https://ultralytics.com/actions

* Add docstrings

* Auto-format by https://ultralytics.com/actions

* Add docstrings

* Auto-format by https://ultralytics.com/actions

* Add docstrings

* Auto-format by https://ultralytics.com/actions

* Add docstrings

* Add docstrings

* Auto-format by https://ultralytics.com/actions

* Add docstrings

* Auto-format by https://ultralytics.com/actions

* Add docstrings

* Auto-format by https://ultralytics.com/actions

* Add docstrings

* Auto-format by https://ultralytics.com/actions

* Add docstrings

* Auto-format by https://ultralytics.com/actions

* Add docstrings

* Auto-format by https://ultralytics.com/actions

* Add docstrings

* Auto-format by https://ultralytics.com/actions

* Update activations.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Auto-format by https://ultralytics.com/actions

---------

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
2024-02-25 14:04:01 +01:00
Paula Derrenger ad97dc6a6d
Update Actions with Lychee and GitHub Token ()
* Add Ultralytics Actions

* Auto-format by Ultralytics actions

* Update format.yml

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

---------

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2024-01-08 01:29:14 +01:00
chaoqin c0b0729386
Fix the bug that multi webcam detection failed with OpenVINO ()
* Fix the bug that multi webcam detection failed with OpenVINO

It would failed with the following error when detect multi webcam.
"Input blob size is not equal network input size (2457600!=1228800)"

Signed-off-by: Chao Qin <chaoqin_cmkj@163.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: Chao Qin <chaoqin_cmkj@163.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-01-03 08:10:10 +01:00
Yakuho 69b0faf2f7
Update selectable device Profile ()
* Update selectable device Profile

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-01-03 08:09:23 +01:00
Glenn Jocher ec690e42af
Update YouTube URL https://youtu.be/LNwODJXcvt4 ()
Update example YouTube URL
2023-09-10 04:59:27 +02:00
Akash A Desai 8c30c583b0
Add new `--save-csv` argument to detect.py ()
* Update detect.py

added support for saving result in csv,used for testing

Signed-off-by: Akash A Desai <62583018+akashAD98@users.noreply.github.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update detect.py

Signed-off-by: Akash A Desai <62583018+akashAD98@users.noreply.github.com>

* Update detect.py

changed save_in_csv to save_csv

Signed-off-by: Akash A Desai <62583018+akashAD98@users.noreply.github.com>

* Update detect.py

Signed-off-by: Akash A Desai <62583018+akashAD98@users.noreply.github.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: Akash A Desai <62583018+akashAD98@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-09-04 12:52:33 +02:00
Glenn Jocher 2270f0d1e7
Import Annotator class from `ultralytics` package ()
* Import Annotator class from `ultralytics` package

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Import Annotator class from `ultralytics` package

* Update requirements.txt

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

---------

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-08-01 20:56:35 +02:00
Glenn Jocher eef637cd04
Update `check_requirements()` ROOT () 2023-05-21 00:18:12 +02:00
Glenn Jocher 34cf749958
Update LICENSE to AGPL-3.0 ()
* Update LICENSE to AGPL-3.0

This pull request updates the license of the YOLOv5 project from GNU General Public License v3.0 (GPL-3.0) to GNU Affero General Public License v3.0 (AGPL-3.0).

We at Ultralytics have decided to make this change in order to better protect our intellectual property and ensure that any modifications made to the YOLOv5 source code will be shared back with the community when used over a network.

AGPL-3.0 is very similar to GPL-3.0, but with an additional clause to address the use of software over a network. This change ensures that if someone modifies YOLOv5 and provides it as a service over a network (e.g., through a web application or API), they must also make the source code of their modified version available to users of the service.

This update includes the following changes:
- Replace the `LICENSE` file with the AGPL-3.0 license text
- Update the license reference in the `README.md` file
- Update the license headers in source code files

We believe that this change will promote a more collaborative environment and help drive further innovation within the YOLOv5 community.

Please review the changes and let us know if you have any questions or concerns.


Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update headers to AGPL-3.0

---------

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2023-04-14 14:36:16 +02:00
Glenn Jocher 7a972e86c4
Update .pre-commit-config.yaml ()
* Update .pre-commit-config.yaml

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update __init__.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update .pre-commit-config.yaml

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Pre-commit updates

* Pre-commit updates

---------

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-02-18 01:06:24 +01:00
Colin Wong 5dc1ce4e86
Support `.txt` files as a line-by-line media list rather than streams ()
* Update streams.txt default

Signed-off-by: Colin Wong <cwongmath@gmail.com>

* Change streams list extension to .streams

* Read txt as media per line

* Missed one

* Missed another one

* Update dataloaders.py

* Update detect.py

* Update dataloaders.py

* Update detect.py

* Update predict.py

* Update predict.py

* Update README.md

Signed-off-by: Colin Wong <cwongmath@gmail.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-12-03 14:58:58 -08:00
Glenn Jocher 9bc60349b6
Add `--source screen` Usage example () 2022-11-18 23:48:47 +01:00
Glenn Jocher 3b1a9d22a4
Fix OpenVINO Usage example ()
* Fix OpenVINO Usage example

* Fix OpenVINO Usage example
2022-10-20 19:54:07 +02:00
Glenn Jocher e3ff780676
Allow PyTorch Hub results to display in notebooks ()
* Allow PyTorch Hub results to display in notebooks

* fix CI

* fix CI

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix CI

* fix CI

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix CI

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix CI

* fix CI

* fix CI

* fix CI

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix CI

* fix CI

* fix CI

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-17 14:34:33 +02:00
Glenn Jocher 966b0e09f0
TensorRT detect.py inference fix ()
* Update

* Update ci-testing.yml

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update ci-testing.yml

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Segment fix

* Segment fix

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-09-25 16:21:26 +02:00
Glenn Jocher c8e52304cf
New `scale_segments()` function ()
* Rename scale_coords to scale_boxes

* add scale_segments
2022-09-24 16:02:41 +02:00
Gaz Iqbal d669a74623
Detect.py supports running against a Triton container ()
* update coco128-seg comments

* Enables detect.py to use Triton for inference

Triton Inference Server is an open source inference serving software
that streamlines AI inferencing.
https://github.com/triton-inference-server/server

The user can now provide a "--triton-url" argument to detect.py to use
a local or remote Triton server for inference.
For e.g., http://localhost:8000 will use http over port 8000
and grpc://localhost:8001 will use grpc over port 8001.
Note, it is not necessary to specify a weights file to use Triton.

A Triton container can be created by first exporting the Yolov5 model
to a Triton supported runtime. Onnx, Torchscript, TensorRT are
supported by both Triton and the export.py script.

The exported model can then be containerized via the OctoML CLI.
See https://github.com/octoml/octo-cli#getting-started for a guide.

* added triton client to requirements

* fixed support for TFSavedModels in Triton

* reverted change

* Test CoreML update

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update ci-testing.yml

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Use pathlib

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Refacto DetectMultiBackend to directly accept triton url as --weights http://...

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Deploy category

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update detect.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update common.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update common.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update predict.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update predict.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update predict.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update triton.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update triton.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add printout and requirements check

* Cleanup

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* triton fixes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fixed triton model query over grpc

* Update check_requirements('tritonclient[all]')

* group imports

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix likely remote URL bug

* update comment

* Update is_url()

* Fix 2x download attempt on http://path/to/model.pt

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: glennjocher <glenn.jocher@ultralytics.com>
Co-authored-by: Gaz Iqbal <giqbal@octoml.ai>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-09-24 00:56:42 +02:00
zombob 30fa9b610a
Add `--source screen` for screenshot inference ()
* add screenshot as source

* fix: screen number support

* Fix: mutiple screen specific area

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* parse screen args in LoadScreenshots

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* sequence+ '_' as file name for save-txt save-crop

* screenshot as stream

* Update requirements.txt

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update dataloaders.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update dataloaders.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update detect.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update detect.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update detect.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update dataloaders.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update detect.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update detect.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update predict.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update detect.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update predict.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update README.md

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update tutorial.ipynb

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: xin <xin@zhiyoung.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-09-22 23:58:14 +02:00
Glenn Jocher b25d5a75f2
Refactor dataset batch-size () 2022-09-22 23:23:40 +02:00
Ayush Chaurasia f9869f7ffd
YOLOv5 segmentation model support ()
* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix duplicate plots.py

* Fix check_font()

* # torch.use_deterministic_algorithms(True)

* update doc detect->predict

* Resolve precommit for segment/train and segment/val

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Resolve precommit for utils/segment

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Resolve precommit min_wh

* Resolve precommit utils/segment/plots

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Resolve precommit utils/segment/general

* Align NMS-seg closer to NMS

* restore deterministic init_seeds code

* remove easydict dependency

* update

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* restore output_to_target mask

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* update

* cleanup

* Remove unused ImageFont import

* Unified NMS

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* DetectMultiBackend compatibility

* segment/predict.py update

* update plot colors

* fix bbox shifted

* sort bbox by confidence

* enable overlap by default

* Merge detect/segment output_to_target() function

* Start segmentation CI

* fix plots

* Update ci-testing.yml

* fix training whitespace

* optimize process mask functions (can we merge both?)

* Update predict/detect

* Update plot_images

* Update plot_images_and_masks

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix

* Add train to CI

* fix precommit

* fix precommit CI

* fix precommit pycocotools

* fix val float issues

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix masks float float issues

* suppress errors

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix no-predictions plotting bug

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add CSV Logger

* fix val len(plot_masks)

* speed up evaluation

* fix process_mask

* fix plots

* update segment/utils build_targets

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* optimize utils/segment/general crop()

* optimize utils/segment/general crop() 2

* minor updates

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* torch.where revert

* downsample only if different shape

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* loss cleanup

* loss cleanup 2

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* loss cleanup 3

* update project names

* Rename -seg yamls from _underscore to -dash

* prepare for yolov5n-seg.pt

* precommit space fix

* add coco128-seg.yaml

* update coco128-seg comments

* cleanup val.py

* Major val.py cleanup

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* precommit fix

* precommit fix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* optional pycocotools

* remove CI pip install pycocotools (auto-installed now)

* seg yaml fix

* optimize mask_iou() and masks_iou()

* threaded fix

* Major train.py update

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Major segments/val/process_batch() update

* yolov5/val updates from segment

* process_batch numpy/tensor fix

* opt-in to pycocotools with --save-json

* threaded pycocotools ops for 2x speed increase

* Avoid permute contiguous if possible

* Add max_det=300 argument to both val.py and segment/val.py

* fix onnx_dynamic

* speed up pycocotools ops

* faster process_mask(upsample=True) for predict

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* eliminate permutations for process_mask(upsample=True)

* eliminate permute-contiguous in crop(), use native dimension order

* cleanup comment

* Add Proto() module

* fix class count

* fix anchor order

* broadcast mask_gti in loss for speed

* Cleanup seg loss

* faster indexing

* faster indexing fix

* faster indexing fix2

* revert faster indexing

* fix validation plotting

* Loss cleanup and mxyxy simplification

* Loss cleanup and mxyxy simplification 2

* revert validation plotting

* replace missing tanh

* Eliminate last permutation

* delete unneeded .float()

* Remove MaskIOULoss and crop(if HWC)

* Final v6.3 SegmentationModel architecture updates

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add support for TF export

* remove debugger trace

* add call

* update

* update

* Merge master

* Merge master

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update dataloaders.py

* Restore CI

* Update dataloaders.py

* Fix TF/TFLite export for segmentation model

* Merge master

* Cleanup predict.py mask plotting

* cleanup scale_masks()

* rename scale_masks to scale_image

* cleanup/optimize plot_masks

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add Annotator.masks()

* Annotator.masks() fix

* Update plots.py

* Annotator mask optimization

* Rename crop() to crop_mask()

* Do not crop in predict.py

* crop always

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Merge master

* Add vid-stride from master PR

* Update seg model outputs

* Update seg model outputs

* Add segmentation benchmarks

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add segmentation benchmarks

* Add segmentation benchmarks

* Add segmentation benchmarks

* Fix DetectMultiBackend for OpenVINO

* update Annotator.masks

* fix val plot

* revert val plot

* clean up

* revert pil

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix CI error

* fix predict log

* remove upsample

* update interpolate

* fix validation plot logging

* Annotator.masks() cleanup

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Remove segmentation_model definition

* Restore 0.99999 decimals

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: Laughing-q <1185102784@qq.com>
Co-authored-by: Jiacong Fang <zldrobit@126.com>
2022-09-16 00:12:46 +02:00
Glenn Jocher 4e8504abd9
PaddlePaddle Usage examples () 2022-09-10 13:25:01 +03:00
VELC 1aea74cddb
Add new `--vid-stride` inference parameter for videos ()
* fps feature/skip frame added

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* predict.py updates

* Update dataloaders.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update dataloaders.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* remove unused attribute

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Cleanup

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update predict.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update detect.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update dataloaders.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Rename skip_frame to vid_stride

* cleanup

* cleanup2

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-09-04 17:15:53 +02:00
Glenn Jocher ffdb58b0e0
Move `cudnn.benchmarks(True)` to LoadStreams ()
* Move cudnn.benchmarks(True) to LoadStreams

* Update dataloaders.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Move cudnn.benchmarks(True) to LoadStreams

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-09-02 14:12:10 +02:00
Glenn Jocher 51c9f92297
Streaming Classification support ()
* Streaming Classification support

* Streaming Classification support

* Streaming Classification support
2022-08-23 17:54:51 +02:00
Glenn Jocher 06831aa9e9
Improved Usage example docstrings ()
* Updated Usage examples

* Update detect.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update predict.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-08-22 01:06:29 +02:00
Glenn Jocher d40cd0d454
Improved `Profile()` inference timing ()
* Improved `Profile()` class

* Update predict.py

* Update val.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update val.py

* Update AutoShape

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-08-18 19:55:38 +02:00
Glenn Jocher e08d568d39
Add glob quotes to detect.py usage example ()
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-08-18 01:08:52 +02:00
Glenn Jocher dc38cd03f4
New `smart_inference_mode()` conditional decorator ()
New smart_inference_mode()
2022-08-13 20:38:51 +02:00
Glenn Jocher 52d3a9aee1
Fix `detect.py --update` list bug ()
Fix detect.py --update

Resolves https://github.com/ultralytics/yolov5/issues/8776
2022-07-29 17:07:24 +02:00
Glenn Jocher 7215a0fb41
Avoid cv2 window init code on Windows ()
Resolves https://github.com/ultralytics/yolov5/issues/8642
2022-07-25 13:57:05 +02:00
Nicholas Zolton 0537e8dd13
Allow detect.py to use video size for initial window size ()
* fixed initial window size of detect.py being tiny

* cleanup

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-06-27 00:04:11 +02:00
Ryan Hirasaki 19f33cbae2
Allow preview resize in detect.py ()
* Initial implementation of --viewsz

* use mouse resize

* Add comment

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-06-24 15:30:44 +02:00
Glenn Jocher f00071416f
Refactor collections and fstrings ()
* Update torch_utils.py

* Additional code refactoring

* tuples to sets

* Cleanup
2022-05-15 16:38:26 +02:00
Glenn Jocher 9d8ed37df7
Rename `utils/datasets.py` > `utils/dataloaders.py` () 2022-05-13 14:34:16 +02:00
Glenn Jocher 446e6f563a
Rename 'MacOS' to 'macOS' () 2022-04-08 23:05:15 +02:00
Glenn Jocher 2c3221844b
CLI `fire` prep updates ()
* CLI fire prep updates

* revert unintentional TF export change
2022-03-31 17:11:43 +02:00
Jirka Borovec c3d5ac151e
precommit: yapf ()
* precommit: yapf

* align isort

* fix

# Conflicts:
#	utils/plots.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update setup.cfg

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update setup.cfg

* Update setup.cfg

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update wandb_utils.py

* Update augmentations.py

* Update setup.cfg

* Update yolo.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update val.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* simplify colorstr

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* val run fix

* export.py last comma

* Update export.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update hubconf.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* PyTorch Hub tuple fix

* PyTorch Hub tuple fix2

* PyTorch Hub tuple fix3

* Update setup

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-03-31 16:52:34 +02:00
RcINS d115bbf509
Fix `cv2.imwrite` on non-ASCII paths ()
* Fix imwrite on non-ASCII paths

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update general.py

* Update __init__.py

* Update __init__.py

* Update datasets.py

* Update hubconf.py

* Update detect.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update general.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-03-25 13:25:30 +01:00
Glenn Jocher b94b59e199
DetectMultiBackend() `--half` handling ()
* DetectMultiBackend() `--half` handling

* CI fixes

* rename .half to .fp16 to avoid conflict

* warmup fix

* val update

* engine update

* engine update
2022-03-11 16:31:52 +01:00