Glenn Jocher
6dd82c0252
Move `git_describe()` to general.py ( #6918 )
* Move `git_describe()` to general.py
* Move `git_describe()` to general.py
2 years ago
Glenn Jocher
e6e36aac10
Update bytes to GB with bitshift ( #6886 )
2 years ago
Glenn Jocher
c161557563
Default `OMP_NUM_THREADS=8` ( #6770 )
2 years ago
Glenn Jocher
2692e67c5f
Updated VOC hyperparameters ( #6732 )
* Update hyps
* Update hyp.VOC.yaml
* Update pathlib
* Update hyps
* Update hyps
* Update hyps
* Update hyps
2 years ago
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
2 years ago
Glenn Jocher
9c513ca629
Add `DATASETS_DIR` global in general.py ( #6578 )
2 years ago
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>
2 years ago
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>
2 years ago
Glenn Jocher
6445a8137e
Resolve dataset paths ( #6489 )
2 years ago
Glenn Jocher
d5966c93f1
Namespace `VERBOSE` env variable to `YOLOv5_VERBOSE` ( #6428 )
* Verbose updates
* Verbose updates
2 years ago
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>
2 years ago
johnk2hawaii
9708cf56ea
New environment variable `VERBOSE` ( #6353 )
New environment variable `VERBOSE`
2 years ago
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
2 years ago
Glenn Jocher
b4a29b5a8d
Update NMS `max_wh=7680` for 8k images ( #6178 )
2 years ago
Glenn Jocher
b8a4babd60
Simplify `set_logging()` indexing ( #6042 )
2 years ago
Glenn Jocher
0db9d5b6a2
Kaggle `LOGGER` fix ( #6041 )
2 years ago
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>
2 years ago
Glenn Jocher
8f875d93a2
Refactor NUM_THREADS ( #5954 )
2 years ago
iumyx2612
a42af30d8a
Update `strip_optimizer()` ( #5949 )
Replace 'training_result' with 'best_fitness' in strip_optimizer() to match key with ckpt from train.py
2 years ago
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
2 years ago
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>
3 years ago
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
3 years ago
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>
3 years ago
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>
3 years ago
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>
3 years ago
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>
3 years ago
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>
3 years ago
Glenn Jocher
e189fa15ea
`intersect_dicts()` in hubconf.py fix ( #5542 )
3 years ago
Glenn Jocher
32b8738735
Update `check_file()` avoid repeat URL downloads ( #5526 )
3 years ago
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'))
```
3 years ago
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
```
3 years ago
Glenn Jocher
5866646cc8
Fix float zeros format ( #5491 )
* Fix float zeros format
* 255 to integer
3 years ago
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>
3 years ago
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>
3 years ago
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
3 years ago
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>
3 years ago
Glenn Jocher
7ee5aed0b3
Improved check_suffix() robustness to `''` and `""` ( #5192 )
* Improved check_suffix() robustness to `''` and `""`
* Cleanup
3 years ago
Zhiqiang Wang
1922ddeac0
Fix pylint: do not use bare 'except' ( #5025 )
* Fix E722, do not use bare 'except'
* Remove used codes
* Add FileNotFoundError in LoadImagesAndLabels
* Remove AssertionError
* Ignore LoadImagesAndLabels
* Ignore downloads.py
* Ignore torch_utils.py
* Ignore train.py
* Ignore datasets.py
* Enable utils/download.py
* Fixing exception in thop
* Remove unused code
* Fixing exception in LoadImagesAndLabels
* Fixing exception in exif_size
* Fixing exception in parse_model
* Ignore exceptions in requests
* Revert the exception as suggested
* Revert the exception as suggested
3 years ago
Kalen Michael
76d301bd21
Fix URL parsing bug ( #4998 )
* added callbacks
* added back callback to main
* added save_dir to callback output
* merged in upstream
* removed ghost code
* fixed parsing error for google temp links
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
3 years ago
Diego Montes
c1bed601e9
Fix `isascii()` method calls for python 3.6 ( #4958 )
* fix isascii for python3.6
* update comment with python 3.7 note
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
3 years ago
Glenn Jocher
a820b43aca
Automatic Chinese fonts plotting ( #4951 )
* Automatic Chinese fonts plotting
* Default PIL=False
3 years ago
Glenn Jocher
5a8e4343d8
Scope `check_file()` search space ( #4933 )
`check_file()` is now limited to searching opt-in directories: /data, /models, /utils. This prevents large non-project directories like /.git and /venv from being searched, which may cause `check_file()` to slow significantly.
3 years ago
Glenn Jocher
39c17ce0b9
Fix `root` referenced before assignment ( #4920 )
* Fix `root` referenced before assignment
Fix for bug introduced by #4919 discovered on VOC autodownload:
```
python train.py --data VOC.yaml
```
* Cleanup
3 years ago
Glenn Jocher
a64a4c839f
Replace `os.system('unzip file.zip')` -> `ZipFile.extractall()` ( #4919 )
* Replace `os.system('unzip file.zip')` -> `ZipFile.extractall()`
* Cleanup
3 years ago
Glenn Jocher
4c839eeb10
Simplify `check_requirements()` usage ( #4855 )
* Simplify `check_requirements()` usage
* remove assert, print()
3 years ago
Glenn Jocher
3732f9ac8a
Refactor argparser printing to `print_args()` ( #4850 )
* Refactor argparser printing to `print_args()`
* Cleanup
3 years ago
Glenn Jocher
84bfa89236
Consolidate `init_seeds()` ( #4849 )
3 years ago
Kalen Michael
43b2817f6e
Feature/fix export on url ( #4823 )
* added callbacks
* added back callback to main
* added save_dir to callback output
* merged in upstream
* removed ghost code
* added url check
* Add url2file()
* Update file-only
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
3 years ago
Glenn Jocher
c3a93d783d
Add TensorFlow formats to `export.py` ( #4479 )
* Initial commit
* Remove unused export_torchscript return
* ROOT variable
* Add prefix to fcn arg
* fix ROOT
* check_yaml into run()
* interim fixes
* imgsz=(320, 320)
* Hardcode tf_raw_resize False
* Finish opt elimination
* Update representative_dataset_gen()
* Update export.py with TF methods
* SiLU and GraphDef fixes
* file_size() directory handling feature
* export fixes
* add lambda: to representative_dataset
* Detect training False default
* Fuse false for TF models
* Embed agnostic NMS arguments
* Remove lambda
* TensorFlow.js export success
* Add pb to Usage
* Add *_tfjs_model/ to ignore files
* prepend YOLOv5 to function headers
* Remove end --- comments
* parameterize tfjs export pb file
* update run() data default /ROOT
* update --include help
* update imports
* return ct_model
* Consolidate TFLite export
* pb prerequisite to tfjs
* TF modules CamelCase
* Remove exports from tf.py and cleanup
* pass agnostic NMS arguments
* CI
* CI
* ignore *_web_model/
* Add tensorflow to CI dependencies
* CI tensorflow-cpu
* Update requirements.txt
* Remove tensorflow check_requirement
* CI coreml tfjs
* export only onnx torchscript
* reorder exports torchscript first
3 years ago
Glenn Jocher
c47be26f34
Replace `path.absolute()` with `path.resolve()` ( #4763 )
3 years ago