docstr: Args:
      results(list[dict]): results in coco format
  Returns:
      dict: the evaluation metrics
docstr_tok: ["Args",":","results","(","list","[","dict","]",")",":","results","in","coco","format","Returns",":","dict",":","the","evaluation","metrics"]
code: def print_coco_metrics(self, results):
      """
      Args:
          results(list[dict]): results in coco format
      Returns:
          dict: the evaluation metrics
      """
      from pycocotools.cocoeval import COCOeval
  
      ret = {}
      has_mask = (
          "segmentation" in results[0]
      )  # results will be modified by loadRes
  
      cocoDt = self.coco.loadRes(results)
      cocoEval = COCOeval(self.coco, cocoDt, "bbox")
      cocoEval.evaluate()
      cocoEval.accumulate()
      cocoEval.summarize()
      fields = [
          "IoU=0.5:0.95",
          "IoU=0.5",
          "IoU=0.75",
          "small",
          "medium",
          "large",
      ]
      for k in range(6):
          ret["mAP(bbox)/" + fields[k]] = cocoEval.stats[k]
  
      if len(results) > 0 and has_mask:
          cocoEval = COCOeval(self.coco, cocoDt, "segm")
          cocoEval.evaluate()
          cocoEval.accumulate()
          cocoEval.summarize()
          for k in range(6):
              ret["mAP(segm)/" + fields[k]] = cocoEval.stats[k]
      return ret
  
file_path: tensorpack/examples/FasterRCNN/dataset/coco.py
imports: import json
  import numpy
  import os
  import tqdm
  from tensorpack.utils import logger
  from tensorpack.utils.timer import timed_operation
  from config import config
  from dataset import DatasetRegistry, DatasetSplit
label_desc: Use image node_id 2 for calling the COCODetection obj's underlying member method code with example usage: obj.print_coco_metrics(results) and returns: ret