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

Confusion matrix #1474

Merged
merged 79 commits into from
Nov 23, 2020
Merged

Confusion matrix #1474

merged 79 commits into from
Nov 23, 2020

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Nov 22, 2020

This PR implements confusion matrices using code from:
https://github.com/kaanakan/object_detection_confusion_matrix

VOC Confusion Matrix

python test.py --weights last.pt --data voc.yaml --img 512
image

COCO Confusion Matrix

python test.py --weights last.pt --data coco.yaml --img 640
image

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Enhanced testing capabilities in YOLOv5 with a new confusion matrix feature and improved results logging.

📊 Key Changes

  • Added seaborn and pandas to requirements.txt, previously commented out.
  • Introduced ConfusionMatrix class in utils/metrics.py to calculate and plot confusion matrices.
  • Updated test.py to create a confusion matrix instance and process batches to update this matrix.
  • Modified test.py and train.py to plot and save the confusion matrix during testing and training.
  • Adjusted WandB logging to include confusion matrix images where applicable.
  • Changed requirement management by moving pycocotools out of the commentary section for COCO mAP computation.

🎯 Purpose & Impact

  • These additions will provide users with a detailed visual understanding of model performance with confusion matrices.
  • Enhanced analytical capabilities will aid in identifying classification errors more systematically.
  • By introducing key data analysis libraries, YOLOv5 construes to be not just a training toolkit but also a model analysis suite.
  • Users leveraging WandB for experiment tracking will now have a richer set of visualizations automatically logged.
  • Ultimately, a better grasp of a model's predictions across different classes may hasten iterations on model improvement.

@glenn-jocher glenn-jocher self-assigned this Nov 23, 2020
@glenn-jocher glenn-jocher added the enhancement New feature or request label Nov 23, 2020
@glenn-jocher glenn-jocher merged commit 0a3ff71 into master Nov 23, 2020
@glenn-jocher glenn-jocher deleted the confusion_matrix branch November 23, 2020 14:27
burglarhobbit pushed a commit to burglarhobbit/yolov5 that referenced this pull request Jan 1, 2021
* initial commit

* add plotting

* matrix to cpu

* bug fix

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* seaborn pandas to requirements.txt

* seaborn pandas to requirements.txt

* update wandb plotting

* remove pandas

* if plots

* if plots

* if plots

* if plots

* if plots

* initial commit

* add plotting

* matrix to cpu

* bug fix

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* seaborn pandas to requirements.txt

* seaborn pandas to requirements.txt

* update wandb plotting

* remove pandas

* if plots

* if plots

* if plots

* if plots

* if plots

* Cat apriori to autolabels

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

* add plotting

* matrix to cpu

* bug fix

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* seaborn pandas to requirements.txt

* seaborn pandas to requirements.txt

* update wandb plotting

* remove pandas

* if plots

* if plots

* if plots

* if plots

* if plots

* initial commit

* add plotting

* matrix to cpu

* bug fix

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* seaborn pandas to requirements.txt

* seaborn pandas to requirements.txt

* update wandb plotting

* remove pandas

* if plots

* if plots

* if plots

* if plots

* if plots

* Cat apriori to autolabels

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

* add plotting

* matrix to cpu

* bug fix

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* seaborn pandas to requirements.txt

* seaborn pandas to requirements.txt

* update wandb plotting

* remove pandas

* if plots

* if plots

* if plots

* if plots

* if plots

* initial commit

* add plotting

* matrix to cpu

* bug fix

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* update plot

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* seaborn pandas to requirements.txt

* seaborn pandas to requirements.txt

* update wandb plotting

* remove pandas

* if plots

* if plots

* if plots

* if plots

* if plots

* Cat apriori to autolabels

* cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant