docstr: Tests the integrity of the return values of random_patch
  
  When bboxes is not None.
docstr_tok: ["Tests","the","integrity","of","the","return","values","of","random_patch","When","bboxes","is","not","None","."]
code: def testRandomPatchImageBboxes(self):
      """Tests the integrity of the return values of random_patch
  
      When bboxes is not None.
      """
      im_shape = (800, 600, 3)
      total_boxes = 5
      # We don't care about the label
      label = 3
      # First test case, we use randomly generated image and bboxes.
      image, bboxes = self._get_image_with_boxes(im_shape, total_boxes)
      # Add a label to each bbox.
      bboxes_w_label = tf.concat(
          [bboxes, tf.fill((bboxes.shape[0], 1), label)], axis=1
      )
      config = self._random_patch_config
      ret_image, ret_bboxes = self._random_patch(
          image, config, bboxes_w_label
      )
      # Assertions
      self.assertLessEqual(ret_bboxes.shape[0], total_boxes)
      self.assertGreater(ret_bboxes.shape[0], 0)
      self.assertTrue(np.all(ret_bboxes >= 0))
      self.assertTrue(np.all(ret_bboxes[:, 0] <= ret_image.shape[1]))
      self.assertTrue(np.all(ret_bboxes[:, 1] <= ret_image.shape[0]))
      self.assertTrue(np.all(ret_bboxes[:, 2] <= ret_image.shape[1]))
      self.assertTrue(np.all(ret_bboxes[:, 3] <= ret_image.shape[0]))
      self.assertTrue(np.all(ret_image.shape <= im_shape))
  
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 15 for calling the ImageTest obj's underlying member method code with example usage: obj.testRandomPatchImageBboxes() without return types