Faster interpretation of the original COCOEval
Project description
Faster-COCO-Eval
Disclaimer
I often use this project, but I saw it abandoned and without a public repository on github. Also, part of the project remained unfinished for a long time. I implemented some of the author's ideas and decided to make the results publicly available.
Faster-COCO-Eval base
This package wraps a facebook C++ implementation of COCO-eval operations found in the pycocotools package. This implementation greatly speeds up the evaluation time for coco's AP metrics, especially when dealing with a high number of instances in an image.
Comparison
For our use case with a test dataset of 5000 images from the coco val dataset. Testing was carried out using the mmdetection framework and the eval_metric.py script. The indicators are presented below.
Visualization of testing comparison.ipynb available in directory examples/comparison Tested with yolo3 model (bbox eval) and yoloact model (segm eval)
Type | COCOeval | COCOeval_faster | Profit |
---|---|---|---|
bbox | 18.477 sec. | 7.345 sec. | 2.5x faster |
segm | 29.819 sec. | 15.840 sec. | 2x faster |
Usage
This package contains a faster implementation of the
pycocotools COCOEval
class.
To import and use COCOeval_faster
type:
from faster_coco_eval import COCO, COCOeval_faster
....
For usage, look at the original COCOEval
class documentation.
Usage plot curves
from faster_coco_eval import COCO
from faster_coco_eval.extra import Curves
cocoGt = COCO(....)
cocoDt = cocoGt.loadRes(....)
cur = Curves(cocoGt, cocoDt, iou_tresh=0.5, iouType='segm')
cur.plot_pre_rec(plotly_backend=False)
Setup dependencies
- numpy
- plotly (optional if extra.Curve usage)
history
v1.3.1
- rework mask code
- change np.float to float (numpy deprecations)
v1.3.0
- remove pycocotools dependencies
- clean c/c++ code
v1.2.3
- Implemented of mean IoU for TP
- set FP-red FN-blue
v1.2.2
- Removed own implementation of pre-rec
- Switched to the implementation of pre-rec calculation from COCO eval
- Lost backward compatibility
- Implemented output fp/fn/tp + gt to pictures
v1.2.1
- bug fix with pre-rec curve
- rework error calc (tp/fp/fn)
- change image plot to plotly
- append docker auto builder
- append native iou calc (slow but accurate)
- rework auc calc with link
v1.1.3-v1.1.4
- rebuild plotly backend
- Segm bug-fix
v1.1.2
- Append fp fn error analysis via curves
- Append confusion matrix
- Append plotly backend support for ROC / AUC
v1.1.1
- Redesigned curves
- Reworked data preload
- Append csrc to setup
- Build sdist Package
v1.1.0
- Wrap c++ code
- Get it to compile
- Add COCOEval class wraper
- Remove detectron2 dependencies
- Remove torch dependencies
- Append unittest
- Append ROC / AUC curves
- Check if it works on windows
TODOs
- Remove pycocotools dependencies
- Remove matplotlib dependencies
License
The original module was licensed with apache 2, I will continue with the same license. Distributed under the apache version 2.0 license, see license for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for faster_coco_eval-1.3.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04f7a28d89eb489713750634ec8c3f5cb6844fd67541fcd06ef2cbe8a2e9ac25 |
|
MD5 | c1f830149de8b1e7c6ac3e6ebd8dfde8 |
|
BLAKE2b-256 | 7a7f9a6ff9727f26faabd91cda6aa36509b585f8f5117d94c791c894117be31e |
Hashes for faster_coco_eval-1.3.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3aff9271e48a8c7ca1cffd8235d480c461c5edd0421b2f4d2ec564fdd5d895e |
|
MD5 | 89d72c197a047523b8b8f811b0943ded |
|
BLAKE2b-256 | ae6a131fb6651edabb9d9153f3ade821b4e71dbf3b2f6c4665006ded11b27b04 |
Hashes for faster_coco_eval-1.3.1-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23bfd8b6011602875c394fc497c0b593e906a53192aac7b1939a6b70c4116e5c |
|
MD5 | 896a425d199b3bb285de196bdb6b0de7 |
|
BLAKE2b-256 | d8d7f4ca00ed0c3888bb2b78e4434c220aefef79305c41fd8b054aa8cafb8048 |
Hashes for faster_coco_eval-1.3.1-cp37-cp37m-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b75838542c5c500f9472caa6e91f3de59fd25d3b01d21d120cca5571b5cd2392 |
|
MD5 | 5fe306878a147a5e9784234b8f4bb38d |
|
BLAKE2b-256 | 63a2ca5d3caa9e77fa078b02978722f1bb210c353059cfc6149bbe86a13b2060 |