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

Adding --output and --save-conf options to test.py #1182

Merged

Conversation

olehb
Copy link
Contributor

@olehb olehb commented Oct 20, 2020

Cleaner PR to replace #1175

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Improvement of result saving in object detection and testing scripts.

πŸ“Š Key Changes

  • save_dir variable unified across detection and test scripts.
  • Directory creation logic centralized to ensure result directories are created only once.
  • Conditional inclusion of confidence scores in saved text files controlled by --save-conf flag.
  • Enhanced code clarity and maintainability.

🎯 Purpose & Impact

  • πŸ“ Unifies result directory setup across different scripts, making it easier for users to locate and manage output files.
  • πŸ› οΈ Simplifies the codebase, reducing potential bugs related to directory handling.
  • βœ‚οΈ Reduces redundant code for directory creation, which streamlines the workflow.
  • πŸ“ˆ Allows for optional saving of confidence scores in result text files, providing more detailed output for analysis if needed.
  • πŸ‘€ Enhances the user experience, as results are saved in a predictable manner and output is customizable.

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 @olehb, thank you for submitting a PR! To allow your work to be integrated as seamlessly as possible, we advise you to:

  • Verify your PR is up-to-date with origin/master. If your PR is behind origin/master update by running the following, replacing 'feature' with the name of your local branch:
git remote add upstream https://github.com/ultralytics/yolov5.git
git fetch upstream
git checkout feature  # <----- replace 'feature' with local branch name
git rebase upstream/master
git push -u origin -f
  • Verify all 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

@olehb and all, I've updated this very good PR with some updated directory handling for test.py outputs. All test.py outputs will now be placed by default in a new runs/test directory, and if autolabels are requested using --save-txt then these will be placed in runs/test/autolabel, as per the screenshot below.

New runs of test.py will delete and reuse the same runs/test directory unless changed manually with --save-dir runs/test2 etc.

Screenshot 2020-10-25 at 16 38 00

@glenn-jocher glenn-jocher merged commit 19c8b2c into ultralytics:master Oct 25, 2020
@glenn-jocher
Copy link
Member

@olehb PR is now merged! Feel free to provide feedback on anything else you see that could use improvement.

Thank you for your contributions.

burglarhobbit pushed a commit to burglarhobbit/yolov5 that referenced this pull request Jan 1, 2021
* Adding --output and --save-conf options to test.py

* Update help fields

* Update test.py

* Make arguments and comments uniform with test.py

* Remove previous and print save_dir on finish

Co-authored-by: Glenn Jocher <[email protected]>
KMint1819 pushed a commit to KMint1819/yolov5 that referenced this pull request May 12, 2021
* Adding --output and --save-conf options to test.py

* Update help fields

* Update test.py

* Make arguments and comments uniform with test.py

* Remove previous and print save_dir on finish

Co-authored-by: Glenn Jocher <[email protected]>
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
* Adding --output and --save-conf options to test.py

* Update help fields

* Update test.py

* Make arguments and comments uniform with test.py

* Remove previous and print save_dir on finish

Co-authored-by: Glenn Jocher <[email protected]>
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.

None yet

2 participants