code: def draw_mask(im, mask, alpha=0.5, color=None):
      """
      Overlay a mask on top of the image.
  
      Args:
          im: a 3-channel uint8 image in BGR
          mask: a binary 1-channel image of the same size
          color: if None, will choose automatically
      """
      if color is None:
          color = PALETTE_RGB[np.random.choice(len(PALETTE_RGB))][::-1]
      color = np.asarray(color, dtype=np.float32)
      im = np.where(
          np.repeat((mask > 0)[:, :, None], 3, axis=2),
          im * (1 - alpha) + color * alpha,
          im,
      )
      im = im.astype("uint8")
      return im
  
file_path: tensorpack/examples/FasterRCNN/viz.py
imports: import numpy
  from tensorpack.utils import viz
  from tensorpack.utils.palette import PALETTE_RGB
  from config import config
  from utils.np_box_ops import area
  from utils.np_box_ops import iou
  from common import polygons_to_mask
label_desc: Use image node_id 6 for calling a global function with example usage: draw_mask(im, mask, alpha, color) and returns: im