def __call__(self, panoptic):
        """Generates the instance target.

        Args:
            panoptic (np.ndarray): Colored image encoding panoptic label.

        Returns:
            A dictionary with fields:
                - instance: Tensor, shape=(H, W). 0 is background. 1, 2, 3 ... is instance, so it is class agnostic.
        """
        panoptic = self.rgb2id(panoptic)
        instance = np.zeros_like(panoptic, dtype=np.int64)
        ids = np.unique(panoptic)
        ins_id = 1
        for i, id in enumerate(ids):
            if id > 1000:
                instance[panoptic == id] = ins_id
                ins_id += 1

        return dict(instance=instance)
Generates the instance target.

        Args:
            panoptic (np.ndarray): Colored image encoding panoptic label.

        Returns:
            A dictionary with fields:
                - instance: Tensor, shape=(H, W). 0 is background. 1, 2, 3 ... is instance, so it is class agnostic.
        
contrib/PanopticDeepLab/transforms/target_transforms.py