Skip to content
Snippets Groups Projects
Commit 0d2f0163 authored by Oscar JIMENEZ's avatar Oscar JIMENEZ
Browse files

Test batch uniformity for combined datasets

parent 6a6c672f
No related branches found
No related tags found
1 merge request!55Fix montgomery-shenzhen-indian-tbx11k datamodule
......@@ -100,6 +100,37 @@ def test_split_consistency(name: str, tbx11k_name: str):
assert isinstance(combined.splits[split][3][1], tbx11k_loader)
@pytest.mark.parametrize(
"dataset",
[
"train",
],
)
@pytest.mark.parametrize(
"tbx11k_name",
[
("v1_healthy_vs_atb"),
],
)
def test_batch_uniformity(tbx11k_name: str, dataset: str):
combined = importlib.import_module(
f".{tbx11k_name}",
"mednet.config.data.montgomery_shenzhen_indian_tbx11k",
).datamodule
combined.model_transforms = [] # should be done before setup()
combined.setup("predict") # sets up all datasets
loader = combined.predict_dataloader()[dataset]
limit = 5 # limit load checking
for batch in loader:
if limit == 0:
break
assert len(batch[1]) == 2 # label, name. No radiological sign bounding-boxes
@pytest.mark.slow
@pytest.mark.skip_if_rc_var_not_set("datadir.montgomery")
@pytest.mark.skip_if_rc_var_not_set("datadir.shenzhen")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment