Skip to content
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

Fix torchvision dependency for ClearML logging #8993

Conversation

thepycoder
Copy link
Contributor

@thepycoder thepycoder commented Aug 17, 2022

ClearML bounding boxes ported to native Annotator

Fixes #8898

Instead of using torchvision to draw the bounding boxes in the validation step, I rewrote the function to use the built-in Annotator class like @glenn-jocher suggested in the issue. This eliminates the potential dependency error.

This also includes a small rewrite of the loops in the function to make it a bit more consice and clean :)

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Enhancement of ClearML logging with better image annotation and configuration.

📊 Key Changes

  • 🧩 Integrated numpy and custom Annotator from utils.plots for image annotation.
  • 🎨 Utilized color schemes from utils.plots.colors for bounding box visualization.
  • ✂️ Removed dependency on torchvision.transforms.ToPILImage.
  • 🔍 Added confidence threshold parameter to log_image_with_boxes for filtering annotations.

🎯 Purpose & Impact

  • 📈 Purpose: To improve the visual clarity of logged images with bounding boxes in ClearML and allow users to set a confidence threshold for annotations.
  • 💡 Impact: Users will see more polished and configurable visual logs within their ClearML experiments, leading to better interpretability of their models' outputs.

@glenn-jocher glenn-jocher merged commit 3456fe6 into ultralytics:master Aug 17, 2022
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
* Replace torchvision annotator with native local Annotator

* Add colored bounding boxes and rewrite for efficiency

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

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

* Fix pep8 issue

* Update clearml_utils.py

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

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

* Update clearml_utils.py

* Reduced conf_threshold to 0.25 to match defaults

The 0.25 default conf threshold value is used a default throughout YOLOv5 (i.e. in detect.py) and also in other tools like CoreML

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ImportError: cannot import name 'draw_bounding_boxes' from 'torchvision.utils'
2 participants