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

[tests.test_transforms] Remove unused test

parent 3172ede6
No related branches found
No related tags found
1 merge request!46Create common library
Pipeline #89351 failed
...@@ -8,10 +8,7 @@ import PIL.Image ...@@ -8,10 +8,7 @@ import PIL.Image
import torch import torch
import torchvision.transforms.functional as F # noqa: N812 import torchvision.transforms.functional as F # noqa: N812
from mednet.libs.common.data.augmentations import ElasticDeformation from mednet.libs.common.data.augmentations import ElasticDeformation
from mednet.libs.common.models.transforms import ( from mednet.libs.common.models.transforms import crop_image_to_mask
crop_image_to_mask,
resize_max_side,
)
def test_crop_mask(): def test_crop_mask():
...@@ -29,29 +26,6 @@ def test_crop_mask(): ...@@ -29,29 +26,6 @@ def test_crop_mask():
assert torch.all(cropped_tensor.eq(tensor[slice_])) assert torch.all(cropped_tensor.eq(tensor[slice_]))
def test_resize_max_size():
original_size = (3, 50, 100)
original_ratio = original_size[1] / original_size[2]
new_max_side = 120
tensor = torch.rand(original_size)
resized_tensor = resize_max_side(tensor, new_max_side)
resized_ratio = resized_tensor.shape[1] / resized_tensor.shape[2]
assert original_ratio == resized_ratio
transposed_tensor = tensor.transpose(1, 2)
resized_transposed_tensor = resize_max_side(transposed_tensor, new_max_side)
inv_ratio = 1 / (
resized_transposed_tensor.shape[1] / resized_transposed_tensor.shape[2]
)
assert original_ratio == inv_ratio
assert resized_tensor.shape[1] == resized_transposed_tensor.shape[2]
assert resized_tensor.shape[2] == resized_transposed_tensor.shape[1]
def test_elastic_deformation(datadir): def test_elastic_deformation(datadir):
# Get a raw sample without deformation # Get a raw sample without deformation
data_file = str(datadir / "raw_without_elastic_deformation.png") data_file = str(datadir / "raw_without_elastic_deformation.png")
......
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