code: def testResizeOnlyImage(self):
      # No min or max size, it doesn't change the image.
      resized_image, _, scale = self._resize_image(
          self._gen_image(100, 1024, 3)
      )
      self.assertAllEqual(resized_image.shape, (100, 1024, 3))
      self.assertAlmostEqual(scale, 1.0)
  
      # min and max sizes smaller and larger that original image size.
      resized_image, _, scal = self._resize_image(
          self._gen_image(100, 1024, 3), min_size=0, max_size=2000
      )
      self.assertAllEqual(resized_image.shape, (100, 1024, 3))
      self.assertAlmostEqual(scale, 1.0)
  
      # max_size only, slightly smaller than origin image size.
      resized_image, _, scale = self._resize_image(
          self._gen_image(100, 1024, 3), max_size=1000
      )
      self.assertAllEqual(resized_image.shape, (97, 1000, 3))
      self.assertAlmostEqual(int(scale * 100), 97)
  
      # min_size only, slightly bigger than origin image size.
      resized_image, _, scale = self._resize_image(
          self._gen_image(100, 1024, 3), min_size=120
      )
      self.assertAllEqual(resized_image.shape, (120, 1228, 3))
      self.assertAlmostEqual(int(scale * 100), 120)
  
      # max_size only, half image size
      resized_image, _, scale = self._resize_image(
          self._gen_image(100, 1024, 3), max_size=512
      )
      self.assertAllEqual(resized_image.shape, (50, 512, 3))
      self.assertAlmostEqual(scale, 0.5)
  
      # min_size only, double image size
      resized_image, _, scale = self._resize_image(
          self._gen_image(100, 1024, 3), min_size=200
      )
      self.assertAllEqual(resized_image.shape, (200, 2048, 3))
      self.assertAlmostEqual(scale, 2.0)
  
      # min and max invariant changes, both changes negate themselves.
      change = 1.1
      resized_image, _, scale = self._resize_image(
          self._gen_image(100, 200, 3),
          min_size=int(100 * change),
          max_size=round(200 / change),
      )
      self.assertAllEqual(resized_image.shape, (100, 200, 3))
      self.assertAlmostEqual(int(scale), 1)
  
      # min and max invariant changes, both changes negate themselves.
      change = 1.6  # Not all values work because of rounding issues.
      resized_image, _, scale = self._resize_image(
          self._gen_image(100, 200, 3),
          min_size=int(100 * change),
          max_size=round(200 / change),
      )
      self.assertAllEqual(
          resized_image.shape, (100, 200, 3)  # No change
      )
      self.assertAlmostEqual(int(scale), 1)
  
      resized_image, _, scale = self._resize_image(
          self._gen_image(100, 200, 3), min_size=600, max_size=1000
      )
      self.assertAllEqual(
          resized_image.shape,
          (100 * 6, 200 * 6, 3),  # We end up bigger than maximum.
      )
      self.assertAlmostEqual(scale, 6.0)
  
      resized_image, _, scale = self._resize_image(
          self._gen_image(2000, 600, 3), min_size=600, max_size=1000
      )
      self.assertAllEqual(
          resized_image.shape,
          (1000, 300, 3),  # We end up smaller than minimum image.
      )
      self.assertAlmostEqual(scale, 0.5)
  
imports: import numpy
  import tensorflow
  from easydict import EasyDict
  from luminoth.utils.image import resize_image, flip_image, random_patch, random_resize, random_distortion, patch_image
  from luminoth.utils.test.gt_boxes import generate_gt_boxes
label_desc: Use image node_id 9 for calling the ImageTest obj's underlying member method code with example usage: obj.testResizeOnlyImage() without return types