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

Add option to use YOLOv5 AP metric #775

Merged
merged 3 commits into from
Sep 16, 2022
Merged

Conversation

kivanctezoren
Copy link
Contributor

As stated in this issue, YOLOv7 uses the AP metric from an earlier version of YOLOv5. The metric has since been updated and according to the developer of v5, this new metric is the same one used by the Detectron2 and MMDetection repositories.

The new v5 metric assumes the maximum recall in the precision-recall curve as 1.0, which results in a higher numeric value than the v7 metric for the same performance. If other repositories use a similar calculation, it may provide a more fair comparison.

Thus, I have added the optional flag v5-metric to test using this metric. It can also be used in training for choosing the best model after training.

@AlexeyAB
Copy link
Collaborator

@WongKinYiu I think we can add it as option --v5-metric
Even if we think that this mAP calculation in YOLOv5/Detectron/MMDetection is incorrect, it allows for a fair comparison for custom datasets.

@AlexeyAB AlexeyAB merged commit 55b90e1 into WongKinYiu:main Sep 16, 2022
@akashAD98
Copy link
Contributor

@AlexeyAB how can i get map of each class? like yolov4 darknet is showing map of each class

I tried

image

running the script but not able to get map of each class

I used this commnaad

!python test.py --data /content/gdrive/MyDrive/yolov7/data/custom_yolov7_data.yaml --img 640 --batch 24 --conf 0.50 --iou 0.65 --device 0 --weights /content/gdrive/MyDrive/yolov7/weights/best.pt --save-txt --save-hybrid --save-json --save-conf --augment --task val

@TusharChauhaan
Copy link

Bro go into the test.py file and make the changes.

nelioasousa pushed a commit to nelioasousa/yolov7 that referenced this pull request Apr 26, 2024
* Add YOLOv5 metric option

* Inform if using v5 metric
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.

4 participants