def convert_gt_map(seg_map, ins_map):
        """
        Convet 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
            label = seg_map[mask][0]
            gts.append((label, mask.astype('int32')))
        return gts

        Convet 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), ...]
        
contrib/PanopticDeepLab/utils/evaluation/instance.py