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

Precision-Recall Curve Feature Addition #1107

Merged
merged 4 commits into from
Oct 9, 2020
Merged

Precision-Recall Curve Feature Addition #1107

merged 4 commits into from
Oct 9, 2020

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Oct 9, 2020

This PR adds precision-recall curve plotting to the first and last training epochs, as well as any direct calls to test.py. Curve is saved as precision-recall_curve.png.

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Enhancements to test and plotting functions in yolov5.

📊 Key Changes

  • Changed save_dir and save_txt parameter defaults and types in test.py.
  • Removed merge option from Non-Max Suppression (NMS) and associated parameters.
  • Added plots parameter to control the generation of precision-recall curves and batch image saving.
  • Updated ap_per_class function in utils/general.py to optionally plot precision-recall curves.
  • Cleaned up and removed redundant sections of code such as the removal of existing output images in train.py.

🎯 Purpose & Impact

  • 🔄 The refactoring enhances code clarity by using more descriptive defaults for directory paths and clarifying the purpose of save_txt parameter.
  • 🧹 Removal of the merge option simplifies the NMS process and reflects updated best practices or model optimizations.
  • 📈 The plots parameter allows users to control the output of visual data more granitely, which can be useful for large-scale training or when visual output is not needed, potentially saving resources.
  • 📊 Precision-recall curve plotting provides a useful visualization of model performance, directly from the ap_per_class function.
  • 🧽 Overall streamlining of the codebase can lead to easier maintenance and better performance, benefiting users with clearer options and potentially faster execution.

@glenn-jocher glenn-jocher linked an issue Oct 9, 2020 that may be closed by this pull request
@glenn-jocher
Copy link
Member Author

Example precision-recall curve for YOLOv5x on COCO, evaluated at mAP@0.5.

precision-recall_curve

@glenn-jocher
Copy link
Member Author

Addition complete, colab tests on branch complete, CI passing, merging.

@glenn-jocher glenn-jocher merged commit 5fac5ad into master Oct 9, 2020
@glenn-jocher glenn-jocher deleted the pr_curve branch October 9, 2020 12:51
burglarhobbit pushed a commit to burglarhobbit/yolov5 that referenced this pull request Jan 1, 2021
* initial commit

* Update general.py

Indent update

* Update general.py

refactor duplicate code

* 200 dpi
KMint1819 pushed a commit to KMint1819/yolov5 that referenced this pull request May 12, 2021
* initial commit

* Update general.py

Indent update

* Update general.py

refactor duplicate code

* 200 dpi
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
* initial commit

* Update general.py

Indent update

* Update general.py

refactor duplicate code

* 200 dpi
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.

Precision-Recall Curve Plotting in test.py
1 participant