code: def overlay_davis(image, mask, alpha=0.5, palette=None):
      """Overlay segmentation on top of RGB image. from davis official"""
      result = image.copy()
      if mask is not None:
          if not palette:
              palette = get_palette(np.max(mask) + 1)
          palette = np.array(palette)
          rgb_mask = palette[mask.astype(np.uint8)]
          mask_region = (mask > 0).astype(np.uint8)
          result = (
              result * (1 - mask_region[:, :, np.newaxis])
              + (1 - alpha) * mask_region[:, :, np.newaxis] * result
              + alpha * rgb_mask
          )
          result = result.astype(np.uint8)
      return result
  
file_path: PaddleSeg/EISeg/eiseg/plugin/video/video_tools.py
imports: import glob
  import os
  import cv2
  import numpy
  import paddle
  import paddle.nn.functional
  from PIL import Image
  from eiseg.util.vis import get_palette
label_desc: Use image node_id 3 for calling a global function with example usage: overlay_davis(image, mask, alpha, palette) and returns: result