code: def setUp(self):
      h, w = 12, 10
      self.image = np.random.randint(0, 256, size=(h, w, 3)).astype(
          "uint8"
      )
      edge_labels = torch.rand((5, 5)) > 0.5
      # gt_instances
      data_sample = KIEDataSample()
      gt_instances_data = dict(
          bboxes=self._rand_bboxes(5, h, w),
          polygons=self._rand_polys(5, h, w),
          labels=torch.zeros(
              5,
          ),
          texts=["text1", "text2", "text3", "text4", "text5"],
          edge_labels=edge_labels,
      )
      gt_instances = InstanceData(**gt_instances_data)
      data_sample.gt_instances = gt_instances
  
      pred_instances_data = dict(
          bboxes=self._rand_bboxes(5, h, w),
          labels=torch.zeros(
              5,
          ),
          scores=torch.rand((5,)),
          texts=["text1", "text2", "text3", "text4", "text5"],
          edge_labels=edge_labels,
      )
      pred_instances = InstanceData(**pred_instances_data)
      data_sample.pred_instances = pred_instances
      data_sample = data_sample.numpy()
      self.data_sample = data_sample
  
file_path: mmocr/tests/test_visualization/test_kie_visualizer.py
imports: import os.path
  import tempfile
  import unittest
  import cv2
  import numpy
  import torch
  from mmengine.structures import InstanceData
  from mmocr.structures import KIEDataSample
  from mmocr.utils import bbox2poly
  from mmocr.visualization import KIELocalVisualizer
label_desc: Use image node_id 1 for calling the TestTextKIELocalVisualizer obj's underlying member method code with example usage: obj.setUp() without return types