MCPcopy
hub / github.com/msracver/Deformable-ConvNets / _do_python_eval

Method _do_python_eval

lib/dataset/coco.py:331–344  ·  view source on GitHub ↗
(self, res_file, res_folder, ann_type)

Source from the content-addressed store, hash-verified

329 json.dump(results, f, sort_keys=True, indent=4)
330
331 def _do_python_eval(self, res_file, res_folder, ann_type):
332 coco_dt = self.coco.loadRes(res_file)
333 coco_eval = COCOeval(self.coco, coco_dt)
334 coco_eval.params.useSegm = (ann_type == 'segm')
335 coco_eval.evaluate()
336 coco_eval.accumulate()
337 info_str = self._print_detection_metrics(coco_eval)
338
339 eval_file = os.path.join(res_folder, 'detections_%s_results.pkl' % self.image_set)
340 with open(eval_file, 'w') as f:
341 cPickle.dump(coco_eval, f, cPickle.HIGHEST_PROTOCOL)
342 print 'coco eval results saved to %s' % eval_file
343 info_str += 'coco eval results saved to %s\n' % eval_file
344 return info_str
345
346 def _print_detection_metrics(self, coco_eval):
347 info_str = ''

Callers 1

evaluate_detectionsMethod · 0.95

Calls 5

evaluateMethod · 0.95
accumulateMethod · 0.95
COCOevalClass · 0.85
loadResMethod · 0.80

Tested by

no test coverage detected