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

Highlight the closest target with a different color in predictions #13018

Open
wants to merge 28 commits into
base: master
Choose a base branch
from

Conversation

1260635600
Copy link

@1260635600 1260635600 commented May 16, 2024

_I have read the CLA Document and I sign the CLA_

This pull request adds a feature to highlight the closest detected target with a different color in the predictions made by YOLOv5. The closest target is determined based on its distance from a reference point.

Changes made:

  • Added a function find_closest_target in detect.py to calculate and identify the closest target.
  • Updated the drawing function to change the color of the closest target.
  • Modified the detect function to incorporate the new highlighting feature.
  • Added relevant tests to ensure the functionality works as expected.

Testing:

  • Verified the changes using sample images to ensure the closest target is correctly highlighted.
  • Ran all existing unit tests and added new ones for the new feature.

This feature enhances the detection capabilities of YOLOv5, making it easier to identify the nearest object, which can be useful in applications like autonomous navigation and object tracking.

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Enhanced object detection in YOLOv5 with closer object highlight and streamlined code for performance.

📊 Key Changes

  • Numpy Integration: Added numpy for advanced numerical calculations.
  • Code Simplification: Simplified detection algorithms removing redundant conditions, focusing on streamlining and performance optimization.
  • Closest Object Highlight: Implemented functionality to calculate and highlight the object closest to the image center, making it stand out by marking it in green.
  • Code Cleanup: Removed unnecessary comments and simplified block comments for clarity and conciseness.

🎯 Purpose & Impact

  • Purpose:
    • To make the detection process more intuitive by visually emphasizing the object closest to the image center.
    • To improve the readability and performance of the code by removing redundant operations and simplifying complex constructs.
  • Impact:
    • Developers: These changes make the codebase cleaner, enhancing maintainability and ease of future enhancements.
    • Users: Users benefit from the new feature that highlights the closest object, potentially improving usability in applications requiring focus on central objects, such as autonomous navigation or surveillance.

📈 Expect upgrades in performance and user experience for applications leveraging YOLOv5 for object detection. 🕵️‍♂️🔍

Copy link
Contributor

github-actions bot commented May 16, 2024


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I sign the CLA


1 out of 2 committers have signed the CLA.
✅ (UltralyticsAssistant)[https://github.com/UltralyticsAssistant]
@1260635600
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 Hello @1260635600, thank you for submitting a YOLOv5 🚀 PR! To allow your work to be integrated as seamlessly as possible, we advise you to:

  • ✅ Verify your PR is up-to-date with ultralytics/yolov5 master branch. If your PR is behind you can update your code by clicking the 'Update branch' button or by running git pull and git merge master locally.
  • ✅ Verify all YOLOv5 Continuous Integration (CI) checks are passing.
  • ✅ Reduce changes to the absolute minimum required for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." — Bruce Lee

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.

2 participants