Skip to main content

No project description provided

Project description


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.


For our use case with a test dataset of 1500 images that contains up to 2000 instances per image we saw up to a 100x faster evaluation using fast-coco-eval (FCE) compared to the original pycocotools code.

Seg eval pycocotools 4 hours 
Seg eval FCE: 2.5 min

BBox eval pycocotools: 4 hours 
BBox eval FCE: 2 min

Getting started


pip install fast-coco-eval

If you clone the repo and install it locally, the following command is recommended

pip install -e .

given that you are in the fast-coco-eval directory. There seem to be an issue with loading the C++ extensions when installing it from the root directory without the -e flag.


This package contains a faster implementation of the pycocotools COCOEval class. Due to torch being used to compile and access the C++ code, it needs to be imported before using the package. To import and use COCOeval_fast type:

import torch
from fast_coco_eval import COCOeval_fast

For usage, look at the original COCOEval class documentation.


  • pytorch>=1.5
  • pycocotools
  • pybind11
  • numpy

It would be nice to decouple it from the pytorch build tool for the c++ compilation.


  • <input type="checkbox" checked="" disabled="" /> Wrap c++ code
  • <input type="checkbox" checked="" disabled="" /> Get it to compile
  • <input type="checkbox" checked="" disabled="" /> Add COCOEval class wraper
  • <input type="checkbox" checked="" disabled="" /> Remove detectron2 dependencies
  • <input type="checkbox" disabled="" /> Check if it works on windows
  • <input type="checkbox" disabled="" /> Remove torch dependencies


Distributed under the apache version 2.0 license, see license for more information. © 2021 Sartorius AG

Project details

Release history Release notifications | RSS feed

This version


Download files

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

Files for fast-coco-eval, version 1.0
Filename, size File type Python version Upload date Hashes
Filename, size fast-coco-eval-1.0.tar.gz (11.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page