class_docstr: Refer to 'https://github.com/mcordts/cityscapesScripts/blob/master/cityscapesscripts/evaluation/evalInstanceLevelSemanticLabeling.py'
  Calculate the matching results of each image, each class, each IoU, and then get the final
  matching results of each class and each IoU of dataset. Base on the matching results, the AP
  and mAP can be calculated.
  we need two vectors for each class and for each overlap
  The first vector (y_true) is binary and is 1, where the ground truth says true,
  and is 0 otherwise.
  The second vector (y_score) is float [0...1] and represents the confidence of
  the prediction.
  We represent the following cases as:
                                        | y_true |   y_score
    gt instance with matched prediction |    1   | confidence
    gt instance w/o  matched prediction |    1   |     0.0
           false positive prediction    |    0   | confidence
  The current implementation makes only sense for an overlap threshold >= 0.5,
  since only then, a single prediction can either be ignored or matched, but
  never both. Further, it can never match to two gt instances.
  For matching, we vary the overlap and do the following steps:
    1.) remove all predictions that satisfy the overlap criterion with an ignore region (either void or *group)
    2.) remove matches that do not satisfy the overlap
    3.) mark non-matched predictions as false positive
  In the processing, 0 represent the first class of 'thing'. So the label will less 1 than the dataset.
  
  Args:
      num_classes (int): The unique number of target classes. Exclude background class, labeled 0 usually.
      overlaps (float|list, optional): The threshold of IoU. Default: 0.5.
      thing_list (list|None, optional): Thing class, only calculate AP for the thing class. Default: None.
docstr: calculate map for all classes
code: def cal_map(self):
      """
      calculate map for all classes
      """
      self.cal_ap()
      valid_ap = [self.ap[i] for i in self.thing_list]
      map = np.mean(valid_ap)
      self.map = map
  
      return map
  
file_path: PaddleSeg/contrib/PanopticDeepLab/utils/evaluation/instance.py
imports: from collections import defaultdict, OrderedDict
  import numpy
label_desc: Use image node_id 5 for calling the InstanceEvaluator obj's underlying member method code with example usage: obj.cal_map() and returns: map