Skip to content

Update autoanchor.py #6794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 26, 2022
Merged

Update autoanchor.py #6794

merged 2 commits into from
Feb 26, 2022

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Feb 26, 2022

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Enhancements to anchor optimization logging for clarity.

📊 Key Changes

  • Improved the messaging when new anchors are saved or when original anchors are preferred.
  • Made the warning about extremely small objects more concise.

🎯 Purpose & Impact

  • The changes aim to make the log messages more informative and easier to understand.
  • This helps users in debugging and optimizing anchor settings in their YOLOv5 models, which can ultimately improve object detection performance. 🎯
  • It affects users who rely on the automatic anchor optimization feature by providing clearer guidance on the results of their anchor adjustments. 🛠️

@glenn-jocher glenn-jocher self-assigned this Feb 26, 2022
@glenn-jocher glenn-jocher merged commit 63ddb6f into master Feb 26, 2022
@glenn-jocher glenn-jocher deleted the glenn-jocher-patch-1 branch February 26, 2022 18:15
bfineran added a commit to neuralmagic/yolov5 that referenced this pull request Apr 8, 2022
* Fix TensorRT potential unordered binding addresses (ultralytics#5826)

* feat: change file suffix in pythonic way

* fix: enforce binding addresses order

* fix: enforce binding addresses order

* Handle non-TTY `wandb.errors.UsageError` (ultralytics#5839)

* `try: except (..., wandb.errors.UsageError)`

* bug fix

* Avoid inplace modifying`imgs` in `LoadStreams` (ultralytics#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.

* Update `LoadImages` `ret_val=False` handling (ultralytics#5852)

Video errors may occur.

* Update val.py (ultralytics#5838)

* Update val.py

Solving Non-ASCII character '\xf0' error during runtime

* Update val.py

Co-authored-by: Glenn Jocher <[email protected]>

* Update TorchScript suffix to `*.torchscript` (ultralytics#5856)

* Add `--workers 8` argument to val.py (ultralytics#5857)

* Update val.py

Add an option to choose number of workers if not called by train.py

* Update comment

* 120 char line width

Co-authored-by: Glenn Jocher <[email protected]>

* Update `plot_lr_scheduler()` (ultralytics#5864)

shallow copy modify originals

* Update `nl` after `cutout()` (ultralytics#5873)

* `AutoShape()` models as `DetectMultiBackend()` instances (ultralytics#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

* Single-command multiple-model export (ultralytics#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

* `Detections().tolist()` explicit argument fix (ultralytics#5907)

debugged for missigned Detections attributes

* Update wandb_utils.py (ultralytics#5908)

* Add *.engine (TensorRT extensions) to .gitignore (ultralytics#5911)

* Add *.engine (TensorRT extensions) to .gitignore

* Update .dockerignore

Co-authored-by: Glenn Jocher <[email protected]>

* Add ONNX inference providers (ultralytics#5918)

* Add ONNX inference providers

Fix for ultralytics#5916

* Update common.py

* Add hardware checks to `notebook_init()` (ultralytics#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>

* Revert "Update `plot_lr_scheduler()` (ultralytics#5864)" (ultralytics#5920)

This reverts commit 360eec6.

* Absolute '/content/sample_data' (ultralytics#5922)

* Default PyTorch Hub to `autocast(False)` (ultralytics#5926)

* Fix ONNX opset inconsistency with parseargs and run args (ultralytics#5937)

* Make `select_device()` robust to `batch_size=-1` (ultralytics#5940)

* Find out a bug. When set batch_size = -1 to use the autobatch.

reproduce:

* Fix type conflict

Co-authored-by: Glenn Jocher <[email protected]>

* fix .gitignore not tracking existing folders (ultralytics#5946)

* fix .gitignore not tracking existing folders

fix .gitignore so that the files that are in the repository are actually being tracked.

Everything in the data/ folder is ignored, which also means the subdirectories are ignored. Fix so that the subdirectories and their contents are still tracked.

* Remove data/trainings

Co-authored-by: Glenn Jocher <[email protected]>

* Update `strip_optimizer()` (ultralytics#5949)

Replace 'training_result' with 'best_fitness' in strip_optimizer() to match key with ckpt from train.py

* Add nms and agnostic nms to export.py (ultralytics#5938)

* add nms and agnostic nms to export.py

* fix agnostic implies nms

* reorder args to group TF args

* PEP8 120 char

Co-authored-by: Glenn Jocher <[email protected]>

* Refactor NUM_THREADS (ultralytics#5954)

* Fix Detections class `tolist()` method (ultralytics#5945)

* Fix tolist() to add the file for each Detection

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

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

* Fix PEP8 requirement for 2 spaces before an inline comment

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

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

* Cleanup

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <[email protected]>

* Fix `imgsz` bug (ultralytics#5948)

* fix imgsz bug

* Update detect.py

Co-authored-by: Glenn Jocher <[email protected]>

* `pretrained=False` fix (ultralytics#5966)

* `pretriained=False` fix

Fix for ultralytics#5964

* CI speed improvement

* make parameter ignore epochs (ultralytics#5972)

* make parameter ignore epochs

ignore epochs functionality add to prevent spikes at the beginning when fitness spikes and decreases after.
Discussed at ultralytics#5971

* Update train.py

Co-authored-by: Glenn Jocher <[email protected]>

* YOLOv5s6 params and FLOPs fix (ultralytics#5977)

* Update callbacks.py with `__init__()` (ultralytics#5979)

Add __init__() function.

* Increase `ar_thr` from 20 to 100 for better detection on slender (high aspect ratio) objects (ultralytics#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

* Allow `--weights URL` (ultralytics#5991)

* Recommend `jar xf file.zip` for zips (ultralytics#5993)

* *.torchscript inference `self.jit` fix (ultralytics#6007)

* Check TensorRT>=8.0.0 version (ultralytics#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>

* Multi-layer capable `--freeze` argument (ultralytics#6019)

* support specfiy multiple frozen layers

* fix bug

* Cleanup Freeze section

* Cleanup argument

Co-authored-by: Glenn Jocher <[email protected]>

* train -> val comment fix (ultralytics#6024)

* Add dataset source citations (ultralytics#6032)

* Kaggle `LOGGER` fix (ultralytics#6041)

* Simplify `set_logging()` indexing (ultralytics#6042)

* `--freeze` fix (ultralytics#6044)

Fix for ultralytics#6038

* OpenVINO Export (ultralytics#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',))

* Reduce G/D/CIoU logic operations (ultralytics#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: 李杰 <[email protected]>

* Init tensor directly on device (ultralytics#6068)

Slightly more efficient than .to(device)

* W&B: track batch size after autobatch (ultralytics#6039)

* track batch size after autobatch

* remove redundant import

* Update __init__.py

* Update __init__.py

Co-authored-by: Glenn Jocher <[email protected]>

* W&B: Log best results after training ends (ultralytics#6120)

* log best.pt metrics at train end

* update

* Update __init__.py

Co-authored-by: Glenn Jocher <