code: def construct_toy_data(poly2mask, use_box_type=False):
      img = np.array(
          [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]], dtype=np.uint8
      )
      img = np.stack([img, img, img], axis=-1)
      results = dict()
      results["img"] = img
      results["img_shape"] = img.shape[:2]
      if use_box_type:
          results["gt_bboxes"] = HorizontalBoxes(
              np.array([[1, 0, 2, 2]], dtype=np.float32)
          )
      else:
          results["gt_bboxes"] = np.array(
              [[1, 0, 2, 2]], dtype=np.float32
          )
      results["gt_bboxes_labels"] = np.array([13], dtype=np.int64)
      if poly2mask:
          gt_masks = np.array(
              [[0, 1, 0, 0], [0, 1, 1, 0], [0, 1, 0, 0]], dtype=np.uint8
          )[None, :, :]
          results["gt_masks"] = BitmapMasks(gt_masks, 3, 4)
      else:
          raw_masks = [[np.array([1, 2, 1, 0, 2, 1], dtype=np.float32)]]
          results["gt_masks"] = PolygonMasks(raw_masks, 3, 4)
      results["gt_ignore_flags"] = np.array(np.array([1], dtype=bool))
      results["gt_seg_map"] = np.array(
          [
              [255, 13, 255, 255],
              [255, 13, 13, 255],
              [255, 13, 255, 255],
          ],
          dtype=np.uint8,
      )
      return results
  
file_path: mmdetection/tests/test_datasets/test_transforms/utils.py
imports: import numpy
  from mmengine.testing import assert_allclose
  from mmdet.structures.bbox import BaseBoxes, HorizontalBoxes
  from mmdet.structures.mask import BitmapMasks, PolygonMasks
label_desc: Use image node_id 3 for calling a global function with example usage: construct_toy_data(poly2mask, use_box_type) and returns: results