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

Refactor test.py arguments #3558

Merged
merged 6 commits into from
Jun 9, 2021
Merged

Refactor test.py arguments #3558

merged 6 commits into from
Jun 9, 2021

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Jun 9, 2021

@kalenmike @SkalskiP alright guys, I did some prep work in a few PRs earlier today, this is my first effort in refactoring one of our main file's arguments. This PR passes only arguments (no argparser class) to the test() function within test.py.

This means that test() should be callable from python similarly to how it's called currently in a bash command.

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Improved clarity and usage flexibility in object detection and testing scripts.

πŸ“Š Key Changes

  • πŸ’¬ Updated some comments for better clarity (e.g., check img_size is now check image size).
  • 🏷️ Added more descriptive argument names and comments in test.py (e.g., imgsz=640, # image size).
  • πŸš€ Included new arguments for specifying project details in test.py (project, name, exist_ok, task, device).
  • ✨ Streamlined argument parsing to enable cleaner function calls (test(**vars(opt))).
  • 🧹 Cleaned up redundancy by directly calling test() with opt parameters unpacked.

🎯 Purpose & Impact

  • πŸ§‘β€πŸ’» Helps developers and users understand script functionality and parameters more easily.
  • πŸ› οΈ Enables more configurable test runs without changing the codebase, simplifying automation and custom evaluations.
  • 🌈 Promotes code cleanliness and reduces potential for errors, making maintenance easier for developers.
  • πŸ“ˆ The adjustments could lead to broader usage and easier integration into different workflows for end users.

@glenn-jocher glenn-jocher self-assigned this Jun 9, 2021
@glenn-jocher glenn-jocher merged commit a9553c0 into master Jun 9, 2021
@glenn-jocher glenn-jocher deleted the refactor_test branch June 9, 2021 19:36
Lechtr pushed a commit to Lechtr/yolov5 that referenced this pull request Jul 20, 2021
* remove opt from test()

* pass kwargs

* update comments

* revert accidental default change

* multiple --img options

* add comments

(cherry picked from commit a9553c0)
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
* remove opt from test()

* pass kwargs

* update comments

* revert accidental default change

* multiple --img options

* add comments
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

1 participant