Commit Graph

1172 Commits (master)

Author SHA1 Message Date
Glenn Jocher da22e01a68
`check_font()` fstring update (#9208)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-08-29 18:10:19 +02:00
Glenn Jocher fef1913d28
`check_font()` on notebook init (#9200)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-08-29 15:12:15 +02:00
Glenn Jocher f65081c436
Add `check_git_status(..., branch='master')` argument (#9199)
Add check_git_status(branch='master') argument

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

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-08-29 15:00:55 +02:00
HighMans cf5d9cbc33
ClearML's set_report_period's time is defined in minutes not seconds. (#9186)
* ClearML's set_report_period's time is defined in minutes not seconds.

https://clear.ml/docs/latest/docs/references/sdk/hpo_optimization_hyperparameteroptimizer/#set_report_period

set_report_period function takes in time in terms of minutes, not seconds.

Signed-off-by: HighMans <42877729+HighMans@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: HighMans <42877729+HighMans@users.noreply.github.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-08-29 14:58:55 +02:00
Glenn Jocher e57275a2d8
Skip AMP check on MPS (#9189)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-08-29 02:00:42 +02:00
Glenn Jocher 13530402f8
Fix AutoAnchor MPS bug (#9188)
Resolves https://github.com/ultralytics/yolov5/issues/8862

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

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-08-29 01:51:41 +02:00
Glenn Jocher 53711bacea
Update Dockerfile-arm64 to libpython3-dev (#9187)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-08-28 22:14:21 +02:00
Glenn Jocher 985e000d81
Update Dockerfile-cpu to libpython3-dev (#9185)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-08-28 21:48:58 +02:00
Glenn Jocher f58fe6b6c1
Update Dockerfile-cpu (#9184)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-08-28 21:36:05 +02:00
HighMans ffbce3858a
Fix confidence threshold for ClearML debug images (#9174)
* Fix confidence threshold

The confidence is converted to a percentage on line 144, but it is being compared to a default conf_threshold value of a decimal value instead of percent value.

Signed-off-by: HighMans <42877729+HighMans@users.noreply.github.com>

* Revert "Fix confidence threshold"

This reverts commit f84a09967f.

* Fix confidence comparison

Fix the confidence percentage is being compared to a decimal value.

Signed-off-by: HighMans <42877729+HighMans@users.noreply.github.com>
2022-08-27 01:39:11 +02:00
Glenn Jocher cff9717d73
Comment EMA assert (#9173)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-08-26 20:06:26 +02: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 f0e5a608f5
Add CSV logging to GenericLogger (#9128)
Enable CSV logging for Classify training.

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

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-08-24 12:31:50 +02:00
Ayush Chaurasia f8816f58b7
Infer Loggers project name (#9117)
* smart project name inference

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

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

* 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>
2022-08-24 12:15:37 +02:00
Glenn Jocher 51c9f92297
Streaming Classification support (#9106)
* Streaming Classification support

* Streaming Classification support

* Streaming Classification support
2022-08-23 17:54:51 +02:00
Glenn Jocher 48e56d3c9b
Add optional `transforms` argument to LoadStreams() (#9105)
* Add optional `transforms` argument to LoadStreams()

Prepare for streaming classification support

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

* Cleanup

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

* fix

* batch size > 1 fix

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-08-23 14:37:46 +02:00
Glenn Jocher d0fa0042bd
New `@try_export` decorator (#9096)
* New export decorator

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

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

* New export decorator

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

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

* Cleanup

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

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

* rename fcn to func

* rename to @try_export

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-08-23 13:06:33 +02:00
Glenn Jocher eab35f66f9
Install `torch` latest stable (#9092)
Install torch 1.12.1 stable 

GPU assignment issues in 1.13 nightly that comes with image

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

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-08-22 22:18:01 +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 db2ee5fa0c
De-thread TensorBoard graph logging (#9071)
* De-thread TensorBoard graph logging

Issues with Classification models

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

* Update __init__.py

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

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-08-21 17:07:56 +02:00
Glenn Jocher 8665d557c1
Threaded TensorBoard graph logging (#9070)
* Log TensorBoard graph on pretrain_routine_end

* fix
2022-08-21 16:51:50 +02:00
0zppd 87e8deadd5
zero-mAP fix remove `torch.empty()` forward pass in `.train()` mode (#9068)
* Fix Zero Map Issue

Signed-off-by: 0zppd <111682241+0zppd@users.noreply.github.com>

* Update __init__.py

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

Signed-off-by: 0zppd <111682241+0zppd@users.noreply.github.com>
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-08-21 15:40:28 +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 27fb6fd8fc
zero-mAP fix 3 (#9058)
* zero-mAP fix 3

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

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

* Update torch_utils.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:22:24 +02:00
Glenn Jocher 841f312f93
zero-mAP fix return `.detach()` to EMA (#9056)
Resolves https://github.com/ultralytics/hub/issues/82

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

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-08-21 02:23:39 +02:00
Glenn Jocher 93f63ee33f
Refactor for simplification 2 (#9055)
* Refactor for simplification 2

* Update __init__.py

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

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-08-21 02:00:35 +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 a409ec7953
AutoBatch protect from negative batch sizes (#9048)
* AutoBatch protect from negative batch sizes

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

* cleanup

* [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-20 16:29:08 +02:00
Glenn Jocher 4a8ab3bc42
VOC `names` dictionary fix (#9034)
* VOC names dictionary fix

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

* Update dataloaders.py

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

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-08-19 15:07:04 +02:00
Glenn Jocher 61adf017f2
`torch.empty()` for speed improvements (#9025)
`torch.empty()` for speed improvement

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-08-18 20:12:33 +02:00
Glenn Jocher d40cd0d454
Improved `Profile()` inference timing (#9024)
* 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 20049be2e7
EMA FP32 assert classification bug fix (#9016)
* Return EMA float on classification val

* verbose val fix

* EMA check
2022-08-18 14:06:15 +02:00
Glenn Jocher 0922bc2082
DockerHub tag update Usage example (#9005)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-08-17 22:50:08 +02:00
Ayush Chaurasia 64e0757edf
[Classify]: Allow inference on dirs and videos (#9003)
* allow image dirs

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

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

* Update predict.py

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

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

* Update dataloaders.py

* Update predict.py

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

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

* Update predict.py

* Update predict.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-08-17 22:41:43 +02:00
Glenn Jocher e83b422a69
Update dataset `names` from array to dictionary (#9000)
* Migrate dataset names to dictionary

* fix check

* backwards compat

* predict fix

* val fix

* Keep dataset stats behavior identical

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

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-08-17 17:52:53 +02:00
Glenn Jocher 7c9486e16f
Update `attempt_download(release='v6.2')` (#8998)
* Update attempt_download(release='v6.2')

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

* Update README.md

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

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-08-17 15:48:17 +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 3456fe65c6
Fix torchvision dependency for ClearML logging (#8993)
* Replace torchvision annotator with native local Annotator

* Add colored bounding boxes and rewrite for efficiency

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

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

* Fix pep8 issue

* Update clearml_utils.py

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

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

* Update clearml_utils.py

* Reduced conf_threshold to 0.25 to match defaults

The 0.25 default conf threshold value is used a default throughout YOLOv5 (i.e. in detect.py) and also in other tools like CoreML

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-17 11:51:07 +02:00
Glenn Jocher 464c2c6713
Colab and Kaggle loggers removeHandler (#8985)
Resolve duplicate outputs in colab. Also optimizes Colab and Kaggle environment checks.

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

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-08-16 16:49:32 +02:00
Michel Promonet 4d05472d2b
Allow multiple-model serving from Flask REST API (#8973)
* allow to serve multiple models using flask restapi

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

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

* Cleanup

* Update restapi.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-08-15 23:42:25 +02:00
Glenn Jocher d7bc5d7773
Add `.tar` support for datasets (#8963) 2022-08-14 23:06:42 +02:00
Glenn Jocher 7639e4c7ef
Fix windows LOGGER with emojis output (#8958)
* Fix duplicate LOGGER output

* Update general.py
2022-08-14 00:12:09 +02:00
Glenn Jocher dc38cd03f4
New `smart_inference_mode()` conditional decorator (#8957)
New smart_inference_mode()
2022-08-13 20:38:51 +02:00
Glenn Jocher 6aed0a7c00
GFLOPs computation fix for classification models (#8954)
* GFLOPs computation fix for classification models

Improved robustness in reading input channel count

* Update torch_utils.py

* Update torch_utils.py
2022-08-13 16:38:11 +02:00
Kalen Michael 11a76bb4f5
Allow train to use zipped content (#8940)
* fix: added transparent image and empty alt to social bar

* fix: remove underlines

* fix: hide underlines for all social links

* fix: always unzip into folder
2022-08-13 03:39:09 +02:00
Glenn Jocher 7ab1f50633
Scope `torchvision.utils.draw_bounding_boxes` import (#8915)
* Scope `torchvision.utils.draw_bounding_boxes` import

Quick fix for https://github.com/ultralytics/yolov5/issues/8898#issuecomment-1208851874 until a more permanent fix is implemented

* Update clearml_utils.py
2022-08-09 20:29:25 +02:00
Code-Bat b551098d59
About "os.R_OK" in general.py (#8909)
The notes says "Return True if directory has write permissions", however, the code below is "os.R_OK", I think "os.W_OK" is preferred.
2022-08-09 16:59:36 +02:00
Glenn Jocher f5335f22bb
Capitalize YouTube (#8903) 2022-08-08 20:36:18 +02:00
Glenn Jocher 8f28ea4945
emoji-safe default logging (#8888)
* emoji-safe default logging

* implement everywhere
2022-08-06 12:30:08 +02:00
Glenn Jocher 20f1b7ea08
`smart_optimizer()` improved reporting (#8887)
Update smart_optimizer() weight_decay reporting
2022-08-06 11:30:54 +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 bc9fcb1767
HUBDatasetStats() preview images to 50 quality (#8880)
@kalenmike should represent a 30% filesize reduction vs 75 quality
2022-08-05 14:45:41 +02:00
Glenn Jocher 84e7748564
Update dataloaders.py remove `float64` shapes (#8865)
May help https://github.com/ultralytics/yolov5/issues/8862
2022-08-04 17:06:08 +02:00
Glenn Jocher a75a1105a1
Self-contained checkpoint `--resume` (#8839)
* Single checkpoint resume

* Update train.py

* Add hyp

* Add hyp

* Add hyp

* FIX

* avoid resume on url data

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

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

* avoid resume on url data

* avoid resume on url data

* Update

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-08-03 21:28:22 +02:00
Glenn Jocher 08c8c3e00a
New `smart_resume()` (#8838)
* New `smart_resume()`

* Update torch_utils.py

* Update torch_utils.py

* Update torch_utils.py

* fix
2022-08-02 15:13:58 +02:00
Glenn Jocher ba140e5685
RUN git clone instead of COPY to `/usr/src/app` (#8827)
Update
2022-08-01 21:45:31 +02:00
Glenn Jocher 39ce8ca19a
Remove `assert not is_docker()` from GitHub checks (#8813)
* Update

* Update
2022-08-01 03:01:44 +02:00
Amir Pourmand afa403a809
Check git status on upstream `ultralytics` or `origin` dynamically (#8694)
* Add remote ultralytics and check git status with that

* Simplify

* Update general.py

* Update general.py

* s fix

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-07-31 18:17:38 +02:00
Glenn Jocher 555976b346
FROM nvcr.io/nvidia/pytorch:22.07-py3 (#8808) 2022-07-31 15:23:57 +02:00
jbutle55 567397d67a
Fix confusion matrix update when no predictions are made (#8748)
* Fix confusion matrix update when no predictions are made

* Update metrics.py

* Simply confusion matrix changes

* Simply confusion matrix fix

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-07-29 14:06:23 +02:00
Max Strobel 0b5ac224ae
fix: broken ``is_docker`` check (#8711)
Checking if ``/workspace`` exists is not a reliable method to check if
the process runs in a docker container.

Reusing the logic from the npm "is-docker" package to check if the
process runs in a container.
References: https://github.com/sindresorhus/is-docker/blob/main/index.js

Fixes #8710.

Co-authored-by: Maximilian Strobel <Maximilian.Strobel@infineon.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-07-26 19:02:44 +02:00
Glenn Jocher c775a296a7
Revert "Fix BGR->RGB Bug in albumentations #8641" (#8727)
Revert "Fix BGR->RGB Bug in albumentations #8641 (#8695)"

This reverts commit 2e1291fdce.
2022-07-26 19:00:48 +02:00
UnglvKitDe 2e1291fdce
Fix BGR->RGB Bug in albumentations #8641 (#8695)
* Fix BGR->RGB Bug in albumentations https://github.com/ultralytics/yolov5/issues/8641

* Change transform methode from cv2 to numpy

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

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

* Simplify

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

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

* Update augmentations.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-07-26 13:52:56 +02:00
Glenn Jocher b367860196
New `HUBDatasetStats()` class (#8716)
* New `HUBDatasetStats()` class

Usage examples:
```
from utils.dataloaders import *

stats = HUBDatasetStats('coco128.yaml', autodownload=True)  # method 1
stats = HUBDatasetStats('path/to/coco128_with_yaml.zip')  # method 1

stats.get_json(save=False)
stats.process_images()
```

@kalenmike

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

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

* Update dataloaders.py

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

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

* Update dataloaders.py

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

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

* Update dataloaders.py

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

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

* Update dataloaders.py

* [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-07-25 18:20:01 +02:00
Glenn Jocher a6f197ae79
Update dataloaders.py (#8714)
* Update dataloaders.py

* Update dataloaders.py
2022-07-25 16:52:28 +02:00
Glenn Jocher 0ab303b044
Remove `else:` from load_image() (#8692) 2022-07-25 00:02:09 +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 b510957650
Move .dockerignore to root (#8690) 2022-07-23 18:50:19 +02:00
Glenn Jocher 7f7bd6fbcd
Set `torch.cuda.manual_seed_all()` for DDP (#8688)
* Set `torch.cuda.manual_seed_all()` for DDP

* Update general.py

* Update general.py
2022-07-23 18:24:14 +02:00
UnglvKitDe 1c5e92aba1
Add generator and worker seed (#8602)
* Add generator and worker seed

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

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

* Update dataloaders.py

* Update dataloaders.py

* Update dataloaders.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-07-23 01:25:17 +02:00
Glenn Jocher b17629e54f
Update warning emojis (#8678) 2022-07-22 15:23:22 +02:00
Rüdiger Busche 602d7ffb0e
Check TensorBoard logger before adding graph (#8664)
Otherwise, an error is thrown if the tensorboard logger is not included.
2022-07-21 17:40:53 +02:00
Glenn Jocher fbe67e4653
Fix `OMP_NUM_THREADS=1` for macOS (#8624)
Resolves https://github.com/ultralytics/yolov5/issues/8623
2022-07-18 17:53:30 +02:00
Glenn Jocher 9cf5fd5ac3
assert torch!=1.12.0 for DDP training (#8621)
* assert torch!=1.12.0 for DDP training

* [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-07-18 15:05:58 +02:00
Glenn Jocher 51fb467b63
Refactor optimizer initialization (#8607)
* Refactor optimizer initialization

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

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

* Update train.py

* Update train.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-07-17 11:43:52 +02:00
Glenn Jocher 24305787ae
FROM nvcr.io/nvidia/pytorch:22.06-py3 (#8600) 2022-07-17 00:55:55 +02:00
Glenn Jocher 6e86af3de8
Add `pip install wheel` to avoid legacy `setup.py install` (#8597)
* Update ci-testing with `pip install wheel`

* Update ci-testing.yml

* Update dockerfiles
2022-07-16 16:41:43 +02:00
Glenn Jocher 04146371b9
Update metrics.py with IoU protected divides (#8550) 2022-07-12 01:58:25 +02:00
Glenn Jocher a84cd02387
CIoU protected divides (#8546)
Protected divides in IOU function to resolve https://github.com/ultralytics/yolov5/issues/8539
2022-07-11 16:07:11 +02:00
Colin Wong 526e650553
Fix `LoadImages()` with dataset YAML lists (#8517)
* Fix LoadImages with dataset yaml lists

* Update dataloaders.py

* Update dataloaders.py

* Simplify/refactor PR

* Update dataloaders.py

Co-authored-by: Colin Wong <noreply@brains4drones.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-07-08 14:32:40 +02:00
Glenn Jocher f17444abcd
Simplify benchmarks.py assertions (#8515) 2022-07-07 23:46:55 +02:00
Glenn Jocher 3e54651fca
Add `--hard-fail` argument to benchmarks for CI errors (#8513)
* Add `--hard-fail` list argument to benchmarks for CI

Will cause CI to fail on a benchmark failure for given indices.

* Update ci-testing.yml

* Attempt Failure (CI should fail)

* Update benchmarks.py

* Update export.py

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

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

* Update benchmarks.py

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

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

* Update ci-testing.yml

* Update benchmarks.py

* Update benchmarks.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-07-07 23:41:34 +02:00
Glenn Jocher dd28df98c2
Avoid FP64 ops for MPS support in train.py (#8511)
Avoid FP64 ops for MPS support

Resolves https://github.com/ultralytics/yolov5/pull/7878#issuecomment-1177952614
2022-07-07 20:36:23 +02:00
Ayush Chaurasia 27d831b6e4
Training reproducibility improvements (#8213)
* attempt at reproducibility

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

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

* use deterministic algs

* fix everything :)

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

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

* revert dataloader changes

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

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

* process_batch as np

* remove newline

* Remove dataloader init fcn

* Update val.py

* Update train.py

* revert additional changes

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

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

* Update train.py

* Add --seed arg

* Update general.py

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

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

* Update train.py

* Update train.py

* Update val.py

* Update train.py

* Update general.py

* Update general.py

* Add deterministic argument to init_seeds()

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-07-07 14:39:29 +02:00
Glenn Jocher 29d79a6360
Do not prefer Apple MPS (#8446)
Require explicit request for MPS, i.e.
```bash
python detect.py --device mps
```

Reverts https://github.com/ultralytics/yolov5/pull/8210 for preferring MPS if available. 

Note that torch MPS is experiencing ongoing compatibility issues in https://github.com/pytorch/pytorch/issues/77886
2022-07-02 18:35:45 +02:00
Glenn Jocher 898332433a
Update cache comments (#8414)
* Update cache comments

For better readability

* Update dataloaders.py
2022-06-30 16:19:22 +02:00
Glenn Jocher 34df5032a7
Add File Size (MB) column to benchmarks (#8359)
* Add filesize to benchmarks.py

* Add filesize to benchmarks.py

* [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-06-27 17:46:49 +02:00
Glenn Jocher a2a1ed201d
`logging.ERROR` on `RANK` not in (0, 1) (#8284)
Improve DDP console response in https://github.com/ultralytics/yolov5/issues/8283
2022-06-21 17:41:14 +02:00
Glenn Jocher d6051382f1
HUB dataset_stats() error reporting (#8192)
* HUB dataset_stats() error reporting

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

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

* Update dataloaders.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-06-17 18:37:08 +02:00
Glenn Jocher 303f3785ae
Prefer MPS over CPU if available (#8210)
* Prefer MPS over CPU if available

* Update torch_utils.py
2022-06-17 18:28:29 +02:00
Glenn Jocher 86e6add07b
Remove streaming source sleep period (#8243)
Negatively impacts YouTube inference but removes any lag on webcams/RTSP/RTMP etc.

Resolves https://github.com/ultralytics/yolov5/issues/4465
2022-06-17 17:59:27 +02:00
Glenn Jocher 75bbaa8f44
Reject webcam inference on Colab/Kaggle (#8209)
* Reject webcam inference on Colab/Kaggle

Improve user error understanding for https://github.com/ultralytics/yolov5/issues/8180

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

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

* cleanup

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-06-14 14:28:21 +02:00
Glenn Jocher c23a441c9d
Improved `dataset_stats()` YAML checks (#8125)
* Update dataloaders.py

* Update dataloaders.py

* [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-06-11 19:30:54 +02:00
Glenn Jocher 6adc53ba5f
Docker GPU pip install `opencv-python<4.6.0.66` (#8164)
* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update
2022-06-09 22:45:49 +02:00
Glenn Jocher 7c2691f9dc
FROM nvcr.io/nvidia/pytorch:22.05-py3 (#8162) 2022-06-09 22:06:33 +02:00
Glenn Jocher 6e4661773e
AutoBatch checks against failed solutions (#8159)
* AutoBatch checks against failed solutions

@kalenmike this is a simple improvement to AutoBatch to verify that returned solutions have not already failed, i.e. return batch-size 8 when 8 already produced CUDA out of memory.

This is a halfway fix until I can implement a 'final solution' that will actively verify the solved-for batch size rather than passively assume it works.

* Update autobatch.py

* Update autobatch.py
2022-06-09 17:15:49 +02:00
HRan2004 cf298fb72f
fix(utils): missing edge when resample segments (#8092)
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-06-09 10:52:05 +02:00
Glenn Jocher 47233e1698
Improved dataset error introspection (#8091)
* Improved dataset error introspection

Intended to help https://github.com/ultralytics/yolov5/issues/8090

* Update general.py
2022-06-03 12:45:51 +02:00
Glenn Jocher 7cef03dddd
Fix torch `long` to `float` tensor on HUB macOS (#8067) 2022-06-01 17:34:46 +02:00
Glenn Jocher 632559b1e6
Add Dockerfile descriptions (#8031) 2022-05-29 20:43:01 +02:00
Glenn Jocher 5580b27daf
`check_requirements()` "" Windows double quote (#8016) 2022-05-28 11:13:44 +02:00
Glenn Jocher a6e99e4d66
cURL download double quotes (#7999)
Attempt to resolve Windows issues
2022-05-26 20:37:48 +02:00
Glenn Jocher cd71aa3515
`check_requirements()` Windows fix (#7997) 2022-05-26 19:01:46 +02:00
Glenn Jocher 945579699a
Remove `formats` variable to avoid `pd` conflict (#7993)
* Remove `formats` variable to avoid `pd` conflict

* Update export.py
2022-05-26 16:07:58 +02:00
Glenn Jocher d07f9ce0ea
AMP check improvements backup YOLOv5n pretrained (#7959)
* Reduce AMP check to detections verification

More robust and faster

* Update general.py

* Update general.py
2022-05-24 15:33:35 +02:00
Glenn Jocher 68ff6c9c08
Increase NMS fixed time limit 300ms + 30ms/img (#7957)
* Increase NMS fixed time limit to 200ms

* Update general.py
2022-05-24 14:11:03 +02:00
Glenn Jocher b5ebd47d64
Increase NMS time limit to 50 ms/img (#7956) 2022-05-24 13:58:10 +02:00
Glenn Jocher c215878f11
YOLOv5 Apple Metal Performance Shader (MPS) support (#7878)
* Apple Metal Performance Shader (MPS) device support

Following https://pytorch.org/blog/introducing-accelerated-pytorch-training-on-mac/

Should work with Apple M1 devices with PyTorch nightly installed with command `--device mps`. Usage examples:
```bash
python train.py --device mps
python detect.py --device mps
python val.py --device mps
```

* Update device strategy to fix MPS issue
2022-05-24 13:34:32 +02:00
Glenn Jocher 541a5b72bb
Windows `check_file()` fix (#7938)
Resolves Ultralytics HUB CI errors.
2022-05-23 16:15:38 +02:00
Glenn Jocher 9b4e05439c
Fix AMP check tolerance (#7937)
Adjust to 5%, fixes failing Colab AMP check with V100 (1.5% different) with 200% safety margin.
2022-05-23 15:57:16 +02:00
Glenn Jocher cf3fb58522
AMP check image download backup (#7936)
Resolves https://github.com/ultralytics/yolov5/discussions/7931
2022-05-23 15:31:54 +02:00
Glenn Jocher cee5959c74
Code refactor (#7923)
* Code refactor for general.py

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

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

* Update restapi.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-05-22 15:24:08 +02:00
Glenn Jocher eb1217f3ac
Add PyTorch AMP check (#7917)
* Add PyTorch AMP check

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

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

* Cleanup

* Cleanup

* Cleanup

* Robust for DDP

* Fixes

* Add amp enabled boolean to check_train_batch_size

* Simplify

* space to prefix

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-05-22 13:41:18 +02:00
Glenn Jocher 15057d2a34
Add `check_yaml()` to benchmarks.py (#7916)
Locate file in subdirectories.
2022-05-21 19:39:19 +02:00
Glenn Jocher a9a92aec5c
`cv2.resize` interpolation fix (#7903)
Fix for https://github.com/ultralytics/yolov5/discussions/7901
2022-05-20 12:59:05 +02:00
Anton Lebedev 43569d53da
Bug fix mAP0.5-0.95 (#6787)
* Improve mAP0.5-0.95

Two changes provided
1. Added limit on the maximum number of detections for each image likewise pycocotools
2. Rework process_batch function

Changes #2 solved issue #4251
I also independently encountered the problem described in issue #4251 that the values for the same thresholds do not match when changing the limits in the torch.linspace function.
These changes solve this problem.

Currently during validation yolov5x.pt model the following results were obtained:
from yolov5 validation
               Class     Images     Labels          P          R     mAP@.5 mAP@.5:.95: 100%|██████████| 157/157 [01:07<00:00,  2.33it/s]
                 all       5000      36335      0.743      0.626      0.682      0.506
from pycocotools
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.505
 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.685

These results are very close, although not completely pass the competition issue #2258.
I think it's problem with false positive bboxes matched ignored criteria, but this is not actual for custom datasets and does not require an additional solution.

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

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

* Remove line to retain pycocotools results

* Update val.py

* Update val.py

* Remove to device op

* Higher precision int conversion

* Update val.py

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-05-20 11:33:10 +02:00
xylieong f43cd53d44
Added Windows cmd to count GPU devices (#7891)
* Added Windows cmd to count GPU devices

* Cleanup

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-05-19 15:48:44 +02:00
Glenn Jocher 9a7f289eed
Update Dockerfile-arm64 (#7860)
* Update Dockerfile-arm64

* Update docker.yml
2022-05-17 16:35:12 +02:00
Glenn Jocher 91c82d8f92
Update Dockerfile-cpu install `libpython3.8-dev` (#7857)
* Update Dockerfile-cpu install `libpython3.8-dev`

Fix OpenVINO export

* Update Dockerfile-arm64
2022-05-17 15:09:10 +02:00
Glenn Jocher d7d2b10f69
Create docker.yml (#7856)
* Create docker.yml

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

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

* Update docker.yml

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

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

* Update docker.yml

* Update docker.yml

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

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

* Cleanup

* Cleanup2

* [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-17 14:11:38 +02:00
Glenn Jocher 614ef110b3
Update Dockerfile `--no-install-recommends` (#7846)
* Update Dockerfile-cpu `--no-install-recommends`

Per https://ubuntu.com/blog/we-reduced-our-docker-images-by-60-with-no-install-recommends

* Update Dockerfile-M1

* Update Dockerfile

* Update Dockerfile-M1

* Update Dockerfile-cpu
2022-05-17 01:29:23 +02:00
Glenn Jocher f00071416f
Refactor collections and fstrings (#7821)
* Update torch_utils.py

* Additional code refactoring

* tuples to sets

* Cleanup
2022-05-15 16:38:26 +02:00
Glenn Jocher 3356f2609c
Add Python version output (#7814) 2022-05-14 18:30:47 +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
Glenn Jocher 9d8ed37df7
Rename `utils/datasets.py` > `utils/dataloaders.py` (#7799) 2022-05-13 14:34:16 +02:00
Yonghye Kwon 5a1ef32553
Add random interpolation method augmentation (#6826)
* add random_interpolation option to make model robust to interpolation methods

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

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

* Fix precommit error

* Update augmentations.py

* Update augmentations.py

* Update augmentations.py

* Update datasets.py

* Update datasets.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-05-13 14:26:11 +02:00
Glenn Jocher 5e077bfd39
Add Dockerfile-M1 (#7720)
* Add Dockerfile-M1

* Update

* Update

* Update Dockerfile-M1
2022-05-13 14:15:21 +02:00
Glenn Jocher 8a4175cde0
Add smoothing to curve plots and max F1 index (#7798)
@sergiossm
2022-05-13 13:53:21 +02:00
Glenn Jocher f3fecf94a9
Pin downloads to release version (#7790)
* Pin downloads to release version

Fixes a release version to avoid forward-compatibility issues in future releases.

* [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-13 00:24:53 +02:00
Cristi Fati 4870064629
Ability to dowlnoad older assets (#7767)
* Ability to dowlnoad older assets

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

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

* Cleanup

* Cleanup2

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-05-11 12:52:10 +02:00
Glenn Jocher aa7a0e91b1
Update `on_train_end` callback (#7716) 2022-05-05 21:25:13 -07:00
Glenn Jocher d4ea61e043
FROM nvcr.io/nvidia/pytorch:22.04-py3 (#7680)
* FROM nvcr.io/nvidia/pytorch:22.04-py3

* Update Docker

* Update Docker

* Update Docker

* Update Docker

* Update TRT auto-install

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

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

* Cleanup

* Cleanup

* Cleanup cpu

* Cleanup cpu

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-05-03 13:47:30 -07:00
Glenn Jocher e305aba686
Pin Docker-cpu `FROM ubuntu:20.04` (#7677) 2022-05-02 23:27:24 -07:00
Glenn Jocher c4862fcd31
Update Dockerfile-cpu to force python3.9 (#7675)
* Update

* Update

* Do not install torch

* Pillow>9.1

* Update Dockerfile-cpu

* Update Dockerfile-cpu

* Update Dockerfile-cpu

* Update Dockerfile-cpu

* Update Dockerfile-cpu

* Update Dockerfile-cpu

* Update Dockerfile-cpu

* Update Dockerfile-cpu

* Update Dockerfile-cpu

* Update Dockerfile

* fix emoji

* reduce scipy

* add libpython3.9

* Update Dockerfile
2022-05-02 20:53:02 -07:00
SylvanDing 5743deb9df
Update plot.py (#7654)
fix bug in issue #7650
2022-04-30 20:01:21 -07:00
Glenn Jocher 1a3ecb8b38
`increment_path()` robustness improvements (#7628)
Improved robustness to filename edge cases like `data/images/zidane.23.jpg` that currently fail. May resolve https://github.com/ultralytics/yolov5/issues/7432
2022-04-28 14:00:43 -07:00
Glenn Jocher b53917de8d
Remove `tqdm.auto` (#7599) 2022-04-26 15:00:01 -07:00
Glenn Jocher e54e758cfb
Add PyTorch-only benchmark arg (#7564)
Usage:
```
python utils/benchmarks.py --weights yolov5s.pt --img 640 --pt-only
```
2022-04-24 20:03:23 -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 404b4fefbe
Update restapi.py (#7309)
* Update restapi.py

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

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

* Update restapi.py

* Update restapi.py

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

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

* Update restapi.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-04-22 16:19:21 -07:00
Glenn Jocher 3a89377c04
Improve availability of YOLOv5 in Russia (#7545)
* Add redundant weights download mirrors

This PR seeks to improve access worldwide to YOLOv5 weights. Universal access to AI for all is our core value, and we are against any censorship or restriction efforts.

I've uploaded the official YOLOv5 v6.1 weights to a primary backup bucket on GCP and to secondary backup on Google Drive at https://drive.google.com/drive/folders/1EFQTEUeXWSFww0luse2jB9M1QNZQGwNl. Autodownload with try the first two locations (GitHuB release assets and GCP bucket), and point users to the Google Drive folder if the first two fail.

* [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-04-22 16:07:33 -07:00
Ayush Chaurasia 4cac1cfc8f
Add `--noplots` flag to suppress figures and images logging (#7534)
* support nomedia

* support nomedia for validation

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

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

* Update train.py

* Revert no plot evolve

evolve plots do not contain any images

* Revert plot_results

contains no media

* Update wandb_utils.py

* sync-bn cleanup

* Cleanup

* Rename nomedia -> noplots

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-04-22 15:04:08 -07:00
Glenn Jocher f62609eb52
Update check_requirements() with `cmds=()` argument (#7543) 2022-04-22 14:31:05 -07:00
Powercube7 4b284a12c7
Update downloads.py current release (#7541)
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-04-22 13:44:54 -07:00
Zengyf-CVer c264795f50
Add mdformat to precommit checks and update other version (#7529)
* Update .pre-commit-config.yaml

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

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

* Update .pre-commit-config.yaml

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

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

* Update CONTRIBUTING.md

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

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

* Update README.md

* Update README.md

* Update README.md

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-04-22 13:36:27 -07:00
Glenn Jocher b804b36bc4
Add Docker `--file` argument to build (#7527) 2022-04-21 20:31:26 -07:00
Glenn Jocher 918d7b2b3f
Refactor Dockerfiles to `utils/docker` (#7510)
* Refactor Docker files

* Refactor Docker files

* Update Dockerfile
2022-04-20 14:23:55 -07:00
Joseph Kocherhans b77c8d9d72
Added `YOLOv5_AUTOINSTALL` environment variable (#7505)
* Added a way to skip dependency auto-installation.

Setting the environment variable `YOLOv5_AUTOINSTALL=False` will
skip installing any missing dependencies as if the user had passed
`install=False` to `check_requirements`.

* Cleanup

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-04-20 12:08:22 -07:00
Glenn Jocher ab5b917494
`check_fonts()` download to `CONFIG_DIR` fix (#7489)
Follows https://github.com/ultralytics/yolov5/pull/7488. Correct bug where fonts were downloading to current working directory rather than global CONFIG_DIR
2022-04-19 17:50:02 -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
Glenn Jocher c9a3b14a74
Disable `pbar` for DDP ranks > 0 (#7440) 2022-04-16 15:12:38 +02:00
Glenn Jocher 014acde79d
Update `git_describe()` (#7402)
* Update `git_describe()`

Add .git path check to avoid `fatal: not a git repository (or any of the parent directories): .git` printout

* Update general.py
2022-04-12 17:26:53 +02:00
Ayush Chaurasia 74aaab3312
Add version warning for wandb (#7385)
* add version warning

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

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

* Cleanup

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

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-04-12 11:46:56 +02:00
Glenn Jocher 1993efd59e
Swap `unsafe_chunk()` for `chunk()` (#7362)
Eliminates all unsafe function in YOLOv5 out of an abundance of caution.
2022-04-10 13:53:28 +02:00
Glenn Jocher 406ee528f0
Loss and IoU speed improvements (#7361)
* Loss speed improvements

* bbox_iou speed improvements

* bbox_ioa speed improvements

* box_iou speed improvements

* box_iou speed improvements
2022-04-10 13:46:07 +02:00
Glenn Jocher 698a5d7f26
Add `python benchmarks.py --test` for export-only (#7350)
* Test exports

* Fix precommit
2022-04-09 01:32:16 +02:00
Glenn Jocher 446e6f563a
Rename 'MacOS' to 'macOS' (#7349) 2022-04-08 23:05:15 +02:00
Glenn Jocher 5f941a84ef
Print dataset scan only `if RANK in (-1, 0)` (#7337)
* Print dataset scan only `if RANK in (-1, 0)`

* [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-04-07 16:44:08 +02:00
Glenn Jocher 676e10cf1a
Simplify callbacks.py return (#7333)
* Simplify callbacks.py return

* Indent args (pytorch convention)

* [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-04-07 16:15:01 +02:00
Nick Martin a88a81469a
Copy wandb param dict before training to avoid overwrites (#7317)
* Copy wandb param dict before training to avoid overwrites.

Copy the hyperparameter dict retrieved from wandb configuration before passing it to `train()`. Training overwrites parameters in the dictionary (eg scaling obj/box/cls gains), which causes the values reported in wandb to not match the input values. This is confusing as it makes it hard to reproduce a run, and also throws off wandb's Bayesian sweep algorithm.

* Cleanup

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-04-06 18:35:33 +02:00
Glenn Jocher 245d6459a9
Add callbacks (#7315)
* Add `on_train_start()` callback

* Update

* Update
2022-04-06 17:23:34 +02:00
Glenn Jocher 32661f75ac
Add `retry=3` to `download()` (#7313)
* Add `retry=3` to `download()`

* Update general.py

* Update general.py

* Update general.py

* Update VOC.yaml

* Update VisDrone.yaml
2022-04-06 13:12:41 +02:00
Glenn Jocher f735458987
Use `tqdm.auto` (#7311) 2022-04-06 12:20:24 +02:00
Max Strobel 741fac815e
fix: disable usage of root logger (#7296)
* fix: disable usage of root logger

`logging.basicConfig` configures Python's root logger. This prohibits
fine control of logging, overwrites logging configuration done outside
the package, and is not best practice. Instead, the used logger is now
configured directly, and the root logger is untouched.

Example:
    If yolov5 is used as part of another project with some sophisticated
    logging, the internal `logging.basicConfig` call overwrites all the
    external configuration.

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

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

* Update general.py

* Update general.py

* Comment kaggle

* Uncomment kaggle

Co-authored-by: Maximilian Strobel <Maximilian.Strobel@infineon.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-04-05 17:38:13 +02:00
Glenn Jocher 5f97001ed4
Context manager `open(file) as f` fixes (#7289)
* Flask context manager `open()` fix

* Additional read context manager fixes
2022-04-05 12:54:25 +02:00
Glenn Jocher 2181ef371e
Update `cv2.imread()` patch with flags argument (#7287) 2022-04-05 11:49:32 +02:00
pre-commit-ci[bot] 7882950577
[pre-commit.ci] pre-commit suggestions (#7279)
* [pre-commit.ci] pre-commit suggestions

updates:
- [github.com/asottile/pyupgrade: v2.31.0 → v2.31.1](https://github.com/asottile/pyupgrade/compare/v2.31.0...v2.31.1)
- [github.com/pre-commit/mirrors-yapf: v0.31.0 → v0.32.0](https://github.com/pre-commit/mirrors-yapf/compare/v0.31.0...v0.32.0)

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

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

* Update yolo.py

* Update activations.py

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

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

* Update activations.py

* Update tf.py

* Update tf.py

* [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>
2022-04-04 22:47:00 +02:00
Glenn Jocher 779efbb9ca Update 2022-04-03 21:21:55 +02:00
Glenn Jocher ffcbd8ca97
Export with official `nn.SiLU()` (#7256)
* Update

* Update time_limit
2022-04-03 18:45:05 +02:00
Zengyf-CVer dda669a12c
Fix Flask REST API (#7210)
* Update restapi.py

* Update restapi.py

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

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

* Cleanup

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

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

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-04-03 13:19:26 +02:00
Glenn Jocher a19406b39d
Update minimum Python>=3.7.0 (#7247) 2022-04-02 15:05:00 +02:00
Glenn Jocher 37675e110f
Fix `www.youtube.com` hostname (#7242)
* Fix `www.youtube.com` hostname

* Update datasets.py
2022-04-01 21:38:49 +02:00
Glenn Jocher 2c3221844b
CLI `fire` prep updates (#7229)
* CLI fire prep updates

* revert unintentional TF export change
2022-03-31 17:11:43 +02: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
Glenn Jocher 3373aab56c
NMS unused variable fix (#7161)
* NMS unused variable fix

* Update general.py
2022-03-26 16:52:58 +01:00
Glenn Jocher 26bfd44465
Adjust NMS time limit warning to batch size (#7156) 2022-03-26 11:45:28 +01:00
Zengyf-CVer a4c661873f
Fix `detect.py --view-img` for non-ASCII paths (#7093)
* Update detect.py

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

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

* Update general.py

* Update detect.py

* Update general.py

* Update general.py

* Update general.py

* Update general.py

* Update general.py

* Update general.py

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

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

* Update general.py

* 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:40:55 +01:00
RcINS d115bbf509
Fix `cv2.imwrite` on non-ASCII paths (#7139)
* 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
yeshanliu bc3ed957ce
`np.fromfile()` Chinese image paths fix (#6979)
* 🎉 🆕 now can read Chinese image path. 

use "cv2.imdecode(np.fromfile(f, np.uint8), cv2.IMREAD_COLOR)" instead of "cv2.imread(f)" for Chinese image path.

* Update datasets.py

* Update __init__.py

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-03-23 15:35:15 +01:00
Glenn Jocher c3ae4e4af6
Multi-threaded VisDrone and VOC downloads (#7108)
* Multi-threaded VOC download

* Update VOC.yaml

* Update

* Update general.py

* Update general.py
2022-03-23 01:19:37 +01:00
Glenn Jocher 6134ec5d94
Model summary `pathlib` fix (#7104)
Stems not working correctly for YOLOv5l with current .rstrip() implementation. After fix:
```
YOLOv5l summary: 468 layers, 46563709 parameters, 46563709 gradients, 109.3 GFLOPs
```
2022-03-22 20:05:07 +01:00
Glenn Jocher ee0b3b2a95
Update benchmarks significant digits (#7103) 2022-03-22 18:02:35 +01:00
Glenn Jocher 05aae17333
`torch.split()` 1.7.0 compatibility fix (#7102)
* Update loss.py

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

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

* Update loss.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-03-22 17:36:05 +01:00
Glenn Jocher a600baed8e
Update model summary to display model name (#7101) 2022-03-22 15:41:19 +01:00
Glenn Jocher a2d617ece9
Update loss for FP16 `tobj` (#7088) 2022-03-21 19:18:34 +01:00
Glenn Jocher 6f128031d0
Update loss.py with `if self.gr < 1:` (#7087)
* Update loss.py with `if self.gr < 1:`

* Update loss.py
2022-03-21 18:35:36 +01:00
Glenn Jocher 9cd89b75cc
Fix2 `check_anchor_order()` in pixel-space not grid-space (#7067)
Follows https://github.com/ultralytics/yolov5/pull/7060 which provided only a partial solution to this issue. #7060 resolved occurences in yolo.py, this applies the same fix in autoanchor.py.
2022-03-20 18:55:13 +01:00
Glenn Jocher 178c109576
Add non-zero `da` `check_anchor_order()` condition (#7066) 2022-03-20 18:37:27 +01:00
Glenn Jocher 9e75cbf4c1
Update __init__.py (#7065) 2022-03-20 18:17:04 +01:00
Glenn Jocher e278fd63ec
Update W&B message to `LOGGER.info()` (#7064) 2022-03-20 18:15:22 +01:00
Glenn Jocher f327eee614
Fix `check_anchor_order()` in pixel-space not grid-space (#7060)
* Update `check_anchor_order()`

Use mean area per output layer for added stability.

* Check in pixel-space not grid-space fix
2022-03-20 16:27:51 +01: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
Glenn Jocher 9f4d11379b
Fix incomplete URL substring sanitation (#7056)
Resolves code scanning alert in https://github.com/ultralytics/yolov5/issues/7055
2022-03-20 14:18:05 +01:00
Glenn Jocher b0ba101ac0
`ComputeLoss()` indexing/speed improvements (#7048)
* device as class attribute

* Update loss.py

* Update loss.py

* improve zeros

* tensor split
2022-03-20 01:04:48 +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 3f634d43c8
Conditional `Timeout()` by OS (disable on Windows) (#7013)
* Conditional `Timeout()` by OS (disable on Windows)

* Update general.py
2022-03-16 15:33:54 +01:00
Glenn Jocher c09fb2aa95
Update TQDM bar format (#6988) 2022-03-15 16:32:56 +01:00
Glenn Jocher 932dc78496
YOLOv5 Export Benchmarks for GPU (#6963)
* Add benchmarks.py GPU support

* Updates

* Updates

* Updates

* Updates

* Add --half

* Add TRT requirements

* Cleanup

* Add TF to warmup types

* Update export.py

* Update export.py

* Update benchmarks.py
2022-03-14 15:07:13 +01:00
Glenn Jocher caf7ad0500
Allow 3-point segments (#6938)
May resolve https://github.com/ultralytics/yolov5/issues/6931
2022-03-10 18:41:47 +01:00
Glenn Jocher 6dd82c0252
Move `git_describe()` to general.py (#6918)
* Move `git_describe()` to general.py

* Move `git_describe()` to general.py
2022-03-09 18:22:53 +01:00
Glenn Jocher e6e36aac10
Update bytes to GB with bitshift (#6886) 2022-03-07 19:26:37 +01:00
Glenn Jocher 4728840745
Update `--cache disk` deprecate `*_npy/` dirs (#6876)
* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Cleanup

* Cleanup
2022-03-06 16:16:17 +01:00
Glenn Jocher 8a66ebad44
Add `*.ts` to `VID_FORMATS` (#6859) 2022-03-04 14:10:13 +01:00
Glenn Jocher 601dbb83f0
AutoAnchor improved initialization robustness (#6854)
* Update AutoAnchor

* Update AutoAnchor

* [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-03-04 10:32:18 +01:00
Louis Combaldieu bcc92e2169
Update sweep.yaml (#6825)
* Update sweep.yaml

Changed focal loss gamma search range between 1 and 4

* Update sweep.yaml

lowered the min value to match default
2022-03-04 09:39:23 +01:00
Glenn Jocher 63ddb6f0d0
Update autoanchor.py (#6794)
* Update autoanchor.py

* Update autoanchor.py
2022-02-26 19:15:12 +01:00
Glenn Jocher 0f819919ad
Update EMA decay `tau` (#6769)
* Update EMA

* Update EMA

* ratio invert

* fix ratio invert

* fix2 ratio invert

* warmup iterations to 100

* ema_k

* implement tau

* implement tau
2022-02-25 12:33:09 +01:00
Glenn Jocher c161557563
Default `OMP_NUM_THREADS=8` (#6770) 2022-02-25 00:09:14 +01:00
Glenn Jocher 2692e67c5f
Updated VOC hyperparameters (#6732)
* Update hyps

* Update hyp.VOC.yaml

* Update pathlib

* Update hyps

* Update hyps

* Update hyps

* Update hyps
2022-02-22 12:11:18 +01:00
Glenn Jocher c43f135571
Update `nw` to `max(nd, 1)` (#6714) 2022-02-20 21:47:46 +01:00
Glenn Jocher 4de8b24881
Suppress `torch` AMP-CPU warnings (#6706)
This is a torch bug, but they seem unable or unwilling to fix it so I'm creating a suppression in YOLOv5. 

Resolves https://github.com/ultralytics/yolov5/issues/6692
2022-02-19 16:48:33 +01:00
Samuel Yvon 0365379016
Fix floating point in number of workers `nw` (#6701)
Integer division by a float yields a (rounded) float. This causes
the dataloader to crash when creating a range.
2022-02-18 21:06:21 +01:00
Glenn Jocher 2e5c67e537
Robust `scipy.cluster.vq.kmeans` too few points (#6668)
* Handle `scipy.cluster.vq.kmeans` too few points

Resolves #6664

* Update autoanchor.py

* Cleanup
2022-02-17 12:55:03 +01:00
Glenn Jocher 1ff43702a8
Validate with 2x `--workers` single-GPU/CPU fix (#6659)
Fix for #6658 for single-GPU and CPU training use cases
2022-02-16 14:50:37 +01:00
Glenn Jocher 6769021901
Validate with 2x `--workers` (#6658) 2022-02-16 14:44:44 +01:00
imyhxy ca0a00784d
Fixed wandb logger KeyError (#6637) 2022-02-14 17:08:36 +01:00
Glenn Jocher 538930023c
Fix ConfusionMatrix scale `vmin=0.0` (#6638)
Fix attempt for https://github.com/ultralytics/yolov5/issues/6626
2022-02-14 14:54:55 +01:00
Glenn Jocher a45e472358
YOLOv5 Export Benchmarks (#6613)
* Add benchmarks.py

* Update

* Add requirements

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* dataset autodownload from root

* Update

* Redirect to /dev/null

* sudo --help

* Cleanup

* Add exports pd df

* Updates

* Updates

* Updates

* Cleanup

* dir handling fix

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

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

* Cleanup

* Cleanup2

* Cleanup3

* Cleanup model_type

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-02-12 16:05:43 +01:00
Ayush Chaurasia 96d8f86085
W&B: don't log media in evolve (#6617) 2022-02-12 13:04:50 +01:00
Ayush Chaurasia 51f7750aad
W&B: Improve resume stability (#6611)
* log best.pt metrics at train end

* update

* Update __init__.py

* flush callbacks when using evolve

* remember batch size on resuming

* Update train.py

* improve stability of resume

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-02-12 13:03:09 +01:00
Glenn Jocher b40bdd6b2d
YouTube dependency fix `youtube_dl==2020.12.2` (#6612)
Per https://github.com/ultralytics/yolov5/issues/5860#issuecomment-1035320018 by @hdnh2006
2022-02-11 13:46:20 +01:00
or-toledano cb2ad9f685
Fix `ROOT / data` when running W&B `log_dataset()` (#6606)
* Fix missing data folder when running log_dataset

* Use ROOT/'data'

* PEP8 whitespace
2022-02-10 16:17:47 +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 364b7c5111
Fix YouTube dislike button bug in `pafy` package (#6603)
Per https://github.com/ultralytics/yolov5/issues/6583#issuecomment-1034421945 by @alicera
2022-02-10 13:13:44 +01:00
Glenn Jocher 9c513ca629
Add `DATASETS_DIR` global in general.py (#6578) 2022-02-08 22:20:44 +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
Glenn Jocher b57abb17f2
Move trainloader functions to class methods (#6559)
* Move trainloader functions to class methods

* results = ThreadPool(NUM_THREADS).imap(self.load_image, range(n))

* Cleanup
2022-02-07 18:59:26 +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 6445a8137e
Resolve dataset paths (#6489) 2022-02-01 15:54:51 +01:00
Glenn Jocher d8b5beb0b0
Fix2 `select_device()` for Multi-GPU (#6461)
* Fix2 select_device() for Multi-GPU

* Cleanup

* Cleanup

* Simplify error message

* Improve assert

* Update torch_utils.py
2022-01-28 08:18:01 +01:00
Glenn Jocher 856d4e5733
Fix `select_device()` for Multi-GPU (#6434)
* Fix `select_device()` for Multi-GPU

Possible fix for https://github.com/ultralytics/yolov5/issues/6431

* Update torch_utils.py

* Update torch_utils.py

* Update torch_utils.py

* Update torch_utils.py

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update
2022-01-26 23:47:00 +01:00
Glenn Jocher fe7de6a82d
Revert "Remove `dataset_stats()` autodownload capability (#6303)" (#6442)
This reverts commit 3119b2f27c.
2022-01-26 19:10:59 +01:00
toschi23 3b7ac28ed1
Add `*.asf` video support (#6436) 2022-01-26 14:26:02 +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
Jonathan Samelson ed9bac8392
Rename logger from 'utils.logger' to 'yolov5' (#6421)
* Gave a more explicit name to the logger

* Cleanup

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-01-25 07:21:06 -08:00
Glenn Jocher 482af479c0
Add `detect.py` GIF video inference (#6410)
* Add detect.py GIF video inference

* Cleanup
2022-01-24 13:11:11 -08:00
Matthias 8efe97719c
Add `stop_training=False` flag to callbacks (#6365)
* New flag 'stop_training' in util.callbacks.Callbacks class to prematurely stop training from callback handler

* Removed most of the new  checks, leaving only the one after calling 'on_train_batch_end'

* Cleanup

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-01-22 16:37:21 -10:00
Ayush Chaurasia 9bcc32a5bf
Flush callbacks when on `--evolve` (#6374)
* log best.pt metrics at train end

* update

* Update __init__.py

* flush callbacks when using evolve

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-01-20 13:22:47 -10:00
sitecao e1893c894a
`DEVICE_COUNT` instead of `WORLD_SIZE` to calculate `nw` (#6324) 2022-01-20 13:06:26 -10:00
imyhxy 4e841b9b16
Reuse `de_parallel()` rather than `is_parallel()` (#6354) 2022-01-20 10:50:17 -10:00
johnk2hawaii 9708cf56ea
New environment variable `VERBOSE` (#6353)
New environment variable `VERBOSE`
2022-01-19 14:32:19 -10:00
Glenn Jocher fd55271c04
Console corrupted -> corrupt (#6338)
* Console corrupted -> corrupt 

Minor style changes.

* Update export.py
2022-01-18 10:49:26 -10:00
Glenn Jocher 3119b2f27c
Remove `dataset_stats()` autodownload capability (#6303)
* Remove `dataset_stats()` autodownload capability

@kalenmike security update per Slack convo

* Update datasets.py
2022-01-18 10:04:49 -10:00
Glenn Jocher 436ffc417a
`select_device()` cleanup (#6302)
* `select_device()` cleanup

* Update torch_utils.py

* Update torch_utils.py

* Update torch_utils.py

* Update torch_utils.py

* Update torch_utils.py
2022-01-14 15:48:15 -10:00
Henry a1a9c6884c
Fixing bug multi-gpu training (#6299)
* Fixing bug multi-gpu training

This solves this issue: https://github.com/ultralytics/yolov5/issues/6297#issue-1103853348

* Update torch_utils.py for pep8
2022-01-14 10:11:06 -10:00
Glenn Jocher e7bf38277f
Fix `device` count check (#6290)
* Fix device count check()

* Update torch_utils.py

* Update torch_utils.py

* Update hubconf.py
2022-01-13 21:23:03 -10:00
Glenn Jocher af001349e4
Add `is_kaggle()` function (#6285)
* Add `is_kaggle()` function

Return True if environment is Kaggle Notebook.

* Remove root loggers only if is_kaggle() == True

* Update general.py
2022-01-13 12:39:42 -10:00
Glenn Jocher 9e9219fe17
Fix `nan`-robust stream FPS (#6198)
Fix for Webcam stop working suddenly (Issue #6197)
2022-01-04 19:32:42 -08:00
Glenn Jocher b4a29b5a8d
Update NMS `max_wh=7680` for 8k images (#6178) 2022-01-03 10:54:52 -08:00
Chen Gen affa284352
Refactor/reduce G/C/D/IoU `if: else` statements (#6087)
* Refactor the code to reduece else

* Update metrics.py

* Cleanup

Co-authored-by: Cmos <gen.chen@ubisoft.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-12-30 13:59:29 -08:00
Awsaf 7b6938d5b5
Log best results (#6085)
* log best result in summary

* comment added

* add space for `flake8`

* log `best/epoch`

* fix `dimension` for epoch

ValueError: all the input arrays must have same number of dimensions

* log `best/` in `utils.logger.__init__`

* fix pre-commit

1. missing whitespace around operator
2.  over-indented
2021-12-30 13:47:53 -08:00
Ayush Chaurasia 9155eb8641
W&B: Log best results after training ends (#6120)
* log best.pt metrics at train end

* update

* Update __init__.py

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-12-30 11:43:19 -08:00
Ayush Chaurasia db6ec66a60
W&B: track batch size after autobatch (#6039)
* track batch size after autobatch

* remove redundant import

* Update __init__.py

* Update __init__.py

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-12-23 14:23:50 +01:00
JieLi afa5cfb0f8
Reduce G/D/CIoU logic operations (#6074)
Consider that the default value is CIOU,adjust the order of judgment could reduce the number of judgments.
And “elif CIoU:” didn't need 'if'.

Co-authored-by: 李杰 <360751194@qq.comqq.com>
2021-12-23 11:53:00 +01:00
Glenn Jocher b8a4babd60
Simplify `set_logging()` indexing (#6042) 2021-12-20 17:42:52 +01:00
Glenn Jocher 0db9d5b6a2
Kaggle `LOGGER` fix (#6041) 2021-12-20 17:30:46 +01:00
Glenn Jocher 407a905747
Check TensorRT>=8.0.0 version (#6021)
* Check TensorRT>=8.0.0 version

* [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-12-17 14:59:46 +01:00
Glenn Jocher da9a1b719b
Allow `--weights URL` (#5991) 2021-12-15 15:27:08 +01:00
Mrinal Jain b7d18f3636
Increase `ar_thr` from 20 to 100 for better detection on slender (high aspect ratio) objects (#5556)
* Making `ar_thr` available as a hyperparameter

* Disabling ar_thr as hyperparameter and computing from the dataset instead

* Fixing bug in ar_thr computation

* Fix `ar_thr` to 100
2021-12-15 14:42:23 +01:00
Glenn Jocher c9a46a60e0
Update callbacks.py with `__init__()` (#5979)
Add __init__() function.
2021-12-14 15:47:49 +01:00
Glenn Jocher 8f875d93a2
Refactor NUM_THREADS (#5954) 2021-12-11 14:32:18 +01:00
iumyx2612 a42af30d8a
Update `strip_optimizer()` (#5949)
Replace 'training_result' with 'best_fitness' in strip_optimizer() to match key with ckpt from train.py
2021-12-10 18:06:27 +01:00
Felix You c45f9f678d
Make `select_device()` robust to `batch_size=-1` (#5940)
* Find out a bug. When set batch_size = -1 to use the autobatch.

reproduce:

* Fix type conflict

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-12-10 15:27:20 +01:00
Glenn Jocher c77a5a84e3
Absolute '/content/sample_data' (#5922) 2021-12-08 17:31:31 +01:00
Glenn Jocher a3d5f1d3e3
Revert "Update `plot_lr_scheduler()` (#5864)" (#5920)
This reverts commit 360eec6910.
2021-12-08 16:46:24 +01:00
Glenn Jocher 7d56d45124
Add hardware checks to `notebook_init()` (#5919)
* Update notebook

* Update notebook

* update string

* update string

* Updates

* Updates

* Updates

* check both ipython and psutil

* remove sample_data if is_colab

* 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>
2021-12-08 14:57:03 +01:00
Ayush Chaurasia 3f152e5807
Update wandb_utils.py (#5908) 2021-12-07 16:09:11 +01:00
Glenn Jocher 7bf04d9bbf
`AutoShape()` models as `DetectMultiBackend()` instances (#5845)
* Update AutoShape()

* autodownload ONNX

* Cleanup

* Finish updates

* Add Usage

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* fix device

* Update hubconf.py

* Update common.py

* smart param selection

* autodownload all formats

* autopad only pytorch models

* new_shape edits

* stride tensor fix

* Cleanup
2021-12-04 15:00:07 +01:00
Glenn Jocher d885799c71
Update `nl` after `cutout()` (#5873) 2021-12-03 15:28:14 +01:00
Can 360eec6910
Update `plot_lr_scheduler()` (#5864)
shallow copy modify originals
2021-12-03 13:37:45 +01:00
Glenn Jocher 00e308f7be
Update TorchScript suffix to `*.torchscript` (#5856) 2021-12-02 16:06:45 +01:00
gggmt 1679aacdc7
Update `LoadImages` `ret_val=False` handling (#5852)
Video errors may occur.
2021-12-02 10:57:39 +01:00
Yu Zhang e8f8f2b903
Avoid inplace modifying`imgs` in `LoadStreams` (#5850)
When OpenCV retrieving image fail, original code would modify source images **inplace**, which may result in plotting bounding boxes on a black image. That is, before inference, source image `im0s[i]` is OK, but after inference before `Process predictions`,  `im0s[i]` may have been changed.
2021-12-02 10:51:19 +01:00
Glenn Jocher bc484579d7
Handle non-TTY `wandb.errors.UsageError` (#5839)
* `try: except (..., wandb.errors.UsageError)`

* bug fix
2021-12-01 15:38:02 +01:00
Glenn Jocher 5ca5dd4c87
Update `dataset_stats()` to `cv2.INTER_AREA` (#5821) 2021-11-29 13:15:36 +01:00
Glenn Jocher 7c6bae0ae6
Remove NCOLS from tqdm (#5804)
* Remove NCOLS from tqdm

* [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-26 13:37:28 +01:00
Ayush Chaurasia f2ca30a407
W&B: refactor W&B tables (#5737)
* update

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

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

* reformat

* Single-line argparser argument

* Update README.md

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

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

* Update README.md

* [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>
2021-11-25 17:19:21 +01:00
Glenn Jocher 4ca4aec46f
Do not save hyp.yaml and opt.yaml on evolve (#5775)
* Do not save hyp.yaml and opt.yaml on evolve

* Update general.py
2021-11-24 23:25:51 +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 36d12a500e
Explicitly compute TP, FP in val.py (#5727) 2021-11-20 01:04:56 +01:00
Jirka Borovec eb51ffdcac
Prune unused imports (#5711)
* prune unused imports

* [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-19 13:32:53 +01:00
Glenn Jocher 8df64a9122
`NUM_THREADS` leave at least 1 CPU free (#5706)
Updated strategy leaves at least 1 cpu free to avoid system overloads. Partially addresses https://github.com/ultralytics/yolov5/issues/5685
2021-11-18 14:53:42 +01:00
dependabot[bot] fb19561f98
Bump pip from 19.2 to 21.1 in /utils/google_app_engine (#5661)
Bumps [pip](https://github.com/pypa/pip) from 19.2 to 21.1.
- [Release notes](https://github.com/pypa/pip/releases)
- [Changelog](https://github.com/pypa/pip/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/pip/compare/19.2...21.1)

---
updated-dependencies:
- dependency-name: pip
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-15 20:10:29 +01:00
Ayush Chaurasia 540ef0dd30
W&B refactor, handle exceptions, CI example (#5618)
* handle exceptions| attempt CI

* update

* Pre-commit manual run

* yaml one-liner

* Update ci-testing.yml

* Comment W&B CI

Leave as example for future separate CI

* Update ci-testing.yml

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-11-14 13:26:53 +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
Werner Duvaud 09d170381c
Default DataLoader `shuffle=True` for training (#5623)
* Fix shuffle DataLoader argument

* Add shuffle argument

* Disable shuffle when rect

* Cleanup, add rect warning

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

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

* Cleanup2

* Cleanup3

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-11-13 13:07:32 +01:00
Glenn Jocher 7473f0f95d
DDP `WORLD_SIZE`-safe dataloader workers (#5631)
* WORLD_SIZE-safe workers

* Update with DDP comment
2021-11-12 14:48:55 +01:00
Glenn Jocher d5b21b1ecb
HUB dataset previews to JPEG (#5627)
@kalenmike per our convo yesterday.
2021-11-12 12:05:25 +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 69032519bc
`np.unique()` sort fix for segments (#5609)
* `np.unique()` sort fix for segments

* Update datasets.py
2021-11-11 00:15:17 +01:00
Glenn Jocher 61c50199a2
Update train, val `tqdm` to fixed width (#5367)
* Update tqdm for fixed width

* Update val.py

* Update val.py

* Try ncols= in train.py

* NCOLS

* NCOLS

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

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

* bar_format

* position 0 leave true

* exp0

* auto

* auto

* Cleanup

* Cleanup

* Cleanup

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-11-10 15:47:38 +01:00
Ayman Saleh 27bf4282d3
Fix `check_requirements()` resource warning allocation open file (#5602)
* Fix to resource warning allocation; utilize file.open within a context manager

* rename fh to f

in keeping with naming convention

Co-authored-by: Ayman Saleh <aymansaleh@Aymans-MacBook-Pro-2.local>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-11-10 12:51:30 +01:00
Glenn Jocher 7ebb5e5da6
Add `notebook_init()` to utils/__init__.py (#5488)
* Update __init__.py

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

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

* notebook_init

* notebook_init

* notebook_init

* notebook_init

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

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

* notebook_init

* Created using Colaboratory

* [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-09 23:03:19 +01:00
Glenn Jocher 3883261143
New `DetectMultiBackend()` class (#5549)
* New `DetectMultiBackend()` class

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

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

* pb to pt fix

* Cleanup

* explicit apply_classifier path

* Cleanup2

* Cleanup3

* Cleanup4

* Cleanup5

* Cleanup6

* val.py MultiBackend inference

* warmup fix

* to device fix

* pt fix

* device fix

* Val cleanup

* COCO128 URL to assets

* half fix

* detect fix

* detect fix 2

* remove half from DetectMultiBackend

* training half handling

* training half handling 2

* training half handling 3

* Cleanup

* Fix CI error

* Add torchscript _extra_files

* Add TorchScript

* Add CoreML

* CoreML cleanup

* New `DetectMultiBackend()` class

* pb to pt fix

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

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

* Cleanup

* explicit apply_classifier path

* Cleanup2

* Cleanup3

* Cleanup4

* Cleanup5

* Cleanup6

* val.py MultiBackend inference

* warmup fix

* to device fix

* pt fix

* device fix

* Val cleanup

* COCO128 URL to assets

* half fix

* detect fix

* detect fix 2

* remove half from DetectMultiBackend

* training half handling

* training half handling 2

* training half handling 3

* Cleanup

* Fix CI error

* Add torchscript _extra_files

* Add TorchScript

* Add CoreML

* CoreML cleanup

* revert default to pt

* Add Usage examples

* Cleanup val

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-11-09 16:45:02 +01:00
Glenn Jocher 79bca2bf64
`LOGGER` consolidation (#5569)
* Logger consolidation

* [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-08 16:32:15 +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
Glenn Jocher e189fa15ea
`intersect_dicts()` in hubconf.py fix (#5542) 2021-11-06 15:41:17 +01:00
Glenn Jocher cb18cac33d
Update autobatch.py (#5538)
* Update autobatch.py

* Update autobatch.py

* Update autobatch.py
2021-11-06 13:49:00 +01:00