docstr: Convert the ground truth with format (h*w) to the format that satisfies the AP calculation.
  
  Args:
      seg_map (np.ndarray): the sementic segmentation map with shape H * W. Value is 0, 1, 2, ...
      ins_map (np.ndarray): the instance segmentation map with shape H * W. Value is 0, 1, 2, ...
  
  Returns:
      list: tuple list like: [(label, mask), ...]
docstr_tok: ["Convert","the","ground","truth","with","format","(","h","*","w",")","to","the","format","that","satisfies","the","AP","calculation",".","Args",":","seg_map","(","np.ndarray",")",":","the","sementic","segmentation","map","with","shape","H","*","W.","Value","is","0",",","1",",","2",",","...","ins_map","(","np.ndarray",")",":","the","instance","segmentation","map","with","shape","H","*","W.","Value","is","0",",","1",",","2",",","...","Returns",":","list",":","tuple","list","like",":","[","(","label",",","mask",")",",","...","]"]
code: def convert_gt_map(self, seg_map, ins_map):
      """
      Convert the ground truth with format (h*w) to the format that satisfies the AP calculation.
  
      Args:
          seg_map (np.ndarray): the sementic segmentation map with shape H * W. Value is 0, 1, 2, ...
          ins_map (np.ndarray): the instance segmentation map with shape H * W. Value is 0, 1, 2, ...
  
      Returns:
          list: tuple list like: [(label, mask), ...]
      """
      gts = []
      instance_cnt = np.unique(ins_map)
      for i in instance_cnt:
          if i == 0:
              continue
          mask = ins_map == i
          # Take the first one, since all pixels in the instance belong to the same class
          label = seg_map[mask][0]
          gts.append((label, mask.astype("int64")))
      return gts
  
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 7 for calling the InsSegEvaluator obj's underlying member method code with example usage: obj.convert_gt_map(seg_map, ins_map) and returns: gts