code: def get_pseudo_color_map(pred, color_map=None):
      """
      Get the pseudo color image.
  
      Args:
          pred (numpy.ndarray): the origin predicted image, H*W .
          color_map (list, optional): the palette color map. Default: None,
              use paddleseg's default color map.
  
      Returns:
          (numpy.ndarray): the pseduo image.
      """
      if len(pred.shape) > 2:
          pred = np.squeeze(pred)
  
      pred_mask = PIL.Image.fromarray(pred.astype(np.uint8), mode="P")
      color_map = get_color_map_list(19)
      pred_mask.putpalette(color_map)
      return pred_mask
  
file_path: PaddleSeg/contrib/DomainAdaptation/utils/utils.py
imports: import paddle
  import os
  import cv2
  import imageio
  import numpy
  from paddleseg.utils import logger
  import PIL
label_desc: Use image node_id 4 for calling a global function with example usage: get_pseudo_color_map(pred, color_map) and returns: pred_mask