code: def test_border_mask_with_holes(self):
      H, W = 200, 200
      img = np.zeros((H, W, 3))
      img[:, :, 0] = 255.0
      v = Visualizer(img, scale=3)
  
      mask = np.zeros((H, W))
      mask[:, 100:150] = 1
      # create a hole, to trigger imshow
      mask = cv2.rectangle(
          mask, (110, 110), (130, 130), 0, thickness=-1
      )
      output = v.draw_binary_mask(mask, color="blue")
      output = output.get_image()[:, :, ::-1]
  
      first_row = {tuple(x.tolist()) for x in output[0]}
      last_row = {tuple(x.tolist()) for x in output[-1]}
      # Check quantization / off-by-1 error: the first and last row must have two colors
      self.assertEqual(len(last_row), 2)
      self.assertEqual(len(first_row), 2)
      self.assertIn((0, 0, 255), last_row)
      self.assertIn((0, 0, 255), first_row)
  
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 15 for calling the TestVisualizer obj's underlying member method code with example usage: obj.test_border_mask_with_holes() without return types