code: def create_coco_eval(
      records,
      preds,
      metric_type: str,
      iou_thresholds: Optional[Sequence[float]] = None,
      show_pbar: bool = False,
  ) -> COCOeval:
      assert len(records) == len(preds)
  
      for record, pred in zip(records, preds):
          pred.record_id = record.record_id
          pred.height = record.height
          pred.width = record.width
          # needs 'filepath' for mask `coco.py#418`
          pred.filepath = record.filepath
  
      target_ds = coco_api_from_records(records, show_pbar=show_pbar)
      pred_ds = coco_api_from_preds(preds, show_pbar=show_pbar)
  
      coco_eval = COCOeval(target_ds, pred_ds, metric_type)
      if iou_thresholds is not None:
          coco_eval.iouThrs = iou_thresholds
  
      return coco_eval
  
file_path: icevision/icevision/data/convert_records_to_coco_style.py
imports: from icevision.imports import *
  from icevision.utils import *
  from icevision.core import *
  from pycocotools.coco import COCO
  from pycocotools.cocoeval import COCOeval
  import json
  import numpy
  import PIL
label_desc: Use image node_id 5 for calling a global function with example usage: create_coco_eval(records, preds, metric_type, iou_thresholds, show_pbar) and returns: coco_eval