code: def transform_labels(
      labels,
      buffer,
      disco=False,
      colorful_name=False,
      colorful_object=False,
      bounding_boxes=False,
  ):
      rgb_buffer = np.stack([buffer] * 3, axis=2)
  
      # Walls and floor
      if disco:
          rgb_buffer[buffer == wall_id] = get_random_color()
          rgb_buffer[buffer == floor_id] = get_random_color()
      else:
          rgb_buffer[buffer == wall_id] = wall_color
          rgb_buffer[buffer == floor_id] = floor_color
  
      if not (
          disco or colorful_name or colorful_object or bounding_boxes
      ):
          return rgb_buffer
      for label in labels:
          if disco:
              color = get_random_color()
          elif colorful_name:
              name = label.object_name
              if name not in name_to_color_map:
                  name_to_color_map[name] = get_random_color()
              color = name_to_color_map[name]
          elif colorful_object:
              if label.object_name == "DoomPlayer":
                  color = name_to_color_map[label.object_name]
              else:
                  if label.object_id not in id_to_color_map:
                      id_to_color_map[
                          label.object_id
                      ] = get_random_color()
                  color = id_to_color_map[label.object_id]
          else:
              color = [label.value] * 3
  
          rgb_buffer[buffer == label.value, :] = color
  
          if bounding_boxes:
              draw_bounding_box(
                  rgb_buffer,
                  label.x,
                  label.y,
                  label.width,
                  label.height,
                  color,
              )
              font = cv2.FONT_HERSHEY_SIMPLEX
              cv2.putText(
                  rgb_buffer,
                  label.object_name,
                  (label.x, label.y - 3),
                  font,
                  0.3,
                  [int(c) for c in color],
                  1,
                  cv2.LINE_AA,
              )
  
      return rgb_buffer
  
file_path: ViZDoom/scripts/create_buffers_gif.py
imports: import os
  from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser
  from random import randint
  import cv2
  import imageio
  import numpy
  from tqdm import tqdm
  import vizdoom
  from vizdoom import AutomapMode, DoomGame, Mode, ScreenFormat, ScreenResolution
label_desc: Use image node_id 4 for calling a global function with example usage: transform_labels(labels, buffer, disco, colorful_name, colorful_object, bounding_boxes) and returns: rgb_buffer, rgb_buffer