code: def id_to_rgb(id_map):
      if isinstance(id_map, np.ndarray):
          id_map_copy = id_map.copy()
          rgb_shape = tuple(list(id_map.shape) + [3])
          rgb_map = np.zeros(rgb_shape, dtype=np.uint8)
          for i in range(3):
              rgb_map[..., i] = id_map_copy % 256
              id_map_copy //= 256
          return rgb_map
      color = []
      for _ in range(3):
          color.append(id_map % 256)
          id_map //= 256
      return color
  
imports: import io
  import pathlib
  import warnings
  from collections import defaultdict
  from typing import Dict, List, Optional, Set, Tuple, Union
  import numpy
  from PIL import Image
  from ...feature_extraction_utils import BatchFeature, FeatureExtractionMixin
  from ...image_utils import ImageFeatureExtractionMixin, is_torch_tensor
  from ...utils import TensorType, is_torch_available, logging
label_desc: Use image node_id 5 for calling a global function with example usage: id_to_rgb(id_map) and returns: color, rgb_map