def test_is_batched_image(): batched_image = torch.zeros(1, 1, 1, 1) assert image_.is_batched_image(batched_image) assert not image_.is_batched_image(batched_image.byte()) assert not image_.is_batched_image(batched_image.squeeze(0))
def test_make_batched_image(): single_image = torch.empty(1, 1, 1) batched_image = image_.make_batched_image(single_image) assert image_.is_batched_image(batched_image)
def identity(batched_image): assert image_.is_batched_image(batched_image) return batched_image
def test_read_image(test_image_file, test_image): actual = image_.read_image(test_image_file) desired = test_image assert image_.is_batched_image(actual) pyimagetest.assert_images_almost_equal(actual, desired)