code: def computeIoU(self, imgId, catId):
      p = self.params
      if p.useCats:
          gt = self._gts[imgId, catId]
          dt = self._dts[imgId, catId]
      else:
          gt = [_ for cId in p.catIds for _ in self._gts[imgId, cId]]
          dt = [_ for cId in p.catIds for _ in self._dts[imgId, cId]]
      if len(gt) == 0 and len(dt) == 0:
          return []
      inds = np.argsort([-d["score"] for d in dt], kind="mergesort")
      dt = [dt[i] for i in inds]
      if len(dt) > p.maxDets[-1]:
          dt = dt[0 : p.maxDets[-1]]
  
      if p.iouType == "segm":
          g = [g["segmentation"] for g in gt]
          d = [d["segmentation"] for d in dt]
      elif p.iouType == "bbox":
          g = [g["bbox"] for g in gt]
          d = [d["bbox"] for d in dt]
      else:
          raise Exception("unknown iouType for iou computation")
  
      # compute iou between each dt and gt region
      iscrowd = [int(o["iscrowd"]) for o in gt]
      ious = maskUtils.iou(d, g, iscrowd)
      return ious
  
imports: import numpy
  import datetime
  import time
  from collections import defaultdict
  from .None import mask
  import copy
label_desc: Use image node_id 4 for calling the COCOeval obj's underlying member method code with example usage: obj.computeIoU(imgId, catId) and returns: ious, list