Skip to content

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]>
@github-actions
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

@github-actions
Copy link
Contributor

👋 Hello there! We wanted to let you know that we've decided to close this pull request due to inactivity. We appreciate the effort you put into contributing to our project, but unfortunately, not all contributions are suitable or aligned with our product roadmap.

We hope you understand our decision, and please don't let it discourage you from contributing to open source projects in the future. We value all of our community members and their contributions, and we encourage you to keep exploring new projects and ways to get involved.

For additional resources and information, please see the links below:

Thank you for your contributions to YOLO 🚀 and Vision AI ⭐

@github-actions github-actions bot added the Stale Stale and schedule for closing soon label Oct 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stale Stale and schedule for closing soon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants