code: def test_bbox2poly(self):
      # mode: xyxy
      # test np.array
      self.assertTrue(
          np.array_equal(bbox2poly(self.box_array), self.gt_xyxy)
      )
      # test list
      self.assertTrue(
          np.array_equal(bbox2poly(self.box_list), self.gt_xyxy)
      )
      # test tensor
      self.assertTrue(
          np.array_equal(bbox2poly(self.box_tensor), self.gt_xyxy)
      )
  
      # mode: xywh
      # test np.array
      self.assertTrue(
          np.array_equal(
              bbox2poly(self.box_array, mode="xywh"), self.gt_xywh
          )
      )
      # test list
      self.assertTrue(
          np.array_equal(
              bbox2poly(self.box_list, mode="xywh"), self.gt_xywh
          )
      )
      # test tensor
      self.assertTrue(
          np.array_equal(
              bbox2poly(self.box_tensor, mode="xywh"), self.gt_xywh
          )
      )
  
      # invalid mode
      with self.assertRaises(NotImplementedError):
          bbox2poly(self.box_tensor, mode="a")
  
imports: import unittest
  import numpy
  import torch
  from mmocr.utils import bbox2poly, bbox_center_distance, bbox_diag_distance, bezier2polygon, is_on_same_line, rescale_bbox, rescale_bboxes, stitch_boxes_into_lines
  from mmocr.utils.bbox_utils import bbox_jitter
label_desc: Use image node_id 2 for calling the TestBbox2poly obj's underlying member method code with example usage: obj.test_bbox2poly() without return types