Skip to content

This is a C++ implementation of cocoapi bbox evaluation code.

Notifications You must be signed in to change notification settings

imyhxy/ccocotools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fast COCOApi for COCO bbox task

This repository just copy and paste PythonAPI from the official cocoapi, merge the C++ implementation of COCOeval in detectron2 into FastCOCOeval. Simplify all unnecessary requirements and make it easy to install.

Installation

  • Install from local:

    git clone https://github.com/imyhxy/ccocotools
    cd ccocotools && python setup.py install
  • Install from Github:

    pip install git+https://github.com/imyhxy/ccocotools

Usage

from ccocotools.coco import COCO
from ccocotools.fastcocoeval import FastCOCOeval

gt_json = 'instance_val2017.json'
pd_json = 'predictions.json'

anno = COCO(gt_json)
pred = anno.loadRes(pd_json)
coco_eval = FastCOCOeval(anno, pred, 'bbox')
coco_eval.evaluate()
coco_eval.accumulate()
coco_eval.summarize()

Performance

The C++ implementation reduces 75% total time compares to the python one.

Implementation evaluate() accumulate() summarize() Total
Python 73.0s 15.4s 3.6ms 92.0s
C++ 16.4s 2.5s 3.9ms 22.8s

Reference

About

This is a C++ implementation of cocoapi bbox evaluation code.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published