code: def test_rescale_height(self):
      data_info = dict(
          img=np.random.random((16, 25, 3)),
          gt_seg_map=np.random.random((16, 25, 3)),
          gt_bboxes=np.array([[0, 0, 10, 10]]),
          gt_keypoints=np.array([[[10, 10, 1]]]),
      )
      with self.assertRaises(AssertionError):
          RescaleToHeight(height=20.9)
      with self.assertRaises(AssertionError):
          RescaleToHeight(height=20, min_width=20.9)
      with self.assertRaises(AssertionError):
          RescaleToHeight(height=20, max_width=20.9)
      with self.assertRaises(AssertionError):
          RescaleToHeight(height=20, width_divisor=0.5)
      transform = RescaleToHeight(height=32)
      results = transform(copy.deepcopy(data_info))
      self.assertTupleEqual(results["img"].shape[:2], (32, 50))
      self.assertTupleEqual(results["scale"], (50, 32))
      self.assertTupleEqual(results["scale_factor"], (50 / 25, 32 / 16))
  
      # test min_width
      transform = RescaleToHeight(height=32, min_width=60)
      results = transform(copy.deepcopy(data_info))
      self.assertTupleEqual(results["img"].shape[:2], (32, 60))
      self.assertTupleEqual(results["scale"], (60, 32))
      self.assertTupleEqual(results["scale_factor"], (60 / 25, 32 / 16))
  
      # test max_width
      transform = RescaleToHeight(height=32, max_width=45)
      results = transform(copy.deepcopy(data_info))
      self.assertTupleEqual(results["img"].shape[:2], (32, 45))
      self.assertTupleEqual(results["scale"], (45, 32))
      self.assertTupleEqual(results["scale_factor"], (45 / 25, 32 / 16))
  
      # test width_divisor
      transform = RescaleToHeight(height=32, width_divisor=4)
      results = transform(copy.deepcopy(data_info))
      self.assertTupleEqual(results["img"].shape[:2], (32, 48))
      self.assertTupleEqual(results["scale"], (48, 32))
      self.assertTupleEqual(results["scale_factor"], (48 / 25, 32 / 16))
  
imports: import copy
  import unittest
  import numpy
  from parameterized import parameterized
  from mmocr.datasets.transforms import CropHeight, ImageContentJitter, PadToWidth, PyramidRescale, RescaleToHeight, ReversePixels, TextRecogGeneralAug
label_desc: Use image node_id 1 for calling the TestRescaleToHeight obj's underlying member method code with example usage: obj.test_rescale_height() without return types