Skip to main content

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.3

v1.3.2

  • rework math_matches function. moved to faster_eval_api
  • Moved calculations from python to c++
  • Separated extra classes
  • Added new sample data
  • append mIoU based on TP pred.
  • append mAUC based on Coco pre/rec.

v1.3.1

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

faster-coco-eval-1.3.3.tar.gz (126.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

faster_coco_eval-1.3.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (598.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

faster_coco_eval-1.3.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (557.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

faster_coco_eval-1.3.3-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (561.7 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

faster_coco_eval-1.3.3-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (571.6 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

faster_coco_eval-1.3.3-cp37-cp37m-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (538.3 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file faster-coco-eval-1.3.3.tar.gz.

File metadata

  • Download URL: faster-coco-eval-1.3.3.tar.gz
  • Upload date:
  • Size: 126.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for faster-coco-eval-1.3.3.tar.gz
Algorithm Hash digest
SHA256 cf27e0ee9b8ec5dd3d85ff21d5e55c7697fa8d26b24ed6fce61af352d1fe13b5
MD5 6be5d6a35029c09f5e6c4410d18bb686
BLAKE2b-256 1881a1998fd5cfb0fd9277654b747901c0912ab56a175edb2c0688221a0a01ce

See more details on using hashes here.

File details

Details for the file faster_coco_eval-1.3.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for faster_coco_eval-1.3.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 51884a56b6bf1a0a3db221e70b1071c7769d261184ac7a438713c6c5f9351191
MD5 eebfb913b4a8791e87f36d8bb298bf86
BLAKE2b-256 2e9094dad714fe2bea4ab6bad34db7feb80c6e5d9fd88970024fccac09ce6bb7

See more details on using hashes here.

File details

Details for the file faster_coco_eval-1.3.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for faster_coco_eval-1.3.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 603457376467b3a31cdd168799a5b046f01087d6abe772e9c850b92b9f83ae54
MD5 e1532abf761f9e65840c2b81be8dae97
BLAKE2b-256 b2b4b5ad42eb1b66445f62eb0eb313ecfec1b1cd866e03f78ab171fb995c3d12

See more details on using hashes here.

File details

Details for the file faster_coco_eval-1.3.3-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for faster_coco_eval-1.3.3-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 780a5a082cf9ef1536a2b05344c252bb43ecec68f4c6341e36ed9aae71e7ea08
MD5 693d7dbea123da47a19b520109480919
BLAKE2b-256 ecaeb4048180d19b791f0de7b5d8a6e779296c36707a30e5e1e6ae3f0acc4722

See more details on using hashes here.

File details

Details for the file faster_coco_eval-1.3.3-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for faster_coco_eval-1.3.3-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 28c990086ebe3866a73f9420c848ad3378143ba6ddd19852034fd4dc91305e0d
MD5 5733b2af434c38ed7831f1917bef8c1f
BLAKE2b-256 15788bbba5de5bb0f48e598e7da0ee59c5c59cb88ab77d1e8d04cc49f6c65cce

See more details on using hashes here.

File details

Details for the file faster_coco_eval-1.3.3-cp37-cp37m-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for faster_coco_eval-1.3.3-cp37-cp37m-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c131c0ad2bb23440647966b1e3f4e3709780e8ccac887b2d9d78fc5adc417aa1
MD5 89dd9572b82620c6c2ef5720af303497
BLAKE2b-256 cd8310665d865aee20e42fbd7a4789502423c2475266e626c8e2aa7fbd24c167

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page