ultralytics / yolov5

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

eval mAP implemented in the repository lower than that of pycocotools? #4443

Closed anonymoussss closed 3 years ago

anonymoussss commented 3 years ago

❔Question

I am using yolov5m to train my custom dataset. When using val.py for validation, why is the evaluation map implemented in this repository lower than that of pycocotools? The specific output is as follows.

Additional context

Scanning 'val2017/labels.cache' images and labels.. Class Images Labels P R mAP@.5 mAP@.5:.95: 100%|█| 48/48 [00:19<00:00 all 1530 2011 0.948 0.924 0.929 0.775
Speed: 0.1ms pre-process, 2.5ms inference, 0.5ms NMS per image at shape (32, 3, 320, 320)

Evaluating pycocotools mAP... saving runs/test/exp18/best_predictions.json...
loading annotations into memory...
Done (t=0.07s)
creating index...
index created!
Loading and preparing results...
DONE (t=0.01s)
creating index...
index created!
Running per image evaluation...
Evaluate annotation type bbox
DONE (t=0.41s).
Accumulating evaluation results...
DONE (t=0.13s).
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.760
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.910 Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.817
Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.512
Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.643
Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.831
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.638
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.791
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.794
Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.555
Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.705
Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.858
Results saved to runs/test/exp18
1513 labels saved to runs/test/exp18/labels .

github-actions[bot] commented 3 years ago

👋 Hello @anonymoussss, 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 screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.

For business inquiries or professional support requests please visit https://ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com.

Requirements

Python>=3.6.0 with all requirements.txt installed including PyTorch>=1.7. To get started:

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

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

CI CPU testing

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

glenn-jocher commented 3 years ago

@anonymoussss see https://github.com/ultralytics/yolov5/issues/2258