ultralytics / yolov5

YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
50.72k stars 16.34k forks source link

Is the rule of P calculation in metrics from PASCAl VOC? #12269

Closed zhoujiawei3 closed 1 year ago

zhoujiawei3 commented 1 year ago

Search before asking

Question

When I run val.py, I can get P,R,map@50,map@0.5-0.95。I want to know is the rule of calculating P from PASCAl VOC?If it isn‘t,where is the rule from

Additional

No response

github-actions[bot] commented 1 year ago

👋 Hello @zhoujiawei3, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.

If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.

Requirements

Python>=3.8.0 with all requirements.txt installed including PyTorch>=1.8. To get started:

git clone https://github.com/ultralytics/yolov5  # clone
cd yolov5
pip install -r requirements.txt  # install

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

YOLOv5 CI

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training, validation, inference, export and benchmarks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

Introducing YOLOv8 🚀

We're excited to announce the launch of our latest state-of-the-art (SOTA) object detection model for 2023 - YOLOv8 🚀!

Designed to be fast, accurate, and easy to use, YOLOv8 is an ideal choice for a wide range of object detection, image segmentation and image classification tasks. With YOLOv8, you'll be able to quickly and accurately detect objects in real-time, streamline your workflows, and achieve new levels of accuracy in your projects.

Check out our YOLOv8 Docs for details and get started with:

pip install ultralytics
glenn-jocher commented 1 year ago

@zhoujiawei3 the calculation of precision (P) in YOLOv5's metrics is not based on the PASCAL VOC criteria. The specific rule used for calculating precision in YOLOv5 can be found in the Ultralytics team's implementation.

If you have any further questions or need more information, feel free to ask.

zhoujiawei3 commented 1 year ago

@glenn-jocher Thanks for your answer!In the Ultralytics team's implementation, they choose the confidence which can let F1 be the maximum to decide the value of the precision to print. I really want to know whether the specific rule used for caluculating precision in YOLO is a generic approach in object detection area? Or this is your own way to get the value of precision. I ask this because I see P@0.5 in some papers, but they don't tell the details about how to caluculate it.
And I also want to know whether the calculation of mAP@0.5 in YOLOv5's metrics is based on the PASCAL VOC criteria. Really thanks for your help!!!!

glenn-jocher commented 1 year ago

@zhoujiawei3 The specific rule used for calculating precision in YOLOv5's metrics is not a generic approach in the object detection area. It is an implementation choice made by the Ultralytics team to optimize the maximum F1 score. The calculation of precision in YOLOv5 is not directly comparable to other metrics like P@0.5 mentioned in some papers.

Regarding mAP@0.5 in YOLOv5's metrics, it is not based on the PASCAL VOC criteria. The calculation of mAP in YOLOv5 is also different from the conventional PASCAL VOC mAP. The exact formula used for calculating mAP in YOLOv5 can be found in the Ultralytics team's implementation.

I hope this clarifies your doubts. If you have any more questions or need further assistance, please let me know.

zhoujiawei3 commented 1 year ago

really thanks !!! Your explanation help me a lot !

glenn-jocher commented 1 year ago

@zhoujiawei3 you're welcome! I'm glad I could help. If you have any more questions or need further clarification, feel free to ask.