code: def setUp(self):
      img = np.zeros((15, 30, 3))
      img_shape = (15, 30)
      polygons = [
          np.array([10.0, 5.0, 20.0, 5.0, 20.0, 10.0, 10.0, 10.0]),
          np.array(
              [10.0, 5.0, 20.0, 5.0, 20.0, 10.0, 10.0, 10.0, 8.0, 7.0]
          ),
      ]
      ignores = np.array([True, False])
      bboxes = np.array(
          [[10.0, 5.0, 20.0, 10.0], [0.0, 0.0, 10.0, 10.0]]
      )
      self.data_info_ocr = dict(
          img=img,
          gt_polygons=polygons,
          gt_bboxes=bboxes,
          img_shape=img_shape,
          gt_ignored=ignores,
      )
  
      _polygons = [[polygon] for polygon in polygons]
      masks = PolygonMasks(_polygons, *img_shape)
      self.data_info_det_polygon = dict(
          img=img,
          gt_masks=masks,
          gt_bboxes=bboxes,
          gt_ignore_flags=ignores,
          img_shape=img_shape,
      )
  
      masks = masks.to_bitmap()
      self.data_info_det_mask = dict(
          img=img,
          gt_masks=masks,
          gt_bboxes=bboxes,
          gt_ignore_flags=ignores,
          img_shape=img_shape,
      )
  
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 1 for calling the TestMMDet2MMOCR obj's underlying member method code with example usage: obj.setUp() without return types