'Tests image resizing, checking output sizes.'

def testResizeToRangeWithInstanceMasksTensorOfSizeZero(self):

    in_image_shape_list = [[60, 40, 3], [15, 30, 3]]
    in_masks_shape_list = [[0, 60, 40], [0, 15, 30]]
    height = 50
    width = 100
    expected_image_shape_list = [[50, 100, 3], [50, 100, 3]]
    expected_masks_shape_list = [[0, 50, 100], [0, 50, 100]]
    for (in_image_shape, expected_image_shape, in_masks_shape, expected_mask_shape) in zip(in_image_shape_list, expected_image_shape_list, in_masks_shape_list, expected_masks_shape_list):
        in_image = tf.random_uniform(in_image_shape)
        in_masks = tf.random_uniform(in_masks_shape)
        (out_image, out_masks) = preprocessor.resize_image(in_image, in_masks, new_height=height, new_width=width)
        out_image_shape = tf.shape(out_image)
        out_masks_shape = tf.shape(out_masks)
        with self.test_session() as sess:
            (out_image_shape, out_masks_shape) = sess.run([out_image_shape, out_masks_shape])
            self.assertAllEqual(out_image_shape, expected_image_shape)
            self.assertAllEqual(out_masks_shape, expected_mask_shape)
