code: def test_points2boundary(self):
      postprocessor = PANPostprocessor(text_repr_type="quad")
  
      # test invalid arguments
      with self.assertRaises(AssertionError):
          postprocessor._points2boundary([])
  
      points = np.array(
          [
              [0, 0],
              [1, 0],
              [2, 0],
              [0, 1],
              [1, 1],
              [2, 1],
              [0, 2],
              [1, 2],
              [2, 2],
          ]
      )
  
      # test quad
      postprocessor = PANPostprocessor(text_repr_type="quad")
  
      result = postprocessor._points2boundary(points)
      pred_poly = poly2shapely(result)
      target_poly = poly2shapely([2, 2, 0, 2, 0, 0, 2, 0])
      self.assertEqual(poly_iou(pred_poly, target_poly), 1)
  
      result = postprocessor._points2boundary(points, min_width=3)
      self.assertEqual(len(result), 0)
  
      # test poly
      postprocessor = PANPostprocessor(text_repr_type="poly")
      result = postprocessor._points2boundary(points)
      pred_poly = poly2shapely(result)
      target_poly = poly2shapely([0, 0, 0, 2, 2, 2, 2, 0])
      assert poly_iou(pred_poly, target_poly) == 1
  
file_path: mmocr/tests/test_models/test_textdet/test_postprocessors/test_pan_postprocessor.py
imports: import unittest
  import numpy
  import torch
  from parameterized import parameterized
  from mmocr.models.textdet.postprocessors import PANPostprocessor
  from mmocr.structures import TextDetDataSample
  from mmocr.utils import poly2shapely, poly_iou
label_desc: Use image node_id 2 for calling the TestPANPostprocessor obj's underlying member method code with example usage: obj.test_points2boundary() without return types