Commit Graph

1880 Commits (26bfd4446559814ab5b1a2fa34584dcb3a49da6c)
 

Author SHA1 Message Date
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
Otfot db1f83be63
Fix `train.py` parameter groups desc error (#6318)
* Fix `train.py` parameter groups desc error

* Cleanup

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-01-16 20:58:34 -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 80473a6551
Update `export.py` with Detect, Validate usages (#6280) 2022-01-12 15:48:40 -10:00
Glenn Jocher 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
Jinwoong Yoo 9b13a594e9
Fix `cmd` string on `tfjs` export (#6243)
* Fix cmd string on tfjs export

* Cleanup

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-01-09 20:40:47 -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
imyhxy a2f4a1799b
TensorRT 7 `anchor_grid` compatibility fix (#6185)
* fix: TensorRT 7 incompatiable

* Add comment

* Add if: else and comment

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-01-04 11:09:25 -08:00
Yin Rong fb839298a1
Fix TorchScript on mobile export (#6183)
* fix export of TorchScript on mobile

* Cleanup

Co-authored-by: yinrong <yinrong@xiaomi.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2022-01-03 20:25:48 -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
pre-commit-ci[bot] 5344e54da6
[pre-commit.ci] pre-commit suggestions (#6177)
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.0.1 → v4.1.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.0.1...v4.1.0)
- [github.com/asottile/pyupgrade: v2.23.1 → v2.31.0](https://github.com/asottile/pyupgrade/compare/v2.23.1...v2.31.0)
- [github.com/PyCQA/isort: 5.9.3 → 5.10.1](https://github.com/PyCQA/isort/compare/5.9.3...5.10.1)
- [github.com/PyCQA/flake8: 3.9.2 → 4.0.1](https://github.com/PyCQA/flake8/compare/3.9.2...4.0.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-01-03 10:42:50 -08:00
Glenn Jocher 968e30065a
Update greetings.yml (#6165) 2022-01-02 19:47:03 -08:00
Glenn Jocher 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
bilzard e1dc894364
Enable AdamW optimizer (#6152) 2022-01-02 13:10:19 -08:00
Jiacong Fang d95978a562
Add EdgeTPU support (#3630)
* Add models/tf.py for TensorFlow and TFLite export

* Set auto=False for int8 calibration

* Update requirements.txt for TensorFlow and TFLite export

* Read anchors directly from PyTorch weights

* Add --tf-nms to append NMS in TensorFlow SavedModel and GraphDef export

* Remove check_anchor_order, check_file, set_logging from import

* Reformat code and optimize imports

* Autodownload model and check cfg

* update --source path, img-size to 320, single output

* Adjust representative_dataset

* Put representative dataset in tfl_int8 block

* detect.py TF inference

* weights to string

* weights to string

* cleanup tf.py

* Add --dynamic-batch-size

* Add xywh normalization to reduce calibration error

* Update requirements.txt

TensorFlow 2.3.1 -> 2.4.0 to avoid int8 quantization error

* Fix imports

Move C3 from models.experimental to models.common

* Add models/tf.py for TensorFlow and TFLite export

* Set auto=False for int8 calibration

* Update requirements.txt for TensorFlow and TFLite export

* Read anchors directly from PyTorch weights

* Add --tf-nms to append NMS in TensorFlow SavedModel and GraphDef export

* Remove check_anchor_order, check_file, set_logging from import

* Reformat code and optimize imports

* Autodownload model and check cfg

* update --source path, img-size to 320, single output

* Adjust representative_dataset

* detect.py TF inference

* Put representative dataset in tfl_int8 block

* weights to string

* weights to string

* cleanup tf.py

* Add --dynamic-batch-size

* Add xywh normalization to reduce calibration error

* Update requirements.txt

TensorFlow 2.3.1 -> 2.4.0 to avoid int8 quantization error

* Fix imports

Move C3 from models.experimental to models.common

* implement C3() and SiLU()

* Add TensorFlow and TFLite Detection

* Add --tfl-detect for TFLite Detection

* Add int8 quantized TFLite inference in detect.py

* Add --edgetpu for Edge TPU detection

* Fix --img-size to add rectangle TensorFlow and TFLite input

* Add --no-tf-nms to detect objects using models combined with TensorFlow NMS

* Fix --img-size list type input

* Update README.md

* Add Android project for TFLite inference

* Upgrade TensorFlow v2.3.1 -> v2.4.0

* Disable normalization of xywh

* Rewrite names init in detect.py

* Change input resolution 640 -> 320 on Android

* Disable NNAPI

* Update README.me --img 640 -> 320

* Update README.me for Edge TPU

* Update README.md

* Fix reshape dim to support dynamic batching

* Fix reshape dim to support dynamic batching

* Add epsilon argument in tf_BN, which is different between TF and PT

* Set stride to None if not using PyTorch, and do not warmup without PyTorch

* Add list support in check_img_size()

* Add list input support in detect.py

* sys.path.append('./') to run from yolov5/

* Add int8 quantization support for TensorFlow 2.5

* Add get_coco128.sh

* Remove --no-tfl-detect in models/tf.py (Use tf-android-tfl-detect branch for EdgeTPU)

* Update requirements.txt

* Replace torch.load() with attempt_load()

* Update requirements.txt

* Add --tf-raw-resize to set half_pixel_centers=False

* Remove android directory

* Update README.md

* Update README.md

* Add multiple OS support for EdgeTPU detection

* Fix export and detect

* Export 3 YOLO heads with Edge TPU models

* Remove xywh denormalization with Edge TPU models in detect.py

* Fix saved_model and pb detect error

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

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

* Fix pre-commit.ci failure

* Add edgetpu in export.py docstring

* Fix Edge TPU model detection exported by TF 2.7

* Add class names for TF/TFLite in DetectMultibackend

* Fix assignment with nl in TFLite Detection

* Add check when getting Edge TPU compiler version

* Add UTF-8 encoding in opening --data file for Windows

* Remove redundant TensorFlow import

* Add Edge TPU in export.py's docstring

* Add the detect layer in Edge TPU model conversion

* Default `dnn=False`

* Cleanup data.yaml loading

* Update detect.py

* Update val.py

* Comments and generalize data.yaml names

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: unknown <fangjiacong@ut.cn>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-12-31 09:47: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
Deep Patel c72270c076
Init tensor directly on device (#6068)
Slightly more efficient than .to(device)
2021-12-23 13:49:00 +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 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
Felix You 361705d9be
Multi-layer capable `--freeze` argument (#6019)
* support specfiy multiple frozen layers

* fix bug

* Cleanup Freeze section

* Cleanup argument

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-12-17 15:42:26 +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 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
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