'example results
[{"image_id": 42,
"category_id": 18,
"bbox": [258.15,41.29,348.26,243.78],
"score": 0.236}, ...]'

def _write_coco_results(self, detections, res_file):

    results = []
    for (cls_ind, cls) in enumerate(self.classes):
        if (cls == '__background__'):
            continue
        logger.info(('collecting    %s    results    (%d/%d)' % (cls, cls_ind, (self.num_classes - 1))))
        coco_cat_id = self._class_to_coco_ind[cls]
        results.extend(self._coco_results_one_category(detections[cls_ind], coco_cat_id))
    logger.info(('writing    results    json    to    %s' % res_file))
    with open(res_file, 'w') as f:
        json.dump(results, f, sort_keys=True, indent=4)
