Ejemplo n.º 1
0
 def identity(batched_image):
     self.assertTrue(utils.is_batched_image(batched_image))
     return batched_image
Ejemplo n.º 2
0
 def test_is_batched_image(self):
     batched_image = torch.zeros(1, 1, 1, 1)
     self.assertTrue(utils.is_batched_image(batched_image))
     self.assertFalse(utils.is_batched_image(batched_image.byte()))
     self.assertFalse(utils.is_batched_image(batched_image.squeeze(0)))
Ejemplo n.º 3
0
 def test_make_batched_image(self):
     single_image = torch.empty(1, 1, 1)
     batched_image = utils.make_batched_image(single_image)
     self.assertTrue(utils.is_batched_image(batched_image))
Ejemplo n.º 4
0
 def test_read_image(self):
     actual = io.read_image(self.default_image_file())
     desired = self.load_image()
     self.assertTrue(utils.is_batched_image(actual))
     self.assertImagesAlmostEqual(actual, desired)