Commit Graph

124 Commits (fe1d4d9947735473006c68513168fef093ff17ce)

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

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

---------

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
2025-01-15 15:31:19 +01:00
zzzer 4c904ac7f9
Fix possible image drawing issues (#13426)
* Update plots.py

Fixed non-meaningful labels in the top right (row 1, column 4) plots when batch size is larger than max_subplots.

Signed-off-by: zzzer <48149018+zhixuwei@users.noreply.github.com>

* Update plots.py

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

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

* Simple loop conditions

Simple loop conditions

Signed-off-by: zzzer <48149018+zhixuwei@users.noreply.github.com>

---------

Signed-off-by: zzzer <48149018+zhixuwei@users.noreply.github.com>
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
2024-11-23 16:01:47 +01:00
zzzer 81ac034a86
Fix possible image drawing issues (#13423)
* Update plots.py

Fixed non-meaningful labels in the top right (row 1, column 4) plots when batch size is larger than max_subplots.

Signed-off-by: zzzer <48149018+zhixuwei@users.noreply.github.com>

* Update plots.py

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

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

---------

Signed-off-by: zzzer <48149018+zhixuwei@users.noreply.github.com>
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
2024-11-21 16:33:14 +01:00
Glenn Jocher c5ffbbf1c3
Add https://www.reddit.com/r/Ultralytics/ badge (#13284)
* Refactor code for speed and clarity

* Update README.zh-CN.md

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>
2024-08-26 15:46:32 +02:00
Glenn Jocher b40781b3e3
Update README.md (#13283)
* Update README.md

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-08-26 02:37:25 +02:00
Glenn Jocher b9019671f4
Ultralytics Code Refactor https://ultralytics.com/actions (#13152)
Refactor code for speed and clarity
2024-06-30 12:34:04 +02:00
Ultralytics Assistant 3ec95f9e3d
Update header line in Python files (#13072)
* 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 574331f984
Replace inline comments with docstrings (#12764)
* Add docstrings

* Add docstrings

* Add docstrings

* Add docstrings

* Add docstrings

* Add docstrings

* Add docstrings

* Add docstrings

* Add docstrings

* Add docstrings

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

* Add docstrings

* Add docstrings

* Add docstrings

* Add docstrings

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

* Update plots.py

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>
2024-02-26 23:16:32 +01:00
Glenn Jocher 41603da162
Add docstrings to YOLOv5 functions (#12760)
* 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 (#12592)
* 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
tiancailin bd1a8295fb
Fix bug in issue #12457. (#12459)
* Fix bug in #12457.
When run 'python.exe segment/predict.py --visualize' will throw AttributeError: 'tuple' object has no attribute 'shape'

* [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>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2024-01-03 08:07:19 +01:00
Glenn Jocher 2270f0d1e7
Import Annotator class from `ultralytics` package (#11930)
* 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
Peter van Lunteren 6e04b94fa9
add smoothing line to results.png to improve readability (#11536)
Signed-off-by: Peter van Lunteren <contact@pvanlunteren.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2023-05-22 14:12:10 +02:00
Glenn Jocher 34cf749958
Update LICENSE to AGPL-3.0 (#11359)
* 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 (#11009)
* 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
Glenn Jocher bd10f0f6c7
Revert PIL deprecation fix
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2023-01-12 18:01:36 +01:00
Glenn Jocher 0e24b7e2f5
PIL `.get_size()` deprecation fix (#10754)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2023-01-12 17:43:12 +01:00
Laughing b412696ff3
Fix & speed up segment plot (#10350)
* fix plot&&speed up

* fix segment save-txt

* fix channel

* [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>
2022-12-01 08:39:24 -08:00
Glenn Jocher c8e52304cf
New `scale_segments()` function (#9570)
* Rename scale_coords to scale_boxes

* add scale_segments
2022-09-24 16:02:41 +02:00
Glenn Jocher 0171198f38
Fix visualization title bug (#9500)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-09-19 20:38:11 +02:00
Ayush Chaurasia f9869f7ffd
YOLOv5 segmentation model support (#9052)
* [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 2b5c9a83ec
labels.jpg names fix (#9361)
Partially resolves https://github.com/ultralytics/yolov5/issues/9360

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

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-09-10 22:24:46 +03:00
Glenn Jocher 729dc169ba
Fixed Classify offsets (#9155) 2022-08-25 15:04:27 +02:00
Glenn Jocher d07ddc6996
New TryExcept decorator (#9154)
* New TryExcept decorator

* [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>
2022-08-25 14:34:26 +02:00
Glenn Jocher 0abae780b3
Remove unused Timeout import (#9073)
* Remove unused Timeout import

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

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>
2022-08-22 00:04:30 +02:00
Glenn Jocher e0700cce77
Daemon `plot_labels()` for faster start (#9057)
* Daemon `plot_labels()` for faster start

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

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

* Update train.py

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>
2022-08-21 03:47:37 +02:00
Glenn Jocher c725511bfc
Refactor for simplification (#9054)
* Refactor for simplification

* cleanup

* [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>
2022-08-21 01:34:03 +02:00
Glenn Jocher d3ea0df8b9
New YOLOv5 Classification Models (#8956)
* Update

* Logger step fix: Increment step with epochs (#8654)

* enhance

* revert

* allow training from scratch

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

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

* Update --img argument from train.py 

single line

* fix image size from 640 to 128

* suport custom dataloader and augmentation

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

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

* format

* Update dataloaders.py

* Single line return, single line comment, remove unused argument

* address PR comments

* fix spelling

* don't augment eval set

* use fstring

* update augmentations.py

* new maning convention for transforms

* reverse if statement, inline ops

* reverse if statement, inline ops

* updates

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

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

* update dataloaders

* Remove additional if statement

* Remove is_train as redundant

* Cleanup

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

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

* Cleanup2

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

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

* Update classifier.py

* Update augmentations.py

* fix: imshow clip warning

* update

* Revert ToTensorV2 removal

* Update classifier.py

* Update normalize values, revert uint8

* normalize image using cv2

* remove dedundant comment

* Update classifier.py

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

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

* replace print with logger

* commit steps

* [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>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Allow logging models from GenericLogger (#8676)

* enhance

* revert

* allow training from scratch

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

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

* Update --img argument from train.py 

single line

* fix image size from 640 to 128

* suport custom dataloader and augmentation

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

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

* format

* Update dataloaders.py

* Single line return, single line comment, remove unused argument

* address PR comments

* fix spelling

* don't augment eval set

* use fstring

* update augmentations.py

* new maning convention for transforms

* reverse if statement, inline ops

* reverse if statement, inline ops

* updates

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

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

* update dataloaders

* Remove additional if statement

* Remove is_train as redundant

* Cleanup

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

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

* Cleanup2

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

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

* Update classifier.py

* Update augmentations.py

* fix: imshow clip warning

* update

* Revert ToTensorV2 removal

* Update classifier.py

* Update normalize values, revert uint8

* normalize image using cv2

* remove dedundant comment

* Update classifier.py

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

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

* replace print with logger

* commit steps

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

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

* support final model logging

* update

* update

* update

* update

* remove curses

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

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

* Update classifier.py

* Update __init__.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>

* Update

* Update

* Update

* Update

* Update dataset download

* Update dataset download

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Pass imgsz to classify_transforms()

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Cos scheduler

* Cos scheduler

* Remove unused args

* Update

* Add seed

* Add seed

* Update

* Update

* Add run(), main()

* Merge master

* Merge master

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Create YOLOv5 BaseModel class (#8829)

* Create BaseModel

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

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

* fix

* Hub load device fix

* Update

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Add experiment

* Merge master

* Attach names

* weight decay = 1e-4

* weight decay = 5e-5

* update smart_optimizer console printout

* fashion-mnist fix

* Merge master

* Update Table

* Update Table

* Remove destroy process group

* add kwargs to forward()

* fuse fix for resnet50

* nc, names fix for resnet50

* nc, names fix for resnet50

* ONNX CPU inference fix

* revert

* cuda

* if augment or visualize

* if augment or visualize

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

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

* New smart_inference_mode()

* Update README

* Refactor into /classify dir

* [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

* reset defaults

* reset defaults

* fix gpu predict

* warmup

* ema half fix

* spacing

* remove data

* remove cache

* remove denormalize

* save run settings

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

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

* verbose false on initial plots

* new save_yaml() function

* Update ci-testing.yml

* Path(data) CI fix

* Separate classification CI

* fix val

* fix val

* fix val

* smartCrossEntropyLoss

* skip validation on hub load

* autodownload with working dir root

* str(data)

* Dataset usage example

* im_show normalize

* im_show normalize

* add imagenet simple names to multibackend

* Add validation speeds

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

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

* 24-space names

* Update bash scripts

* Update permissions

* Add bash script arguments

* remove verbose

* TRT data fix

* names generator fix

* optimize if names

* update usage

* Add local loading

* Verbose=False

* update names printing

* Add Usage examples

* Add Usage examples

* Add Usage examples

* Add Usage examples

* named_children

* reshape_classifier_outputs

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

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

* update

* update

* fix CI

* fix incorrect class substitution

* fix incorrect class substitution

* remove denormalize

* ravel fix

* cleanup

* update opt file printing

* update opt file printing

* update defaults

* add opt to checkpoint

* Add warning

* Add comment

* plot half bug fix

* Use NotImplementedError

* fix export shape report

* Fix TRT load

* cleanup CI

* profile comment

* CI fix

* Add cls models

* avoid inplace error

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

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

* Fix usage examples

* Update README

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

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

* Update README

* Update README

* Update README

* Update README

* Update README

* Update README

* Update README

* Update README

* Update README

* Update README

* Update README

* Update README

* Update README

* Update README

* Update README

* Update README

Co-authored-by: Ayush Chaurasia <ayush.chaurarsia@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-08-17 11:59:01 +02:00
Victor Sonck 378bde4bba
ClearML experiment tracking integration (#8620)
* Add titles to matplotlib plots

* Add ClearML Experiment Tracking integration.

* Add ClearML Data Version Management automatic download when requested

* Add ClearML Hyperparameter Optimization

* ClearML save period integration

* Fix wandb breaking when used with ClearML dataset

* Fix wandb breaking when used with ClearML resume and dataset

* Add ClearML documentation

* fixed small bug in clearml integration that misreports epoch number

* Final ClearMl additions before refactor

* Add correct epoch reporting

* Add remote execution and autoscaling docs for ClearML integration

* Added images to clearml integration docs

* fixed logo alignment bug and added hpo screenshot clearml

* Fixed small epoch number bug in clearml integration

* Remove saved model flush clearml

* Cleanup clearml readme section

* Cleaned up clearml logger docstring

* Remove resume readme section clearml

* Clearml integration cleanup

* Updated ClearML documentation

* Added dark vs light icons ClearML Readme

* Clearml Readme styling

* Add better gifs

* Fixed gif file size

* Add better images in tutorial notebook

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

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

* Addressed comments in PR #8620

* Fixed circular import

* Fixed circular import

* Update tutorial.ipynb

* Update tutorial.ipynb

* Inline comment

* Restructured tutorial notebook

* Add correct ClearML link to README

* Update tutorial.ipynb

* Update general.py

* Update __init__.py

* Update __init__.py

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

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

* Update __init__.py

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

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

* Update __init__.py

* Update README.md

* Update __init__.py

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

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

* spelling

* Update tutorial.ipynb

* notebook cutt.ly links

* Update README.md

* Update README.md

* cutt.ly links in tutorial

* Removed labels as they show up on last subplot only

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-08-05 20:50:49 +02:00
Glenn Jocher 916bdb1d61
Faster crop saving (#8696)
Faster crops

Following https://github.com/ultralytics/yolov5/issues/8641#issuecomment-1193190325
2022-07-23 23:30:30 +02:00
Glenn Jocher 4a295b1a89
Add `@threaded` decorator (#7813)
* Add `@threaded` decorator

* [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>
2022-05-14 16:12:08 +02:00
SylvanDing 5743deb9df
Update plot.py (#7654)
fix bug in issue #7650
2022-04-30 20:01:21 -07:00
Glenn Jocher 7043872f25
PyTorch Hub `_verbose=False` fix2 (#7550)
* PyTorch Hub `_verbose=False` fix2

* Update downloads.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

* Update

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

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

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-04-23 11:26:25 -07:00
Glenn Jocher c9042dc2ad
Improved non-latin `Annotator()` plotting (#7488)
* Improved non-latin labels Annotator plotting

May resolve https://github.com/ultralytics/yolov5/issues/7460

* Update train.py

* Update train.py

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

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

* add progress arg

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-04-19 17:32:15 -07:00
Jirka Borovec c3d5ac151e
precommit: yapf (#5494)
* 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
Philip Gutjahr 529fbc1814
Use PIL to eliminate chroma subsampling in crops (#7008)
* use pillow to save higher-quality jpg (w/o color subsampling)

* Cleanup and doc issue

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-03-20 15:46:29 +01:00
Max Strobel 7c6a33564a
fix: add default PIL font as fallback (#7010)
* fix: add default font as fallback

Add default font as fallback if the downloading of the Arial.ttf font
fails for some reason, e.g. no access to public internet.

* Update plots.py

Co-authored-by: Maximilian Strobel <Maximilian.Strobel@infineon.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-03-17 16:37:09 +01:00
Glenn Jocher c21da596f3
Fix `hyp_evolve.yaml` indexing bug (#6604)
* Fix `hyp_evolve.yaml` indexing bug

Bug caused hyp_evolve.yaml to display latest generation result rather than best generation result.

* Update plots.py

* Update general.py

* Update general.py

* Update general.py
2022-02-10 14:51:29 +01:00
Glenn Jocher f627bc53f8
Fix `plot_labels()` colored histogram bug (#6574)
* Fix `plot_labels()` colored histogram bug

* Cleanup
2022-02-08 14:03:50 +01:00
Jirka Borovec cba4303d32
Fix 6 Flake8 issues (#6541)
* F541

* F821

* F841

* E741

* E302

* E722

* Apply suggestions from code review

* Update general.py

* Update datasets.py

* Update export.py

* Update plots.py

* Update plots.py

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-02-05 15:22:59 +01:00
Glenn Jocher c3e599cfda
Update val_batch*.jpg for Chinese fonts (#6526)
* Update plots for Chinese fonts

* make is_chinese() non-str safe

* Add global FONT

* [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>
2022-02-03 19:09:24 +01:00
Glenn Jocher d5966c93f1
Namespace `VERBOSE` env variable to `YOLOv5_VERBOSE` (#6428)
* Verbose updates

* Verbose updates
2022-01-25 17:57:27 -05:00
Glenn Jocher a3d5f1d3e3
Revert "Update `plot_lr_scheduler()` (#5864)" (#5920)
This reverts commit 360eec6910.
2021-12-08 16:46:24 +01:00
Can 360eec6910
Update `plot_lr_scheduler()` (#5864)
shallow copy modify originals
2021-12-03 13:37:45 +01:00
Zengyf-CVer f17c86b7f0
Save *.npy features on detect.py `--visualize` (#5701)
* Add feature map to save npy files

Add feature map to save npy files,export npy files with 32 feature maps per layer.

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

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

* Update plots.py

* Update plots.py

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

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

* Update plots.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>
2021-11-21 20:21:44 +01:00
Glenn Jocher 80cfaf40ef
AutoAnchor and AutoBatch `LOGGER` (#5635)
* AutoBatch, AutoAnchor `LOGGER`

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

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

* Update autoanchor.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-11-13 15:40:18 +01:00
Glenn Jocher def7a0fd19
Improve plots.py robustness (#5616)
* Improve plots.py robustness

Addresses issues #5374, #5395, #5611

* [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>
2021-11-11 12:56:38 +01:00
Glenn Jocher 3f64ad1760
Fix `save_one_box()` (#5545)
* Fix `save_one_box()`

* [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>
2021-11-06 19:28:03 +01:00
Jirka Borovec 0155548384
precommit: isort (#5493)
* precommit: isort

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

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

* Update isort config

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

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

* Update name

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>
2021-11-04 17:24:25 +01:00
Glenn Jocher 5866646cc8
Fix float zeros format (#5491)
* Fix float zeros format

* 255 to integer
2021-11-03 23:36:53 +01:00