code: def get_color_pallete(npimg, dataset="pascal_voc"):
      """Visualize image.
  
      Parameters
      ----------
      npimg : numpy.ndarray
          Single channel image with shape `H, W, 1`.
      dataset : str, default: 'pascal_voc'
          The dataset that model pretrained on. ('pascal_voc', 'ade20k')
  
      Returns
      -------
      out_img : PIL.Image
          Image with color pallete
  
      """
      # recovery boundary
      if dataset in ("pascal_voc", "pascal_aug"):
          npimg[npimg == -1] = 255
      # put colormap
      if dataset == "ade20k":
          npimg = npimg + 1
          out_img = Image.fromarray(npimg.astype("uint8"))
          out_img.putpalette(adepallete)
          return out_img
      elif dataset == "citys":
          out_img = Image.fromarray(npimg.astype("uint8"))
          out_img.putpalette(cityspallete)
          return out_img
      elif dataset == "mhpv1":
          out_img = Image.fromarray(npimg.astype("uint8"))
          out_img.putpalette(mhpv1pallete)
          return out_img
      out_img = Image.fromarray(npimg.astype("uint8"))
      out_img.putpalette(vocpallete)
      return out_img
  
file_path: gluon-cv/gluoncv/utils/viz/segmentation.py
imports: from PIL import Image
  import mxnet
  from mxnet.gluon import HybridBlock
label_desc: Use image node_id 1 for calling a global function with example usage: get_color_pallete(npimg, dataset) and returns: out_img, out_img, out_img, out_img