code: def plot_mask(img, masks, alpha=0.5):
      """Visualize segmentation mask.
  
      Parameters
      ----------
      img : numpy.ndarray or mxnet.nd.NDArray
          Image with shape `H, W, 3`.
      masks : numpy.ndarray or mxnet.nd.NDArray
          Binary images with shape `N, H, W`.
      alpha : float, optional, default 0.5
          Transparency of plotted mask
  
      Returns
      -------
      numpy.ndarray
          The image plotted with segmentation masks
  
      """
      if isinstance(img, mx.nd.NDArray):
          img = img.asnumpy()
      if isinstance(masks, mx.nd.NDArray):
          masks = masks.asnumpy()
  
      for mask in masks:
          color = np.random.random(3) * 255
          mask = np.repeat(
              (mask > 0)[:, :, np.newaxis], repeats=3, axis=2
          )
          img = np.where(mask, img * (1 - alpha) + color * alpha, img)
      return img.astype("uint8")
  
imports: from __future__ import absolute_import, division
  import numpy
  import mxnet
label_desc: Use image node_id 2 for calling a global function with example usage: plot_mask(img, masks, alpha) and returns: img