code: def test_draw_binary_mask(self):
      img, boxes, _, _, masks = self._random_data()
      img[:, :, 0] = 0  # remove red color
      mask = masks[0]
      mask_with_hole = np.zeros_like(mask).astype("uint8")
      mask_with_hole = cv2.rectangle(
          mask_with_hole, (10, 10), (50, 50), 1, 5
      )
  
      for m in [mask, mask_with_hole]:
          for save in [True, False]:
              v = Visualizer(img)
              o = v.draw_binary_mask(m, color="red", text="test")
              if save:
                  with tempfile.TemporaryDirectory(
                      prefix="detectron2_viz"
                  ) as d:
                      path = os.path.join(d, "output.png")
                      o.save(path)
                      o = cv2.imread(path)[:, :, ::-1]
              else:
                  o = o.get_image().astype("float32")
                  # red color is drawn on the image
              self.assertTrue(o[:, :, 0].sum() > 0)
  
imports: import numpy
  import os
  import tempfile
  import unittest
  import cv2
  import torch
  from detectron2.data import MetadataCatalog
  from detectron2.structures import BoxMode, Instances, RotatedBoxes
  from detectron2.utils.visualizer import ColorMode, Visualizer
label_desc: Use image node_id 13 for calling the TestVisualizer obj's underlying member method code with example usage: obj.test_draw_binary_mask() without return types