code: def test_is_poly_invalid(self):
      # area < 1
      poly = np.array(
          [0, 0, 0.5, 0, 0.5, 0.5, 0, 0.5], dtype=np.float32
      )
      self.assertTrue(self.db_loss._is_poly_invalid(poly))
  
      # Sidelength < min_sidelength
      # area < 1
      poly = np.array(
          [0.5, 0.5, 2.5, 2.5, 2, 3, 0, 1], dtype=np.float32
      )
      self.assertTrue(self.db_loss._is_poly_invalid(poly))
  
      # A good enough polygon
      poly = np.array([0, 0, 10, 0, 10, 10, 0, 10], dtype=np.float32)
      self.assertFalse(self.db_loss._is_poly_invalid(poly))
  
file_path: mmocr/tests/test_models/test_textdet/test_module_losses/test_db_module_loss.py
imports: from unittest import TestCase
  import numpy
  import torch
  from mmengine.structures import InstanceData
  from mmocr.models.textdet.module_losses import DBModuleLoss
  from mmocr.structures import TextDetDataSample
label_desc: Use image node_id 2 for calling the TestDBModuleLoss obj's underlying member method code with example usage: obj.test_is_poly_invalid() without return types