code: def test_ocr2det_bitmapmasks(self):
      transform = MMOCR2MMDet(poly2mask=True)
      results = transform(self.data_info_ocr.copy())
      self.assertEqual(results["img"].shape, (15, 30, 3))
      self.assertEqual(results["img_shape"], (15, 30))
      self.assertTrue(
          poly2shapely(
              bitmap_to_polygon(results["gt_masks"].masks[0])[0][
                  0
              ].flatten()
          ).equals(
              poly2shapely(
                  bitmap_to_polygon(
                      self.data_info_det_mask["gt_masks"].masks[0]
                  )[0][0].flatten()
              )
          )
      )
  
      self.assertTrue(
          np.allclose(
              results["gt_bboxes"], self.data_info_det_mask["gt_bboxes"]
          )
      )
      self.assertTrue(
          np.allclose(
              results["gt_ignore_flags"],
              self.data_info_det_mask["gt_ignore_flags"],
          )
      )
  
file_path: mmocr/tests/test_datasets/test_transforms/test_adapters.py
imports: import unittest
  import numpy
  from mmdet.structures.mask import PolygonMasks, bitmap_to_polygon
  from mmocr.datasets import MMDet2MMOCR, MMOCR2MMDet, Resize
  from mmocr.utils import poly2shapely
label_desc: Use image node_id 3 for calling the TestMMDet2MMOCR obj's underlying member method code with example usage: obj.test_ocr2det_bitmapmasks() without return types