code: def test_ocr2det_polygonmasks(self):
      transform = MMOCR2MMDet()
      results = transform(self.data_info_ocr.copy())
      self.assertEqual(results["img"].shape, (15, 30, 3))
      self.assertEqual(results["img_shape"], (15, 30))
      self.assertTrue(
          np.allclose(
              results["gt_masks"].masks[0][0],
              self.data_info_det_polygon["gt_masks"].masks[0][0],
          )
      )
      self.assertTrue(
          np.allclose(
              results["gt_masks"].masks[0][0],
              self.data_info_det_polygon["gt_masks"].masks[0][0],
          )
      )
      self.assertTrue(
          np.allclose(
              results["gt_bboxes"],
              self.data_info_det_polygon["gt_bboxes"],
          )
      )
      self.assertTrue(
          np.allclose(
              results["gt_ignore_flags"],
              self.data_info_det_polygon["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 2 for calling the TestMMDet2MMOCR obj's underlying member method code with example usage: obj.test_ocr2det_polygonmasks() without return types