code: def __init__(
      self,
      num_classes,
      overlaps=0.5,
      thing_ids=None,
      label_divisor=1000,
      ignore_index=255,
  ):
      super().__init__()
      self.num_classes = num_classes
      if isinstance(overlaps, float):
          overlaps = [overlaps]
      self.overlaps = overlaps
      self.y_true = [
          [np.empty(0) for _i in range(len(overlaps))]
          for _j in range(num_classes)
      ]
      self.y_score = [
          [np.empty(0) for _i in range(len(overlaps))]
          for _j in range(num_classes)
      ]
      self.hard_fns = [[0] * len(overlaps) for _ in range(num_classes)]
  
      if thing_ids is None:
          self.thing_ids = list(range(num_classes))
      else:
          self.thing_ids = thing_ids
  
      self.label_divisor = label_divisor
      self.ignore_index = ignore_index
  
file_path: PaddleSeg/contrib/PanopticSeg/paddlepanseg/utils/evaluation/ins_seg_evaluator.py
imports: from collections import defaultdict
  import numpy
  from paddlepanseg.cvlibs import build_info_dict
  from paddlepanseg.utils import decode_pan_id, is_crowd
  from .evaluator import Evaluator
label_desc: Use image node_id 1 to create a new InsSegEvaluator object from inherited base classes: Evaluator with example: obj = InsSegEvaluator(num_classes, overlaps, thing_ids, label_divisor, ignore_index)