def getpallete(self, num_cls):
        """
        this function is to get the colormap for visualizing the segmentation mask
        :param num_cls: the number of visulized class
        :return: the pallete
        """
        n = num_cls
        pallete_raw = np.zeros((n, 3)).astype('uint8')
        pallete = np.zeros((n, 3)).astype('uint8')

        pallete_raw[6, :] =  [111,  74,   0]
        pallete_raw[7, :] =  [ 81,   0,  81]
        pallete_raw[8, :] =  [128,  64, 128]
        pallete_raw[9, :] =  [244,  35, 232]
        pallete_raw[10, :] =  [250, 170, 160]
        pallete_raw[11, :] = [230, 150, 140]
        pallete_raw[12, :] = [ 70,  70,  70]
        pallete_raw[13, :] = [102, 102, 156]
        pallete_raw[14, :] = [190, 153, 153]
        pallete_raw[15, :] = [180, 165, 180]
        pallete_raw[16, :] = [150, 100, 100]
        pallete_raw[17, :] = [150, 120,  90]
        pallete_raw[18, :] = [153, 153, 153]
        pallete_raw[19, :] = [153, 153, 153]
        pallete_raw[20, :] = [250, 170,  30]
        pallete_raw[21, :] = [220, 220,   0]
        pallete_raw[22, :] = [107, 142,  35]
        pallete_raw[23, :] = [152, 251, 152]
        pallete_raw[24, :] = [ 70, 130, 180]
        pallete_raw[25, :] = [220,  20,  60]
        pallete_raw[26, :] = [255,   0,   0]
        pallete_raw[27, :] = [  0,   0, 142]
        pallete_raw[28, :] = [  0,   0,  70]
        pallete_raw[29, :] = [  0,  60, 100]
        pallete_raw[30, :] = [  0,   0,  90]
        pallete_raw[31, :] = [  0,   0, 110]
        pallete_raw[32, :] = [  0,  80, 100]
        pallete_raw[33, :] = [  0,   0, 230]
        pallete_raw[34, :] = [119,  11,  32]

        train2regular = [7, 8, 11, 12, 13, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 31, 32, 33]

        for i in range(len(train2regular)):
            pallete[i, :] = pallete_raw[train2regular[i]+1, :]

        pallete = pallete.reshape(-1)

        return pallete

        this function is to get the colormap for visualizing the segmentation mask
        :param num_cls: the number of visulized class
        :return: the pallete
        
lib/dataset/cityscape.py