Commit Graph

1608 Commits (60c8a4f6965cd16c22ee425f58f63eb903e40ee0)
 

Author SHA1 Message Date
Glenn Jocher 60c8a4f696
Fix for *.yaml emojis on load (#5543)
Fix for Colab hub error:


```python
import yaml

with open('yolov5s.yaml', errors='ignore') as f:
     d = yaml.safe_load(f)  # model dict

print(d)

---------------------------------------------------------------------------
ReaderError                               Traceback (most recent call last)
<ipython-input-8-1150b5143073> in <module>()
      2 
      3 with open('yolov5s.yaml', errors='ignore') as f:
----> 4      d = yaml.safe_load(f)  # model dict
      5 
      6 print(d)

6 frames
/usr/local/lib/python3.7/dist-packages/yaml/reader.py in check_printable(self, data)
    142             position = self.index+(len(self.buffer)-self.pointer)+match.start()
    143             raise ReaderError(self.name, position, ord(character),
--> 144                     'unicode', "special characters are not allowed")
    145 
    146     def update(self, length):

ReaderError: unacceptable character #x1f680: special characters are not allowed
  in "yolov5s.yaml", position 9
```
2021-11-06 16:03:14 +01:00
Glenn Jocher e189fa15ea
`intersect_dicts()` in hubconf.py fix (#5542) 2021-11-06 15:41:17 +01:00
Glenn Jocher fa2344cdd8
Update `models/hub/*.yaml` files for v6.0n release (#5540)
* Update model yamls for v6.0

* Add python models/yolo.py --test

* Ghost fix
2021-11-06 15:07:45 +01:00
Glenn Jocher 76d90d899a
Update Issue Templates with 💡 ProTip! (#5539)
* Update bug-report.yml

* Update question.yml

* Update bug-report.yml
2021-11-06 13:58:12 +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
Glenn Jocher 60e42e16c2
Update autobatch.py (#5536) 2021-11-06 12:21:17 +01:00
Deep Patel 336437998f
Suppress ONNX export trace warning (#5437)
Checking for `onnx_dynamic` first should suppress the warning:

```log
TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
  if self.grid[i].shape[2:4] != x[i].shape[2:4] or self.onnx_dynamic
```
2021-11-05 19:31:53 +01:00
Wonbeom Jang d895a7f70d
Update train.py (#5451)
* correct --resume True error

* delete temp file

* Update train.py

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-11-05 19:28:53 +01:00
nanmi 98a3fd7e8f
Update export.py (#5471)
* fix export onnx bug

* Update export.py

* Update export.py

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

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

* Update yolo.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>
2021-11-05 19:26:45 +01:00
Glenn Jocher 32b8738735
Update `check_file()` avoid repeat URL downloads (#5526) 2021-11-05 19:22:47 +01:00
Glenn Jocher 5f603a9dba
Fix detect.py URL inference (#5525)
* Fix detect.py URL inference

Allows detect.py to run inference on remote URL sources, i.e.:

```python
!python detect.py --weights yolov5s.pt --source https://ultralytics.com/assets/zidane.jpg  # image URL
!python detect.py --weights yolov5s.pt --source https://ultralytics.com/assets/decelera_landscape.mov  # video URL
```

* [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-05 18:43:03 +01:00
Glenn Jocher 853505339a
Fix `increment_path()` explicit file vs dir handling (#5523)
Resolves https://github.com/ultralytics/yolov5/pull/5341#issuecomment-961774729

Tests:
```python
import glob
import re
from pathlib import Path


def increment_path(path, exist_ok=False, sep='', mkdir=False):
    # Increment file or directory path, i.e. runs/exp --> runs/exp{sep}2, runs/exp{sep}3, ... etc.
    path = Path(path)  # os-agnostic
    if path.exists() and not exist_ok:
        path, suffix = (path.with_suffix(''), path.suffix) if path.is_file() else (path, '')
        dirs = glob.glob(f"{path}{sep}*")  # similar paths
        matches = [re.search(rf"%s{sep}(\d+)" % path.stem, d) for d in dirs]
        i = [int(m.groups()[0]) for m in matches if m]  # indices
        n = max(i) + 1 if i else 2  # increment number
        path = Path(f"{path}{sep}{n}{suffix}")  # increment path
    if mkdir:
        path.mkdir(parents=True, exist_ok=True)  # make directory
    return path


print(increment_path('runs'))
print(increment_path('export.py'))
print(increment_path('abc.def.dir'))
print(increment_path('abc.def.file'))
```
2021-11-05 15:46:20 +01:00
Glenn Jocher bcc085d83f
Common `is_coco` logic betwen train.py and val.py (#5521) 2021-11-05 13:32:46 +01:00
Glenn Jocher bfacfc6b4a
Update cls bias init (#5520)
* Update cls bias init

Increased numerical precision. Returns 1.0 probability for single-class datasets now. Addresses https://github.com/ultralytics/yolov5/issues/5357

```python
torch.sigmoid(torch.tensor([math.log(0.6 / (1 - 0.99999))]))
Out[19]: tensor([1.0000])
```

* Update yolo.py
2021-11-05 13:18:46 +01:00
ys31jp 36a4de184f
Update plots.py feature_visualization path issues (#5519)
* Update plots.py

Error running python detect.py --visualize
#5503

* Update plots.py

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-11-05 13:08:07 +01:00
Yonghye Kwon 99a45bad81
Write date in checkpoint file (#5514)
* write date in checkpoint file

write date in checkpoint file

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

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

* isoformat

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-05 11:48:10 +01:00
Glenn Jocher 17b5f5b974
Fix `increment_path()` with periods (#5518)
Fix for https://github.com/ultralytics/yolov5/issues/5503
```
python detect.py --visualize --source path/to/file.suffix1.jpg
```
2021-11-05 11:16:19 +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
Nam Vu ac2c49a2bb
Handle edgetpu model inference (#5372)
* Handle edgetpu model inference

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

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

* Cleanup

Rename `tflite_runtime.interpreter as tflite` to `tflite_runtime.interpreter as tflri` to avoid conflict with existing `tflite` boolean

Co-authored-by: Nam Vu <nam@glodonusa.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>
2021-11-04 11:33: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 8a803f36d3
Delete code-format.yml (#5487) 2021-11-03 21:06:32 +01:00
Glenn Jocher 34b859a41e
Keras CI fix (#5486)
* Keras CI fix

* pre-commit fixes

* Update ci-testing.yml

Co-authored-by: pre-commit <pre-commit@example.com>
2021-11-03 19:25:44 +01:00
Glenn Jocher 06bf8ef7e5
Add tf.py verification printout (#5484)
* Update tf.py with verified confirmation

* Update ci-testing.yml

* Update ci-testing.yml
2021-11-03 19:04:51 +01:00
Glenn Jocher 62d77a1027 Created using Colaboratory 2021-11-03 18:55:25 +01:00
Glenn Jocher 84a8099b75
Update torch_utils.py import `LOGGER` (#5483) 2021-11-03 17:17:38 +01:00
Glenn Jocher df30426c03
Improve GPU name (#5478)
* Improve GPU name

* Update torch_utils.py

* Update torch_utils.py

* Update torch_utils.py

* Update torch_utils.py
2021-11-03 16:59:53 +01:00
Glenn Jocher 0eb37ad8af
Remove `check_requirements(('tensorflow>=2.4.1',))` (#5476)
`check_requirements()` is unreliable for large packages like torch and tensorflow that may have multiple installation routes (i.e. conda, pip, tensorflow-cpu, etc.)
2021-11-03 14:51:37 +01:00
Glenn Jocher 042f02ff9b
Fix tf.py `LoadImages()` dataloader return values (#5455) 2021-11-02 23:04:15 +01:00
Mrinal Jain 7476012a4d
Update `check_git_status()` to run under `ROOT` working directory (#5441)
* Updating check_git_status() to switch to the repository root before performing git ops

* More pythonic

* Linting

* Remove redundant Path() call

* Generalizing the context manager

* Fixing error in context manager

* Cleanup

* Change to decorator

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-11-02 22:16:01 +01:00
Pranath 19c8760caa
Fixed a small typo in CONTRIBUTING.md (#5445)
possibel -> possible
2021-11-02 12:05:31 +01:00
Glenn Jocher 4c0982a243
Update README.md (#5438)
2-line update
2021-11-01 18:28:14 +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
Glenn Jocher 8c326a1edf
Meshgrid `indexing='ij'` for PyTorch 1.10 (#5309)
* Meshgrid `indexing='ij'` for PyTorch 1.10

Will not merge currently as breaks backwards compatibility.

* Meshgrid `indexing='ij'` for PyTorch 1.10

Will not merge currently as breaks backwards compatibility.

* Add check_version hard argument

* Update comment
2021-11-01 14:33:08 +01:00
Glenn Jocher 5d4258fac5
Fix MixConv2d() remove shortcut + apply depthwise (#5410) 2021-10-30 13:38:51 +02:00
Glenn Jocher 7f9bbf0268
Update GitHub issues templates (#5404)
* Update GitHub issues templates

* pre-commit fixes

Co-authored-by: pre-commit <pre-commit@example.com>
2021-10-29 23:16:04 +02:00
Ayush Chaurasia 620b535f85
Update sweep.py (#5402) 2021-10-29 19:21:59 +02: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
Glenn Jocher a4fece8c14
DDP `nl` fix (#5332) 2021-10-25 16:03:39 +02:00
Glenn Jocher 9c31a66f5d
Update `AutoShape.forward()` model.classes example (#5324) 2021-10-25 14:03:25 +02:00
Glenn Jocher ca19df5f7f
Add `autobatch` feature for best `batch-size` estimation (#5092)
* Autobatch

* fix mem

* fix mem2

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update train.py

* print result

* Cleanup print result

* swap fix in call

* to 64

* use total

* fix

* fix

* fix

* fix

* fix

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Cleanup printing

* Update final printout

* Update autobatch.py

* Update autobatch.py

* Update autobatch.py
2021-10-25 13:56:13 +02:00
Ayush Chaurasia 692be757b6
W&B: Media panel fix (#5317) 2021-10-25 12:06:12 +02:00
Zhiqiang Wang 3d897986c7
Small fixes to docstrings (#5313)
* Minor fixes of the git checkout new branch

* Use em dash to quote

* Revert the change of git checkout

* Maybe we should up-to-date with the upstream/master?
2021-10-24 22:05:34 +02:00
Cristi Fati fee83c1634
Weights download script minor improvements (#5213)
* Add nano model to the download list

* Add possibility to also download the "*6" models

* Cleanup

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-10-23 14:20:26 +02:00
Jebastin Nadar e0c3f42de7
Uncomment OpenCV 4.5.4 requirement in detect.py (#5305) 2021-10-23 13:40:34 +02:00
Glenn Jocher 79d8f1f678 Created using Colaboratory 2021-10-22 21:19:23 +02:00
Glenn Jocher b760acec11 Created using Colaboratory 2021-10-22 21:11:29 +02:00
Glenn Jocher 441b47c443
More informative `EarlyStopping()` message (#5303) 2021-10-22 20:02:19 +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 a18b0c36cd
Update rebase.yml with workflows permissions (#5255)
Update token with workflows permissions
2021-10-19 12:02:15 +02:00