Skip to content
Snippets Groups Projects
Commit a4baca20 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[tests.test_transforms] Streamline tests

parent e306391a
No related branches found
No related tags found
No related merge requests found
Pipeline #91299 passed
......@@ -29,8 +29,9 @@ def test_crop_mask():
def test_elastic_deformation(datadir):
# Get a raw sample without deformation
data_file = str(datadir / "raw_without_elastic_deformation.png")
raw_without_deformation = PIL.Image.open(data_file)
raw_without_deformation = PIL.Image.open(
datadir / "raw_without_elastic_deformation.png"
)
raw_without_deformation = F.to_dtype(
F.to_image(raw_without_deformation), torch.float32, scale=True
)
......@@ -44,8 +45,7 @@ def test_elastic_deformation(datadir):
# raw_deformed.save(datadir / "raw_with_elastic_deformation.png")
# Get the same sample already deformed (with seed=100)
data_file_2 = str(datadir / "raw_with_elastic_deformation.png")
raw_2 = PIL.Image.open(data_file_2)
raw_2 = PIL.Image.open(datadir / "raw_with_elastic_deformation.png")
raw_2 = F.to_pil_image(F.to_dtype(F.to_image(raw_2), torch.float32, scale=True))
numpy.testing.assert_array_equal(numpy.asarray(raw_deformed), numpy.asarray(raw_2))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment