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

New Feature: added cmd line arg for saving only positives #13005

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

Conversation

GarbageHaus
Copy link

@GarbageHaus GarbageHaus commented May 12, 2024

Added a simple command line argument (default False) where if set to true, only the images and videos which contain a positive identification are saved to the output.
Currently outputting the images/video in detect.py is all or nothing. This addition prevents creating duplicate files which contain no detections, while allowing for positive detections to be saved.
Location in code is not extremely efficient, but is present at that location for readability and minimal intrusiveness.

I have read the CLA Document and I sign the CLA

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Introducing a new option to save only positive detections in YOLOv5 📸✅

📊 Key Changes

  • Added a new flag savepositives to the detection script. This allows users to choose to save only images or videos that contain positive detections (detections that the model is confident about).

🎯 Purpose & Impact

  • Efficiency Boost: This change helps save storage space and makes it easier for users to review positive detections by not saving images or videos without any detections. 🚀
  • User-Friendly: It enhances the usability of YOLOv5 for various projects, especially those where users are only interested in instances where the model finds something of interest. 🎉
  • Potential Impact: This addition could significantly benefit users running detection tasks in resource-constrained environments or dealing with large datasets where filtering out no-detection outputs manually would be impractical. 📈

Added a simple command line argument (default False) where if set to true, only the images and videos which contain a positive identification are saved to the output. 

Location in code is not extremely efficient, but is present at that location for readability and minimal intrusiveness.

Signed-off-by: GarbageHaus <[email protected]>
Copy link
Contributor

github-actions bot commented May 12, 2024

All Contributors have signed the CLA. ✅
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 @GarbageHaus, 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

@glenn-jocher
Copy link
Member

Please accept the CLA with a new comment with:

I have read the CLA Document and I sign the CLA

@GarbageHaus
Copy link
Author

I have read the CLA Document and I sign the CLA

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.

3 participants