#! /usr/bin/env python

from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
import os.path as osp
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('--gt', required=True, help='Ground truth.')
parser.add_argument('--dt', required=True, help='Detection.')

args = parser.parse_args()

def main():
    cocoGt = COCO(args.gt)
    cocoDt = cocoGt.loadRes(args.dt)
    cocoEval = COCOeval(cocoGt, cocoDt, 'bbox')
    cocoEval.evaluate()
    cocoEval.accumulate()
    cocoEval.summarize()

if __name__ == '__main__':
    main()
