Commit Graph
100 Commits
Author SHA1 Message Date
Glenn Jocher ff8646cdea Update workflows (#6427)
* Workflow updates

* quotes fix

* best to weights fix
2022-01-25 17:33:22 -05:00
Glenn Jocher cfecd903a3 Update greetings.yaml email address (#6412)
* Update `greetings.yaml` email address

* Update greetings.yml
2022-01-24 15:28:52 -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
Glenn Jocher c43439aa31 Add albumentations to Dockerfile (#6392) 2022-01-21 21:06:02 -10:00
Glenn Jocher bd815d48df FROM nvcr.io/nvidia/pytorch:21.10-py3 (#6379)
21.12 generates dockerhub errors so rolling back to 21.10 with latest pytorch install. Not sure if this torch install will work on non-GPU dockerhub autobuild so this is an experiment.
2022-01-20 19:15:04 -10:00
Glenn Jocher 1b41a1d059 FROM nvcr.io/nvidia/pytorch:21.12-py3 (#6377) 2022-01-20 17:59:41 -10:00
Glenn Jocherandpre-commit-ci[bot] 750c42e43e export.py automatic forward_export (#6352)
* `export.py` automatic `forward_export`

* [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-01-19 12:24:40 -10:00
Glenn Jocher e5219099cd Created using Colaboratory 2022-01-19 10:18:29 -10:00
Glenn Jocher 0cf932bf63 export.py return exported files/dirs (#6343)
* `export.py` return exported files/dirs

* Path to str
2022-01-18 15:18:23 -10:00
Glenn Jocher e2e95b2d8e TensorRT assert im.device.type != 'cpu' on export (#6340)
* TensorRT `assert im.device.type != 'cpu'` on export

* Update export.py
2022-01-18 13:52:25 -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
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 80473a6551 Update export.py with Detect, Validate usages (#6280) 2022-01-12 15:48:40 -10:00
Glenn Jocherandpre-commit-ci[bot] f3085accd3 Enable ONNX --half FP16 inference (#6268)
* Enable ONNX ``--half` FP16 inference

* [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-01-11 10:13:17 -10:00
Glenn Jocher b3eaf5008b TensorRT pip install 2022-01-10 16:49:10 -10:00
Glenn Jocher 6865d19a92 TensorRT 7 export fix (#6235) 2022-01-07 09:31:17 -08:00
Glenn Jocher 33a67b4918 Update P2-P7 models/hub variants (#6230)
* Update p2-p7 `models/hub` variants

* Update common.py

* AutoAnchor camelcase corrections
2022-01-06 11:08:09 -08:00
Glenn Jocher ad565e31d2 Update README speed reproduction command (#6228) 2022-01-06 09:55:31 -08:00
Glenn Jocher f80c463010 Attempt edgetpu-compiler autoinstall (#6223)
* Attempt `edgetpu-compiler` autoinstall

Attempt to install edgetpu-compiler dependency if missing on Linux.

* Update export.py

* Update export.py
2022-01-05 20:57:20 -08:00
Glenn Jocher b4ac3df6ff Add edgetpu_compiler checks (#6218)
* Add `edgetpu_compiler` checks

* Update export.py

* Update export.py

* Update export.py

* Update export.py

* Update export.py

* Update export.py
2022-01-05 14:55:04 -08:00
Glenn Jocher 00d7b97869 TFLite --int8 'flatbuffers==1.12' fix 2 (#6217)
* TFLite `--int8` 'flatbuffers==1.12' fix 2

Reorganizes #6216 fix to update before `tensorflow` import so no restart required.

* Update export.py
2022-01-05 13:34:36 -08:00
Glenn Jocher 8125ec5d42 TFLite --int8 'flatbuffers==1.12' fix (#6216)
* TFLite `--int8` 'flatbuffers==1.12' fix

Temporary workaround for TFLite INT8 export.

* Update export.py

* Update export.py
2022-01-05 13:01:21 -08:00
Glenn Jocher 5402753a53 Edge TPU compiler comment (#6196)
* Edge TPU compiler comment

* 7 to 8 fix
2022-01-04 19:36:12 -08: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 b5b56a3c88 Add CoreML inference (#6195)
* Add Apple CoreML inference

* Cleanup
2022-01-04 17:49:09 -08:00
Glenn Jocher 7b31a531b4 Add tensorrt>=7.0.0 checks (#6193)
* Add `tensorrt>=7.0.0` checks

* Update export.py

* Update common.py

* Update export.py
2022-01-04 13:39:13 -08:00
Glenn Jocher 5bd6a97b18 Global export format sort (#6182)
* Global export sort

* Cleanup
2022-01-03 20:08:15 -08:00
Glenn Jocher 7cad6597bb Ignore *_openvino_model/ dir (#6180) 2022-01-03 18:43:21 -08:00
Glenn Jocher 63a4d862aa Add OpenVINO inference (#6179) 2022-01-03 15:41:26 -08:00
Glenn Jocher b4a29b5a8d Update NMS max_wh=7680 for 8k images (#6178) 2022-01-03 10:54:52 -08:00
Glenn Jocher 968e30065a Update greetings.yml (#6165) 2022-01-02 19:47:03 -08:00
Glenn Jocherandpre-commit-ci[bot] ec4b6dd2a3 Update export format docstrings (#6151)
* Update export documentation

* Cleanup

* Update export.py

* Update README.md

* Update README.md

* Update README.md

* Update README.md

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

* Update train.py

* Update train.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-01-02 16:09:45 -08:00
Glenn Jocher 95c7bc25d3 OpenVINO Export (#6057)
* OpenVINO export

* Remove timeout

* Add 3 files

* str

* Constrain opset to 12

* Default ONNX opset to 12

* Make dir

* Make dir

* Cleanup

* Cleanup

* check_requirements(('openvino-dev',))
2021-12-22 20:29:48 +01:00
Glenn Jocher dc54ed5763 --freeze fix (#6044)
Fix for https://github.com/ultralytics/yolov5/issues/6038
2021-12-20 18:24:07 +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 26f0415287 Add dataset source citations (#6032) 2021-12-19 15:19:04 +01:00
Glenn Jocher abbdd4802e train -> val comment fix (#6024) 2021-12-17 16:43:00 +01:00
Glenn Jocherandpre-commit-ci[bot] 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 c1249a47c7 *.torchscript inference self.jit fix (#6007) 2021-12-16 14:10:54 +01:00
Glenn Jocher 628817dfae Recommend jar xf file.zip for zips (#5993) 2021-12-15 17:19:19 +01:00
Glenn Jocher da9a1b719b Allow --weights URL (#5991) 2021-12-15 15:27:08 +01:00
Glenn Jocher c9a46a60e0 Update callbacks.py with __init__() (#5979)
Add __init__() function.
2021-12-14 15:47:49 +01:00
Glenn Jocher d699c21c75 YOLOv5s6 params and FLOPs fix (#5977) 2021-12-14 11:24:39 +01:00
Glenn Jocher e8ef8fb1ca pretrained=False fix (#5966)
* `pretriained=False` fix

Fix for https://github.com/ultralytics/yolov5/issues/5964

* CI speed improvement
2021-12-13 13:32:27 +01:00
Glenn Jocher 8f875d93a2 Refactor NUM_THREADS (#5954) 2021-12-11 14:32:18 +01:00
Glenn Jocher 5bdb28ed10 Default PyTorch Hub to autocast(False) (#5926) 2021-12-08 23:15:14 +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 Jocherandpre-commit-ci[bot] 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
Glenn Jocher 581dc301a7 Add ONNX inference providers (#5918)
* Add ONNX inference providers

Fix for https://github.com/ultralytics/yolov5/issues/5916

* Update common.py
2021-12-08 13:37:33 +01:00
Glenn Jocher 1075488d89 Single-command multiple-model export (#5882)
* Export multiple models in series

Export multiple models in series by adding additional `*.pt` files to the `--weights` argument, i.e.:

```bash
python export.py --include tflite --weights yolov5n.pt  # export 1 model
python export.py --include tflite --weights yolov5n.pt yolov5s.pt yolov5m.pt yolov5l.pt yolov5x.pt  # export 5 models
```

* Update export.py

* Update README.md
2021-12-04 16:28:40 +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
Glenn Jocher 00e308f7be Update TorchScript suffix to *.torchscript (#5856) 2021-12-02 16:06:45 +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 94d8fec6d8 GCP VM from Image example (#5814) 2021-11-28 18:12:46 +01:00
Glenn Jocher fcd180d336 Refactor new model.warmup() method (#5810)
* Refactor new `model.warmup()` method

* Add half
2021-11-27 12:29:45 +01:00
Glenn Jocherandpre-commit-ci[bot] 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
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
Glenn Jocher d6ae1c835a Created using Colaboratory 2021-11-21 19:26:07 +01:00
Glenn Jocher 46daa7b78d Remove .autoshape() method (#5694) 2021-11-20 01:11:36 +01:00
Glenn Jocher 36d12a500e Explicitly compute TP, FP in val.py (#5727) 2021-11-20 01:04:56 +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
Glenn Jocher 562191f575 Update export.py docstring (#5689) 2021-11-17 15:18:50 +01:00
Glenn Jocher 47fac9ff73 Update train.py comment to 'Model attributes' (#5670) 2021-11-16 13:58:15 +01:00
Glenn Jocher e80a09bbfa Update ci-testing.yml to Python 3.9 (#5660) 2021-11-15 20:15:50 +01:00
Glenn Jocherandpre-commit-ci[bot] 80cfaf40ef AutoAnchor and AutoBatch LOGGER (#5635)
* AutoBatch, AutoAnchor `LOGGER`

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

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

* Update autoanchor.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-11-13 15:40:18 +01:00
Glenn Jocher 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 Jocherandpre-commit-ci[bot] 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 30bc089cbb Update val.py speed and study tasks (#5608)
Accepts all arguments now by default resolving https://github.com/ultralytics/yolov5/issues/5600
2021-11-10 16:48:38 +01:00
Glenn Jocherandpre-commit-ci[bot] 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
Glenn Jocherandpre-commit-ci[bot] 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 7207fe95e5 FROM nvcr.io/nvidia/pytorch:21.10-py3 (#5592) 2021-11-09 17:55:57 +01:00
Glenn Jocherandpre-commit-ci[bot] 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 Jocherandpre-commit-ci[bot] 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 0de4a9c35d Add --conf-thres >> 0.001 warning (#5567)
Partially addresses invalid mAPs at higher confidence threshold issue https://github.com/ultralytics/yolov5/issues/1466.
2021-11-08 16:04:31 +01:00
Glenn Jocher b8f979bafa Inside Ultralytics video https://youtu.be/Zgi9g1ksQHc (#5546)
* Update detect.py Usage examples

* Inside Ultralytics at https://youtu.be/Zgi9g1ksQHc
2021-11-06 20:34:54 +01:00
Glenn Jocherandpre-commit-ci[bot] 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 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
Glenn Jocher 32b8738735 Update check_file() avoid repeat URL downloads (#5526) 2021-11-05 19:22:47 +01:00
Glenn Jocherandpre-commit-ci[bot] 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
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
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 Jocherandpre-commit 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