code: def random_color(rgb=False, maximum=255):
      """
      Reference: https://github.com/facebookresearch/detectron2/blob/master/detectron2/utils/colormap.py#L111
  
      Args:
          rgb (bool, optional): whether to return RGB colors or BGR colors. Default: False.
          maximum (int, optional): either 255 or 1. Default: 255.
  
      Returns:
          ndarray: a vector of 3 numbers
      """
      idx = np.random.randint(0, len(_COLORS))
      ret = _COLORS[idx] * maximum
      if not rgb:
          ret = ret[::-1]
      return ret
  
file_path: PaddleSeg/contrib/PanopticDeepLab/utils/visualize.py
imports: import os
  import cv2
  import numpy
  from PIL import Image
label_desc: Use image node_id 1 for calling a global function with example usage: random_color(rgb, maximum) and returns: ret