예제 #1
0
    def test_split(self):
        fake_image_shape = FAKE_DIGIT_IMAGE.get_shape().as_list()
        fake_image_list = split_image.split_digit_image(FAKE_DIGIT_IMAGE)

        # check if the split is a list
        self.assertIsInstance(fake_image_list, list)

        # check the size of the list is equal to the split size
        self.assertEqual(len(fake_image_list), roi_property.DIGIT_IMAGE_SIZE)

        fake_image_shape[1] = 1
        # check all the split have the desired dimension
        for fake_image in fake_image_list:
            self.assertEqual(fake_image.get_shape().as_list(), fake_image_shape)
예제 #2
0
    def test_split(self):
        fake_image_shape = FAKE_DIGIT_IMAGE.get_shape().as_list()
        fake_image_list = split_image.split_digit_image(FAKE_DIGIT_IMAGE)

        # check if the split is a list
        self.assertIsInstance(fake_image_list, list)

        # check the size of the list is equal to the split size
        self.assertEqual(len(fake_image_list), roi_property.DIGIT_IMAGE_SIZE)

        fake_image_shape[1] = 1
        # check all the split have the desired dimension
        for fake_image in fake_image_list:
            self.assertEqual(fake_image.get_shape().as_list(),
                             fake_image_shape)
예제 #3
0
 def test_concat_along(self):
     fake_image_list = split_image.split_digit_image(FAKE_DIGIT_IMAGE)
     kernel_tensor, input_shape = \
         concat_image.concat_digit_image_along(fake_image_list, np.arange(0, 28), 5, 1)
     # check the size of the shape is equal to the concat size
     self.assertEqual(kernel_tensor.get_shape().as_list(), input_shape)
예제 #4
0
 def test_concat_along(self):
     fake_image_list = split_image.split_digit_image(FAKE_DIGIT_IMAGE)
     kernel_tensor, input_shape = \
         concat_image.concat_digit_image_along(fake_image_list, np.arange(0, 28), 5, 1)
     # check the size of the shape is equal to the concat size
     self.assertEqual(kernel_tensor.get_shape().as_list(), input_shape)