Commit Graph

198 Commits (b0ba101ac0aa898a4e4b867d377e140af8d4258a)

Author SHA1 Message Date
Glenn Jocher c09fb2aa95
Update TQDM bar format (#6988) 2022-03-15 16:32:56 +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 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 c43f135571
Update `nw` to `max(nd, 1)` (#6714) 2022-02-20 21:47:46 +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 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
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
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 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 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 482af479c0
Add `detect.py` GIF video inference (#6410)
* Add detect.py GIF video inference

* Cleanup
2022-01-24 13:11:11 -08:00
sitecao e1893c894a
`DEVICE_COUNT` instead of `WORLD_SIZE` to calculate `nw` (#6324) 2022-01-20 13:06:26 -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 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 8f875d93a2
Refactor NUM_THREADS (#5954) 2021-12-11 14:32:18 +01:00
Glenn Jocher d885799c71
Update `nl` after `cutout()` (#5873) 2021-12-03 15:28:14 +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 5ca5dd4c87
Update `dataset_stats()` to `cv2.INTER_AREA` (#5821) 2021-11-29 13:15:36 +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
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 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 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
Jirka Borovec 0155548384
precommit: isort (#5493)
* precommit: isort

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

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

* Update isort config

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

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

* Update name

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-11-04 17:24:25 +01:00
Glenn Jocher 5866646cc8
Fix float zeros format (#5491)
* Fix float zeros format

* 255 to integer
2021-11-03 23:36:53 +01:00
Glenn Jocher 7b1f7aec46
Update `get_loggers()` (#4854)
* Update `set_logging()`

* Update export.py

* pre-commit fixes

* Update LoadImages

* Update LoadStreams

* Update print_args

* Single LOGGER definition

* yolo.py fix

Co-authored-by: pre-commit <pre-commit@example.com>
2021-11-01 18:22:13 +01:00
Jirka Borovec ed887b5976
Add pre-commit CI actions (#4982)
* define pre-commit

* add CI code

* configure

* apply pre-commit

* fstring

* apply MD

* pre-commit

* Update torch_utils.py

* Update print strings

* notes

* Cleanup code-format.yml

* Update setup.cfg

* Update .pre-commit-config.yaml

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-10-28 18:35:01 +02:00
jdfr 15e8c4c15b
take EXIF orientation tags into account when fixing corrupt images (#5270)
* take EXIF orientation tags into account when fixing corrupt images

* fit 120 char

* sort imports

* Update local exif_transpose comment

We have a local inplace version that is faster than the official as the image is not copied. AutoShape() uses this for Hub models, but here it is not important as the datasets.py usage is infrequent (AutoShape() it is applied every image).

* Update datasets.py

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-10-20 21:35:47 +02:00
jdfr db3bbdde0e
autosplit: take image files with uppercase extensions into account (#5269)
* take image files with uppercase extensions into account in autosplit

* case fix

* Refactor implementation

Removes additional variable (capital variable names are also only for global variables), and uses the same methodology as implemented earlier in datasets.py L409.

* Remove redundant rglob characters

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-10-20 19:25:33 +02:00
Glenn Jocher 991c654e81
Autofix duplicate label handling (#5210)
* Autofix duplicate labels

PR changes duplicate label handling from report error and ignore image-label pair to report warning and autofix image-label pair. 

This should fix this common issue for users and allow everyone to get started and get a model trained faster and easier than before.

* sign fix

* Cleanup

* Increment cache version

* all to any fix
2021-10-15 12:32:08 -07:00
Glenn Jocher a346926996
Add class filtering to `LoadImagesAndLabels()` dataloader (#5172)
* Add train class filter feature to datasets.py

Allows for training on a subset of total classes if `include_class` list is defined on datasets.py L448:
```python
        include_class = []  # filter labels to include only these classes (optional)
```

* segments fix
2021-10-13 15:48:54 -07:00
Glenn Jocher 276b674513
Fix SKU-110K HUB: `OSError` (#5106) 2021-10-09 00:12:59 -07:00
Egor Orel 48b00dbc0d
Re-open IP-camera videostream if disconnected (#5074)
* Re-open IP-camera videostream if disconnected. Provide IP-streaming analysis stability

* Re-open IP-camera videostream if disconnected. Provide IP-streaming analysis stability

* `self.imgs[i] *= 0` bug fix and cleanup

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-10-07 23:26:43 -07:00
Glenn Jocher 57ce73cd4f
Update datasets.py comments (#5088) 2021-10-07 16:04:08 -07:00
Glenn Jocher a64a4c839f
Replace `os.system('unzip file.zip')` -> `ZipFile.extractall()` (#4919)
* Replace `os.system('unzip file.zip')` -> `ZipFile.extractall()`

* Cleanup
2021-09-25 08:52:36 -07:00
Glenn Jocher 4fdaec0449
Single `cache_version` definition (#4846)
Defines dataset labels *.cache version in a single place, fixing a bug introduced in #4845.
2021-09-17 18:01:52 +02:00
Glenn Jocher fe39562a5f
Sorted datasets update to `cache_labels()` (#4845)
PR should produce datasets sorted alphabetically by filename. Cache version incremented to 0.5. 

Note: will force a one-time re-caching of existing datasets on first-use.
2021-09-17 17:35:45 +02:00
Jihoon Kim fcb225c1c8
Shuffle all 4(or 9) images in mosaic augmentation (#4787)
Thank you for sharing nice open-source codes 👍

I applied to shuffle the order of all 4(or 9) images in mosaic augmentation

Currently, the order of images in mosaic augmentation is not completely random.
The remaining images except the first are randomly arranged. Apply shuffle all to increase the diversity of data composition.
2021-09-15 00:57:06 +02:00
Glenn Jocher c47be26f34
Replace `path.absolute()` with `path.resolve()` (#4763) 2021-09-11 22:46:33 +02:00
Glenn Jocher a2b3c71636
Add suffix checks (#4711)
* Add suffix checks

* Cleanup

* Cleanup2

* Cleanup3
2021-09-08 14:36:12 +02:00