From 7b7efae3fd6dc270837056f2c1213754739eed1e Mon Sep 17 00:00:00 2001 From: "ogueler@idiap.ch" <ogueler@vws110.idiap.ch> Date: Sat, 15 Apr 2023 03:25:34 +0200 Subject: [PATCH] added tests for merged dataset configs --- tests/test_mc_ch_in_11k.py | 638 ++++++++++++++++++++++++++++++++ tests/test_mc_ch_in_11k_RS.py | 349 +++++++++++++++++ tests/test_mc_ch_in_11kv2.py | 638 ++++++++++++++++++++++++++++++++ tests/test_mc_ch_in_11kv2_RS.py | 349 +++++++++++++++++ 4 files changed, 1974 insertions(+) create mode 100644 tests/test_mc_ch_in_11k.py create mode 100644 tests/test_mc_ch_in_11k_RS.py create mode 100644 tests/test_mc_ch_in_11kv2.py create mode 100644 tests/test_mc_ch_in_11kv2_RS.py diff --git a/tests/test_mc_ch_in_11k.py b/tests/test_mc_ch_in_11k.py new file mode 100644 index 00000000..a2ede3d9 --- /dev/null +++ b/tests/test_mc_ch_in_11k.py @@ -0,0 +1,638 @@ +# SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""Tests for the aggregated Montgomery-Shenzhen-Indian dataset.""" + + +def test_dataset_consistency(): + from ptbench.configs.datasets.indian import default as indian + from ptbench.configs.datasets.indian import fold_0 as indian_f0 + from ptbench.configs.datasets.indian import fold_0_rgb as indian_f0_rgb + from ptbench.configs.datasets.indian import fold_1 as indian_f1 + from ptbench.configs.datasets.indian import fold_1_rgb as indian_f1_rgb + from ptbench.configs.datasets.indian import fold_2 as indian_f2 + from ptbench.configs.datasets.indian import fold_2_rgb as indian_f2_rgb + from ptbench.configs.datasets.indian import fold_3 as indian_f3 + from ptbench.configs.datasets.indian import fold_3_rgb as indian_f3_rgb + from ptbench.configs.datasets.indian import fold_4 as indian_f4 + from ptbench.configs.datasets.indian import fold_4_rgb as indian_f4_rgb + from ptbench.configs.datasets.indian import fold_5 as indian_f5 + from ptbench.configs.datasets.indian import fold_5_rgb as indian_f5_rgb + from ptbench.configs.datasets.indian import fold_6 as indian_f6 + from ptbench.configs.datasets.indian import fold_6_rgb as indian_f6_rgb + from ptbench.configs.datasets.indian import fold_7 as indian_f7 + from ptbench.configs.datasets.indian import fold_7_rgb as indian_f7_rgb + from ptbench.configs.datasets.indian import fold_8 as indian_f8 + from ptbench.configs.datasets.indian import fold_8_rgb as indian_f8_rgb + from ptbench.configs.datasets.indian import fold_9 as indian_f9 + from ptbench.configs.datasets.indian import fold_9_rgb as indian_f9_rgb + from ptbench.configs.datasets.mc_ch_in_11k import default as mc_ch_in_11k + from ptbench.configs.datasets.mc_ch_in_11k import fold_0 as mc_ch_in_11k_f0 + from ptbench.configs.datasets.mc_ch_in_11k import fold_0_rgb as mc_ch_in_11k_f0_rgb + from ptbench.configs.datasets.mc_ch_in_11k import fold_1 as mc_ch_in_11k_f1 + from ptbench.configs.datasets.mc_ch_in_11k import fold_1_rgb as mc_ch_in_11k_f1_rgb + from ptbench.configs.datasets.mc_ch_in_11k import fold_2 as mc_ch_in_11k_f2 + from ptbench.configs.datasets.mc_ch_in_11k import fold_2_rgb as mc_ch_in_11k_f2_rgb + from ptbench.configs.datasets.mc_ch_in_11k import fold_3 as mc_ch_in_11k_f3 + from ptbench.configs.datasets.mc_ch_in_11k import fold_3_rgb as mc_ch_in_11k_f3_rgb + from ptbench.configs.datasets.mc_ch_in_11k import fold_4 as mc_ch_in_11k_f4 + from ptbench.configs.datasets.mc_ch_in_11k import fold_4_rgb as mc_ch_in_11k_f4_rgb + from ptbench.configs.datasets.mc_ch_in_11k import fold_5 as mc_ch_in_11k_f5 + from ptbench.configs.datasets.mc_ch_in_11k import fold_5_rgb as mc_ch_in_11k_f5_rgb + from ptbench.configs.datasets.mc_ch_in_11k import fold_6 as mc_ch_in_11k_f6 + from ptbench.configs.datasets.mc_ch_in_11k import fold_6_rgb as mc_ch_in_11k_f6_rgb + from ptbench.configs.datasets.mc_ch_in_11k import fold_7 as mc_ch_in_11k_f7 + from ptbench.configs.datasets.mc_ch_in_11k import fold_7_rgb as mc_ch_in_11k_f7_rgb + from ptbench.configs.datasets.mc_ch_in_11k import fold_8 as mc_ch_in_11k_f8 + from ptbench.configs.datasets.mc_ch_in_11k import fold_8_rgb as mc_ch_in_11k_f8_rgb + from ptbench.configs.datasets.mc_ch_in_11k import fold_9 as mc_ch_in_11k_f9 + from ptbench.configs.datasets.mc_ch_in_11k import fold_9_rgb as mc_ch_in_11k_f9_rgb + from ptbench.configs.datasets.montgomery import default as mc + from ptbench.configs.datasets.montgomery import fold_0 as mc_f0 + from ptbench.configs.datasets.montgomery import fold_0_rgb as mc_f0_rgb + from ptbench.configs.datasets.montgomery import fold_1 as mc_f1 + from ptbench.configs.datasets.montgomery import fold_1_rgb as mc_f1_rgb + from ptbench.configs.datasets.montgomery import fold_2 as mc_f2 + from ptbench.configs.datasets.montgomery import fold_2_rgb as mc_f2_rgb + from ptbench.configs.datasets.montgomery import fold_3 as mc_f3 + from ptbench.configs.datasets.montgomery import fold_3_rgb as mc_f3_rgb + from ptbench.configs.datasets.montgomery import fold_4 as mc_f4 + from ptbench.configs.datasets.montgomery import fold_4_rgb as mc_f4_rgb + from ptbench.configs.datasets.montgomery import fold_5 as mc_f5 + from ptbench.configs.datasets.montgomery import fold_5_rgb as mc_f5_rgb + from ptbench.configs.datasets.montgomery import fold_6 as mc_f6 + from ptbench.configs.datasets.montgomery import fold_6_rgb as mc_f6_rgb + from ptbench.configs.datasets.montgomery import fold_7 as mc_f7 + from ptbench.configs.datasets.montgomery import fold_7_rgb as mc_f7_rgb + from ptbench.configs.datasets.montgomery import fold_8 as mc_f8 + from ptbench.configs.datasets.montgomery import fold_8_rgb as mc_f8_rgb + from ptbench.configs.datasets.montgomery import fold_9 as mc_f9 + from ptbench.configs.datasets.montgomery import fold_9_rgb as mc_f9_rgb + from ptbench.configs.datasets.shenzhen import default as ch + from ptbench.configs.datasets.shenzhen import fold_0 as ch_f0 + from ptbench.configs.datasets.shenzhen import fold_0_rgb as ch_f0_rgb + from ptbench.configs.datasets.shenzhen import fold_1 as ch_f1 + from ptbench.configs.datasets.shenzhen import fold_1_rgb as ch_f1_rgb + from ptbench.configs.datasets.shenzhen import fold_2 as ch_f2 + from ptbench.configs.datasets.shenzhen import fold_2_rgb as ch_f2_rgb + from ptbench.configs.datasets.shenzhen import fold_3 as ch_f3 + from ptbench.configs.datasets.shenzhen import fold_3_rgb as ch_f3_rgb + from ptbench.configs.datasets.shenzhen import fold_4 as ch_f4 + from ptbench.configs.datasets.shenzhen import fold_4_rgb as ch_f4_rgb + from ptbench.configs.datasets.shenzhen import fold_5 as ch_f5 + from ptbench.configs.datasets.shenzhen import fold_5_rgb as ch_f5_rgb + from ptbench.configs.datasets.shenzhen import fold_6 as ch_f6 + from ptbench.configs.datasets.shenzhen import fold_6_rgb as ch_f6_rgb + from ptbench.configs.datasets.shenzhen import fold_7 as ch_f7 + from ptbench.configs.datasets.shenzhen import fold_7_rgb as ch_f7_rgb + from ptbench.configs.datasets.shenzhen import fold_8 as ch_f8 + from ptbench.configs.datasets.shenzhen import fold_8_rgb as ch_f8_rgb + from ptbench.configs.datasets.shenzhen import fold_9 as ch_f9 + from ptbench.configs.datasets.shenzhen import fold_9_rgb as ch_f9_rgb + from ptbench.configs.datasets.tbx11k_simplified import default as tbx11k + from ptbench.configs.datasets.tbx11k_simplified import fold_0 as tbx11k_f0 + from ptbench.configs.datasets.tbx11k_simplified import fold_0_rgb as tbx11k_f0_rgb + from ptbench.configs.datasets.tbx11k_simplified import fold_1 as tbx11k_f1 + from ptbench.configs.datasets.tbx11k_simplified import fold_1_rgb as tbx11k_f1_rgb + from ptbench.configs.datasets.tbx11k_simplified import fold_2 as tbx11k_f2 + from ptbench.configs.datasets.tbx11k_simplified import fold_2_rgb as tbx11k_f2_rgb + from ptbench.configs.datasets.tbx11k_simplified import fold_3 as tbx11k_f3 + from ptbench.configs.datasets.tbx11k_simplified import fold_3_rgb as tbx11k_f3_rgb + from ptbench.configs.datasets.tbx11k_simplified import fold_4 as tbx11k_f4 + from ptbench.configs.datasets.tbx11k_simplified import fold_4_rgb as tbx11k_f4_rgb + from ptbench.configs.datasets.tbx11k_simplified import fold_5 as tbx11k_f5 + from ptbench.configs.datasets.tbx11k_simplified import fold_5_rgb as tbx11k_f5_rgb + from ptbench.configs.datasets.tbx11k_simplified import fold_6 as tbx11k_f6 + from ptbench.configs.datasets.tbx11k_simplified import fold_6_rgb as tbx11k_f6_rgb + from ptbench.configs.datasets.tbx11k_simplified import fold_7 as tbx11k_f7 + from ptbench.configs.datasets.tbx11k_simplified import fold_7_rgb as tbx11k_f7_rgb + from ptbench.configs.datasets.tbx11k_simplified import fold_8 as tbx11k_f8 + from ptbench.configs.datasets.tbx11k_simplified import fold_8_rgb as tbx11k_f8_rgb + from ptbench.configs.datasets.tbx11k_simplified import fold_9 as tbx11k_f9 + from ptbench.configs.datasets.tbx11k_simplified import fold_9_rgb as tbx11k_f9_rgb + + # Default protocol + mc_ch_in_11k_dataset = mc_ch_in_11k.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc.dataset + ch_dataset = ch.dataset + in_dataset = indian.dataset + tbx11k_dataset = tbx11k.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 0 + mc_ch_in_11k_dataset = mc_ch_in_11k_f0.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f0.dataset + ch_dataset = ch_f0.dataset + in_dataset = indian_f0.dataset + tbx11k_dataset = tbx11k_f0.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 1 + mc_ch_in_11k_dataset = mc_ch_in_11k_f1.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f1.dataset + ch_dataset = ch_f1.dataset + in_dataset = indian_f1.dataset + tbx11k_dataset = tbx11k_f1.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 2 + mc_ch_in_11k_dataset = mc_ch_in_11k_f2.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f2.dataset + ch_dataset = ch_f2.dataset + in_dataset = indian_f2.dataset + tbx11k_dataset = tbx11k_f2.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 3 + mc_ch_in_11k_dataset = mc_ch_in_11k_f3.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f3.dataset + ch_dataset = ch_f3.dataset + in_dataset = indian_f3.dataset + tbx11k_dataset = tbx11k_f3.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 4 + mc_ch_in_11k_dataset = mc_ch_in_11k_f4.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f4.dataset + ch_dataset = ch_f4.dataset + in_dataset = indian_f4.dataset + tbx11k_dataset = tbx11k_f4.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 5 + mc_ch_in_11k_dataset = mc_ch_in_11k_f5.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f5.dataset + ch_dataset = ch_f5.dataset + in_dataset = indian_f5.dataset + tbx11k_dataset = tbx11k_f5.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 6 + mc_ch_in_11k_dataset = mc_ch_in_11k_f6.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f6.dataset + ch_dataset = ch_f6.dataset + in_dataset = indian_f6.dataset + tbx11k_dataset = tbx11k_f6.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 7 + mc_ch_in_11k_dataset = mc_ch_in_11k_f7.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f7.dataset + ch_dataset = ch_f7.dataset + in_dataset = indian_f7.dataset + tbx11k_dataset = tbx11k_f7.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 8 + mc_ch_in_11k_dataset = mc_ch_in_11k_f8.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f8.dataset + ch_dataset = ch_f8.dataset + in_dataset = indian_f8.dataset + tbx11k_dataset = tbx11k_f8.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 9 + mc_ch_in_11k_dataset = mc_ch_in_11k_f9.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f9.dataset + ch_dataset = ch_f9.dataset + in_dataset = indian_f9.dataset + tbx11k_dataset = tbx11k_f9.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 0, RGB + mc_ch_in_11k_dataset = mc_ch_in_11k_f0_rgb.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f0_rgb.dataset + ch_dataset = ch_f0_rgb.dataset + in_dataset = indian_f0_rgb.dataset + tbx11k_dataset = tbx11k_f0_rgb.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 1, RGB + mc_ch_in_11k_dataset = mc_ch_in_11k_f1_rgb.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f1_rgb.dataset + ch_dataset = ch_f1_rgb.dataset + in_dataset = indian_f1_rgb.dataset + tbx11k_dataset = tbx11k_f1_rgb.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 2, RGB + mc_ch_in_11k_dataset = mc_ch_in_11k_f2_rgb.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f2_rgb.dataset + ch_dataset = ch_f2_rgb.dataset + in_dataset = indian_f2_rgb.dataset + tbx11k_dataset = tbx11k_f2_rgb.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 3, RGB + mc_ch_in_11k_dataset = mc_ch_in_11k_f3_rgb.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f3_rgb.dataset + ch_dataset = ch_f3_rgb.dataset + in_dataset = indian_f3_rgb.dataset + tbx11k_dataset = tbx11k_f3_rgb.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 4, RGB + mc_ch_in_11k_dataset = mc_ch_in_11k_f4_rgb.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f4_rgb.dataset + ch_dataset = ch_f4_rgb.dataset + in_dataset = indian_f4_rgb.dataset + tbx11k_dataset = tbx11k_f4_rgb.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 5, RGB + mc_ch_in_11k_dataset = mc_ch_in_11k_f5_rgb.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f5_rgb.dataset + ch_dataset = ch_f5_rgb.dataset + in_dataset = indian_f5_rgb.dataset + tbx11k_dataset = tbx11k_f5_rgb.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 6, RGB + mc_ch_in_11k_dataset = mc_ch_in_11k_f6_rgb.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f6_rgb.dataset + ch_dataset = ch_f6_rgb.dataset + in_dataset = indian_f6_rgb.dataset + tbx11k_dataset = tbx11k_f6_rgb.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 7, RGB + mc_ch_in_11k_dataset = mc_ch_in_11k_f7_rgb.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f7_rgb.dataset + ch_dataset = ch_f7_rgb.dataset + in_dataset = indian_f7_rgb.dataset + tbx11k_dataset = tbx11k_f7_rgb.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 8, RGB + mc_ch_in_11k_dataset = mc_ch_in_11k_f8_rgb.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f8_rgb.dataset + ch_dataset = ch_f8_rgb.dataset + in_dataset = indian_f8_rgb.dataset + tbx11k_dataset = tbx11k_f8_rgb.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 9, RGB + mc_ch_in_11k_dataset = mc_ch_in_11k_f9_rgb.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f9_rgb.dataset + ch_dataset = ch_f9_rgb.dataset + in_dataset = indian_f9_rgb.dataset + tbx11k_dataset = tbx11k_f9_rgb.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) diff --git a/tests/test_mc_ch_in_11k_RS.py b/tests/test_mc_ch_in_11k_RS.py new file mode 100644 index 00000000..a453a55d --- /dev/null +++ b/tests/test_mc_ch_in_11k_RS.py @@ -0,0 +1,349 @@ +# SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""Tests for the aggregated Montgomery-Shenzhen-Indian dataset.""" + + +def test_dataset_consistency(): + from ptbench.configs.datasets.indian_RS import default as indian_RS + from ptbench.configs.datasets.indian_RS import fold_0 as indian_f0 + from ptbench.configs.datasets.indian_RS import fold_1 as indian_f1 + from ptbench.configs.datasets.indian_RS import fold_2 as indian_f2 + from ptbench.configs.datasets.indian_RS import fold_3 as indian_f3 + from ptbench.configs.datasets.indian_RS import fold_4 as indian_f4 + from ptbench.configs.datasets.indian_RS import fold_5 as indian_f5 + from ptbench.configs.datasets.indian_RS import fold_6 as indian_f6 + from ptbench.configs.datasets.indian_RS import fold_7 as indian_f7 + from ptbench.configs.datasets.indian_RS import fold_8 as indian_f8 + from ptbench.configs.datasets.indian_RS import fold_9 as indian_f9 + from ptbench.configs.datasets.mc_ch_in_11k_RS import default as mc_ch_in_11k_RS + from ptbench.configs.datasets.mc_ch_in_11k_RS import fold_0 as mc_ch_in_11k_f0 + from ptbench.configs.datasets.mc_ch_in_11k_RS import fold_1 as mc_ch_in_11k_f1 + from ptbench.configs.datasets.mc_ch_in_11k_RS import fold_2 as mc_ch_in_11k_f2 + from ptbench.configs.datasets.mc_ch_in_11k_RS import fold_3 as mc_ch_in_11k_f3 + from ptbench.configs.datasets.mc_ch_in_11k_RS import fold_4 as mc_ch_in_11k_f4 + from ptbench.configs.datasets.mc_ch_in_11k_RS import fold_5 as mc_ch_in_11k_f5 + from ptbench.configs.datasets.mc_ch_in_11k_RS import fold_6 as mc_ch_in_11k_f6 + from ptbench.configs.datasets.mc_ch_in_11k_RS import fold_7 as mc_ch_in_11k_f7 + from ptbench.configs.datasets.mc_ch_in_11k_RS import fold_8 as mc_ch_in_11k_f8 + from ptbench.configs.datasets.mc_ch_in_11k_RS import fold_9 as mc_ch_in_11k_f9 + from ptbench.configs.datasets.montgomery_RS import default as mc_RS + from ptbench.configs.datasets.montgomery_RS import fold_0 as mc_f0 + from ptbench.configs.datasets.montgomery_RS import fold_1 as mc_f1 + from ptbench.configs.datasets.montgomery_RS import fold_2 as mc_f2 + from ptbench.configs.datasets.montgomery_RS import fold_3 as mc_f3 + from ptbench.configs.datasets.montgomery_RS import fold_4 as mc_f4 + from ptbench.configs.datasets.montgomery_RS import fold_5 as mc_f5 + from ptbench.configs.datasets.montgomery_RS import fold_6 as mc_f6 + from ptbench.configs.datasets.montgomery_RS import fold_7 as mc_f7 + from ptbench.configs.datasets.montgomery_RS import fold_8 as mc_f8 + from ptbench.configs.datasets.montgomery_RS import fold_9 as mc_f9 + from ptbench.configs.datasets.shenzhen_RS import default as ch_RS + from ptbench.configs.datasets.shenzhen_RS import fold_0 as ch_f0 + from ptbench.configs.datasets.shenzhen_RS import fold_1 as ch_f1 + from ptbench.configs.datasets.shenzhen_RS import fold_2 as ch_f2 + from ptbench.configs.datasets.shenzhen_RS import fold_3 as ch_f3 + from ptbench.configs.datasets.shenzhen_RS import fold_4 as ch_f4 + from ptbench.configs.datasets.shenzhen_RS import fold_5 as ch_f5 + from ptbench.configs.datasets.shenzhen_RS import fold_6 as ch_f6 + from ptbench.configs.datasets.shenzhen_RS import fold_7 as ch_f7 + from ptbench.configs.datasets.shenzhen_RS import fold_8 as ch_f8 + from ptbench.configs.datasets.shenzhen_RS import fold_9 as ch_f9 + from ptbench.configs.datasets.tbx11k_simplified_RS import default as tbx11k_RS + from ptbench.configs.datasets.tbx11k_simplified_RS import fold_0 as tbx11k_f0 + from ptbench.configs.datasets.tbx11k_simplified_RS import fold_1 as tbx11k_f1 + from ptbench.configs.datasets.tbx11k_simplified_RS import fold_2 as tbx11k_f2 + from ptbench.configs.datasets.tbx11k_simplified_RS import fold_3 as tbx11k_f3 + from ptbench.configs.datasets.tbx11k_simplified_RS import fold_4 as tbx11k_f4 + from ptbench.configs.datasets.tbx11k_simplified_RS import fold_5 as tbx11k_f5 + from ptbench.configs.datasets.tbx11k_simplified_RS import fold_6 as tbx11k_f6 + from ptbench.configs.datasets.tbx11k_simplified_RS import fold_7 as tbx11k_f7 + from ptbench.configs.datasets.tbx11k_simplified_RS import fold_8 as tbx11k_f8 + from ptbench.configs.datasets.tbx11k_simplified_RS import fold_9 as tbx11k_f9 + + # Default protocol + mc_ch_in_11k_RS_dataset = mc_ch_in_11k_RS.dataset + assert isinstance(mc_ch_in_11k_RS_dataset, dict) + + mc_RS_dataset = mc_RS.dataset + ch_RS_dataset = ch_RS.dataset + in_RS_dataset = indian_RS.dataset + tbx11k_RS_dataset = tbx11k_RS.dataset + + assert "train" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["train"]) == len( + mc_RS_dataset["train"] + ) + len(ch_RS_dataset["train"]) + len(in_RS_dataset["train"] + len( + tbx11k_RS_dataset["train"])) + + assert "validation" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["validation"]) == len( + mc_RS_dataset["validation"] + ) + len(ch_RS_dataset["validation"]) + len(in_RS_dataset["validation"] + len( + tbx11k_RS_dataset["validation"])) + + assert "test" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["test"]) == len(mc_RS_dataset["test"]) + len( + ch_RS_dataset["test"] + ) + len(in_RS_dataset["test"] + len(tbx11k_RS_dataset["test"])) + + # Fold 0 + mc_ch_in_11k_RS_dataset = mc_ch_in_11k_f0.dataset + assert isinstance(mc_ch_in_11k_RS_dataset, dict) + + mc_dataset = mc_f0.dataset + ch_dataset = ch_f0.dataset + in_dataset = indian_f0.dataset + tbx11k_dataset = tbx11k_f0.dataset + + assert "train" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["train"]) == len( + mc_dataset["train"] + ) + len(ch_dataset["train"]) + len(in_dataset["train"] + len( + tbx11k_dataset["train"])) + + assert "validation" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"] + len( + tbx11k_dataset["validation"])) + + assert "test" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"] + len(tbx11k_dataset["test"])) + + # Fold 1 + mc_ch_in_11k_RS_dataset = mc_ch_in_11k_f1.dataset + assert isinstance(mc_ch_in_11k_RS_dataset, dict) + + mc_dataset = mc_f1.dataset + ch_dataset = ch_f1.dataset + in_dataset = indian_f1.dataset + tbx11k_dataset = tbx11k_f1.dataset + + assert "train" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["train"]) == len( + mc_dataset["train"] + ) + len(ch_dataset["train"]) + len(in_dataset["train"] + len( + tbx11k_dataset["train"])) + + assert "validation" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"] + len( + tbx11k_dataset["validation"])) + + assert "test" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"] + len(tbx11k_dataset["test"])) + + # Fold 2 + mc_ch_in_11k_RS_dataset = mc_ch_in_11k_f2.dataset + assert isinstance(mc_ch_in_11k_RS_dataset, dict) + + mc_dataset = mc_f2.dataset + ch_dataset = ch_f2.dataset + in_dataset = indian_f2.dataset + tbx11k_dataset = tbx11k_f2.dataset + + assert "train" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["train"]) == len( + mc_dataset["train"] + ) + len(ch_dataset["train"]) + len(in_dataset["train"] + len( + tbx11k_dataset["train"])) + + assert "validation" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"] + len( + tbx11k_dataset["validation"])) + + assert "test" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"] + len(tbx11k_dataset["test"])) + + # Fold 3 + mc_ch_in_11k_RS_dataset = mc_ch_in_11k_f3.dataset + assert isinstance(mc_ch_in_11k_RS_dataset, dict) + + mc_dataset = mc_f3.dataset + ch_dataset = ch_f3.dataset + in_dataset = indian_f3.dataset + tbx11k_dataset = tbx11k_f3.dataset + + assert "train" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["train"]) == len( + mc_dataset["train"] + ) + len(ch_dataset["train"]) + len(in_dataset["train"] + len( + tbx11k_dataset["train"])) + + assert "validation" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"] + len( + tbx11k_dataset["validation"])) + + assert "test" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"] + len(tbx11k_dataset["test"])) + + # Fold 4 + mc_ch_in_11k_RS_dataset = mc_ch_in_11k_f4.dataset + assert isinstance(mc_ch_in_11k_RS_dataset, dict) + + mc_dataset = mc_f4.dataset + ch_dataset = ch_f4.dataset + in_dataset = indian_f4.dataset + tbx11k_dataset = tbx11k_f4.dataset + + assert "train" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["train"]) == len( + mc_dataset["train"] + ) + len(ch_dataset["train"]) + len(in_dataset["train"] + len( + tbx11k_dataset["train"])) + + assert "validation" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"] + len( + tbx11k_dataset["validation"])) + + assert "test" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"] + len(tbx11k_dataset["test"])) + + # Fold 5 + mc_ch_in_11k_RS_dataset = mc_ch_in_11k_f5.dataset + assert isinstance(mc_ch_in_11k_RS_dataset, dict) + + mc_dataset = mc_f5.dataset + ch_dataset = ch_f5.dataset + in_dataset = indian_f5.dataset + tbx11k_dataset = tbx11k_f5.dataset + + assert "train" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["train"]) == len( + mc_dataset["train"] + ) + len(ch_dataset["train"]) + len(in_dataset["train"] + len( + tbx11k_dataset["train"])) + + assert "validation" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"] + len( + tbx11k_dataset["validation"])) + + assert "test" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"] + len(tbx11k_dataset["test"])) + + # Fold 6 + mc_ch_in_11k_RS_dataset = mc_ch_in_11k_f6.dataset + assert isinstance(mc_ch_in_11k_RS_dataset, dict) + + mc_dataset = mc_f6.dataset + ch_dataset = ch_f6.dataset + in_dataset = indian_f6.dataset + tbx11k_dataset = tbx11k_f6.dataset + + assert "train" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["train"]) == len( + mc_dataset["train"] + ) + len(ch_dataset["train"]) + len(in_dataset["train"] + len( + tbx11k_dataset["train"])) + + assert "validation" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"] + len( + tbx11k_dataset["validation"])) + + assert "test" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"] + len(tbx11k_dataset["test"])) + + # Fold 7 + mc_ch_in_11k_RS_dataset = mc_ch_in_11k_f7.dataset + assert isinstance(mc_ch_in_11k_RS_dataset, dict) + + mc_dataset = mc_f7.dataset + ch_dataset = ch_f7.dataset + in_dataset = indian_f7.dataset + tbx11k_dataset = tbx11k_f7.dataset + + assert "train" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["train"]) == len( + mc_dataset["train"] + ) + len(ch_dataset["train"]) + len(in_dataset["train"] + len( + tbx11k_dataset["train"])) + + assert "validation" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"] + len( + tbx11k_dataset["validation"])) + + assert "test" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"] + len(tbx11k_dataset["test"])) + + # Fold 8 + mc_ch_in_11k_RS_dataset = mc_ch_in_11k_f8.dataset + assert isinstance(mc_ch_in_11k_RS_dataset, dict) + + mc_dataset = mc_f8.dataset + ch_dataset = ch_f8.dataset + in_dataset = indian_f8.dataset + tbx11k_dataset = tbx11k_f8.dataset + + assert "train" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["train"]) == len( + mc_dataset["train"] + ) + len(ch_dataset["train"]) + len(in_dataset["train"] + len( + tbx11k_dataset["train"])) + + assert "validation" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"] + len( + tbx11k_dataset["validation"])) + + assert "test" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"] + len(tbx11k_dataset["test"])) + + # Fold 9 + mc_ch_in_11k_RS_dataset = mc_ch_in_11k_f9.dataset + assert isinstance(mc_ch_in_11k_RS_dataset, dict) + + mc_dataset = mc_f9.dataset + ch_dataset = ch_f9.dataset + in_dataset = indian_f9.dataset + tbx11k_dataset = tbx11k_f9.dataset + + assert "train" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["train"]) == len( + mc_dataset["train"] + ) + len(ch_dataset["train"]) + len(in_dataset["train"] + len( + tbx11k_dataset["train"])) + + assert "validation" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"] + len( + tbx11k_dataset["validation"])) + + assert "test" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"] + len(tbx11k_dataset["test"])) diff --git a/tests/test_mc_ch_in_11kv2.py b/tests/test_mc_ch_in_11kv2.py new file mode 100644 index 00000000..8b09f8f8 --- /dev/null +++ b/tests/test_mc_ch_in_11kv2.py @@ -0,0 +1,638 @@ +# SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""Tests for the aggregated Montgomery-Shenzhen-Indian dataset.""" + + +def test_dataset_consistency(): + from ptbench.configs.datasets.indian import default as indian + from ptbench.configs.datasets.indian import fold_0 as indian_f0 + from ptbench.configs.datasets.indian import fold_0_rgb as indian_f0_rgb + from ptbench.configs.datasets.indian import fold_1 as indian_f1 + from ptbench.configs.datasets.indian import fold_1_rgb as indian_f1_rgb + from ptbench.configs.datasets.indian import fold_2 as indian_f2 + from ptbench.configs.datasets.indian import fold_2_rgb as indian_f2_rgb + from ptbench.configs.datasets.indian import fold_3 as indian_f3 + from ptbench.configs.datasets.indian import fold_3_rgb as indian_f3_rgb + from ptbench.configs.datasets.indian import fold_4 as indian_f4 + from ptbench.configs.datasets.indian import fold_4_rgb as indian_f4_rgb + from ptbench.configs.datasets.indian import fold_5 as indian_f5 + from ptbench.configs.datasets.indian import fold_5_rgb as indian_f5_rgb + from ptbench.configs.datasets.indian import fold_6 as indian_f6 + from ptbench.configs.datasets.indian import fold_6_rgb as indian_f6_rgb + from ptbench.configs.datasets.indian import fold_7 as indian_f7 + from ptbench.configs.datasets.indian import fold_7_rgb as indian_f7_rgb + from ptbench.configs.datasets.indian import fold_8 as indian_f8 + from ptbench.configs.datasets.indian import fold_8_rgb as indian_f8_rgb + from ptbench.configs.datasets.indian import fold_9 as indian_f9 + from ptbench.configs.datasets.indian import fold_9_rgb as indian_f9_rgb + from ptbench.configs.datasets.mc_ch_in_11kv2 import default as mc_ch_in_11k + from ptbench.configs.datasets.mc_ch_in_11kv2 import fold_0 as mc_ch_in_11k_f0 + from ptbench.configs.datasets.mc_ch_in_11kv2 import fold_0_rgb as mc_ch_in_11k_f0_rgb + from ptbench.configs.datasets.mc_ch_in_11kv2 import fold_1 as mc_ch_in_11k_f1 + from ptbench.configs.datasets.mc_ch_in_11kv2 import fold_1_rgb as mc_ch_in_11k_f1_rgb + from ptbench.configs.datasets.mc_ch_in_11kv2 import fold_2 as mc_ch_in_11k_f2 + from ptbench.configs.datasets.mc_ch_in_11kv2 import fold_2_rgb as mc_ch_in_11k_f2_rgb + from ptbench.configs.datasets.mc_ch_in_11kv2 import fold_3 as mc_ch_in_11k_f3 + from ptbench.configs.datasets.mc_ch_in_11kv2 import fold_3_rgb as mc_ch_in_11k_f3_rgb + from ptbench.configs.datasets.mc_ch_in_11kv2 import fold_4 as mc_ch_in_11k_f4 + from ptbench.configs.datasets.mc_ch_in_11kv2 import fold_4_rgb as mc_ch_in_11k_f4_rgb + from ptbench.configs.datasets.mc_ch_in_11kv2 import fold_5 as mc_ch_in_11k_f5 + from ptbench.configs.datasets.mc_ch_in_11kv2 import fold_5_rgb as mc_ch_in_11k_f5_rgb + from ptbench.configs.datasets.mc_ch_in_11kv2 import fold_6 as mc_ch_in_11k_f6 + from ptbench.configs.datasets.mc_ch_in_11kv2 import fold_6_rgb as mc_ch_in_11k_f6_rgb + from ptbench.configs.datasets.mc_ch_in_11kv2 import fold_7 as mc_ch_in_11k_f7 + from ptbench.configs.datasets.mc_ch_in_11kv2 import fold_7_rgb as mc_ch_in_11k_f7_rgb + from ptbench.configs.datasets.mc_ch_in_11kv2 import fold_8 as mc_ch_in_11k_f8 + from ptbench.configs.datasets.mc_ch_in_11kv2 import fold_8_rgb as mc_ch_in_11k_f8_rgb + from ptbench.configs.datasets.mc_ch_in_11kv2 import fold_9 as mc_ch_in_11k_f9 + from ptbench.configs.datasets.mc_ch_in_11kv2 import fold_9_rgb as mc_ch_in_11k_f9_rgb + from ptbench.configs.datasets.montgomery import default as mc + from ptbench.configs.datasets.montgomery import fold_0 as mc_f0 + from ptbench.configs.datasets.montgomery import fold_0_rgb as mc_f0_rgb + from ptbench.configs.datasets.montgomery import fold_1 as mc_f1 + from ptbench.configs.datasets.montgomery import fold_1_rgb as mc_f1_rgb + from ptbench.configs.datasets.montgomery import fold_2 as mc_f2 + from ptbench.configs.datasets.montgomery import fold_2_rgb as mc_f2_rgb + from ptbench.configs.datasets.montgomery import fold_3 as mc_f3 + from ptbench.configs.datasets.montgomery import fold_3_rgb as mc_f3_rgb + from ptbench.configs.datasets.montgomery import fold_4 as mc_f4 + from ptbench.configs.datasets.montgomery import fold_4_rgb as mc_f4_rgb + from ptbench.configs.datasets.montgomery import fold_5 as mc_f5 + from ptbench.configs.datasets.montgomery import fold_5_rgb as mc_f5_rgb + from ptbench.configs.datasets.montgomery import fold_6 as mc_f6 + from ptbench.configs.datasets.montgomery import fold_6_rgb as mc_f6_rgb + from ptbench.configs.datasets.montgomery import fold_7 as mc_f7 + from ptbench.configs.datasets.montgomery import fold_7_rgb as mc_f7_rgb + from ptbench.configs.datasets.montgomery import fold_8 as mc_f8 + from ptbench.configs.datasets.montgomery import fold_8_rgb as mc_f8_rgb + from ptbench.configs.datasets.montgomery import fold_9 as mc_f9 + from ptbench.configs.datasets.montgomery import fold_9_rgb as mc_f9_rgb + from ptbench.configs.datasets.shenzhen import default as ch + from ptbench.configs.datasets.shenzhen import fold_0 as ch_f0 + from ptbench.configs.datasets.shenzhen import fold_0_rgb as ch_f0_rgb + from ptbench.configs.datasets.shenzhen import fold_1 as ch_f1 + from ptbench.configs.datasets.shenzhen import fold_1_rgb as ch_f1_rgb + from ptbench.configs.datasets.shenzhen import fold_2 as ch_f2 + from ptbench.configs.datasets.shenzhen import fold_2_rgb as ch_f2_rgb + from ptbench.configs.datasets.shenzhen import fold_3 as ch_f3 + from ptbench.configs.datasets.shenzhen import fold_3_rgb as ch_f3_rgb + from ptbench.configs.datasets.shenzhen import fold_4 as ch_f4 + from ptbench.configs.datasets.shenzhen import fold_4_rgb as ch_f4_rgb + from ptbench.configs.datasets.shenzhen import fold_5 as ch_f5 + from ptbench.configs.datasets.shenzhen import fold_5_rgb as ch_f5_rgb + from ptbench.configs.datasets.shenzhen import fold_6 as ch_f6 + from ptbench.configs.datasets.shenzhen import fold_6_rgb as ch_f6_rgb + from ptbench.configs.datasets.shenzhen import fold_7 as ch_f7 + from ptbench.configs.datasets.shenzhen import fold_7_rgb as ch_f7_rgb + from ptbench.configs.datasets.shenzhen import fold_8 as ch_f8 + from ptbench.configs.datasets.shenzhen import fold_8_rgb as ch_f8_rgb + from ptbench.configs.datasets.shenzhen import fold_9 as ch_f9 + from ptbench.configs.datasets.shenzhen import fold_9_rgb as ch_f9_rgb + from ptbench.configs.datasets.tbx11k_simplified_v2 import default as tbx11k + from ptbench.configs.datasets.tbx11k_simplified_v2 import fold_0 as tbx11k_f0 + from ptbench.configs.datasets.tbx11k_simplified_v2 import fold_0_rgb as tbx11k_f0_rgb + from ptbench.configs.datasets.tbx11k_simplified_v2 import fold_1 as tbx11k_f1 + from ptbench.configs.datasets.tbx11k_simplified_v2 import fold_1_rgb as tbx11k_f1_rgb + from ptbench.configs.datasets.tbx11k_simplified_v2 import fold_2 as tbx11k_f2 + from ptbench.configs.datasets.tbx11k_simplified_v2 import fold_2_rgb as tbx11k_f2_rgb + from ptbench.configs.datasets.tbx11k_simplified_v2 import fold_3 as tbx11k_f3 + from ptbench.configs.datasets.tbx11k_simplified_v2 import fold_3_rgb as tbx11k_f3_rgb + from ptbench.configs.datasets.tbx11k_simplified_v2 import fold_4 as tbx11k_f4 + from ptbench.configs.datasets.tbx11k_simplified_v2 import fold_4_rgb as tbx11k_f4_rgb + from ptbench.configs.datasets.tbx11k_simplified_v2 import fold_5 as tbx11k_f5 + from ptbench.configs.datasets.tbx11k_simplified_v2 import fold_5_rgb as tbx11k_f5_rgb + from ptbench.configs.datasets.tbx11k_simplified_v2 import fold_6 as tbx11k_f6 + from ptbench.configs.datasets.tbx11k_simplified_v2 import fold_6_rgb as tbx11k_f6_rgb + from ptbench.configs.datasets.tbx11k_simplified_v2 import fold_7 as tbx11k_f7 + from ptbench.configs.datasets.tbx11k_simplified_v2 import fold_7_rgb as tbx11k_f7_rgb + from ptbench.configs.datasets.tbx11k_simplified_v2 import fold_8 as tbx11k_f8 + from ptbench.configs.datasets.tbx11k_simplified_v2 import fold_8_rgb as tbx11k_f8_rgb + from ptbench.configs.datasets.tbx11k_simplified_v2 import fold_9 as tbx11k_f9 + from ptbench.configs.datasets.tbx11k_simplified_v2 import fold_9_rgb as tbx11k_f9_rgb + + # Default protocol + mc_ch_in_11k_dataset = mc_ch_in_11k.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc.dataset + ch_dataset = ch.dataset + in_dataset = indian.dataset + tbx11k_dataset = tbx11k.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 0 + mc_ch_in_11k_dataset = mc_ch_in_11k_f0.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f0.dataset + ch_dataset = ch_f0.dataset + in_dataset = indian_f0.dataset + tbx11k_dataset = tbx11k_f0.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 1 + mc_ch_in_11k_dataset = mc_ch_in_11k_f1.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f1.dataset + ch_dataset = ch_f1.dataset + in_dataset = indian_f1.dataset + tbx11k_dataset = tbx11k_f1.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 2 + mc_ch_in_11k_dataset = mc_ch_in_11k_f2.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f2.dataset + ch_dataset = ch_f2.dataset + in_dataset = indian_f2.dataset + tbx11k_dataset = tbx11k_f2.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 3 + mc_ch_in_11k_dataset = mc_ch_in_11k_f3.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f3.dataset + ch_dataset = ch_f3.dataset + in_dataset = indian_f3.dataset + tbx11k_dataset = tbx11k_f3.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 4 + mc_ch_in_11k_dataset = mc_ch_in_11k_f4.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f4.dataset + ch_dataset = ch_f4.dataset + in_dataset = indian_f4.dataset + tbx11k_dataset = tbx11k_f4.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 5 + mc_ch_in_11k_dataset = mc_ch_in_11k_f5.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f5.dataset + ch_dataset = ch_f5.dataset + in_dataset = indian_f5.dataset + tbx11k_dataset = tbx11k_f5.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 6 + mc_ch_in_11k_dataset = mc_ch_in_11k_f6.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f6.dataset + ch_dataset = ch_f6.dataset + in_dataset = indian_f6.dataset + tbx11k_dataset = tbx11k_f6.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 7 + mc_ch_in_11k_dataset = mc_ch_in_11k_f7.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f7.dataset + ch_dataset = ch_f7.dataset + in_dataset = indian_f7.dataset + tbx11k_dataset = tbx11k_f7.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 8 + mc_ch_in_11k_dataset = mc_ch_in_11k_f8.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f8.dataset + ch_dataset = ch_f8.dataset + in_dataset = indian_f8.dataset + tbx11k_dataset = tbx11k_f8.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 9 + mc_ch_in_11k_dataset = mc_ch_in_11k_f9.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f9.dataset + ch_dataset = ch_f9.dataset + in_dataset = indian_f9.dataset + tbx11k_dataset = tbx11k_f9.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 0, RGB + mc_ch_in_11k_dataset = mc_ch_in_11k_f0_rgb.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f0_rgb.dataset + ch_dataset = ch_f0_rgb.dataset + in_dataset = indian_f0_rgb.dataset + tbx11k_dataset = tbx11k_f0_rgb.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 1, RGB + mc_ch_in_11k_dataset = mc_ch_in_11k_f1_rgb.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f1_rgb.dataset + ch_dataset = ch_f1_rgb.dataset + in_dataset = indian_f1_rgb.dataset + tbx11k_dataset = tbx11k_f1_rgb.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 2, RGB + mc_ch_in_11k_dataset = mc_ch_in_11k_f2_rgb.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f2_rgb.dataset + ch_dataset = ch_f2_rgb.dataset + in_dataset = indian_f2_rgb.dataset + tbx11k_dataset = tbx11k_f2_rgb.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 3, RGB + mc_ch_in_11k_dataset = mc_ch_in_11k_f3_rgb.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f3_rgb.dataset + ch_dataset = ch_f3_rgb.dataset + in_dataset = indian_f3_rgb.dataset + tbx11k_dataset = tbx11k_f3_rgb.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 4, RGB + mc_ch_in_11k_dataset = mc_ch_in_11k_f4_rgb.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f4_rgb.dataset + ch_dataset = ch_f4_rgb.dataset + in_dataset = indian_f4_rgb.dataset + tbx11k_dataset = tbx11k_f4_rgb.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 5, RGB + mc_ch_in_11k_dataset = mc_ch_in_11k_f5_rgb.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f5_rgb.dataset + ch_dataset = ch_f5_rgb.dataset + in_dataset = indian_f5_rgb.dataset + tbx11k_dataset = tbx11k_f5_rgb.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 6, RGB + mc_ch_in_11k_dataset = mc_ch_in_11k_f6_rgb.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f6_rgb.dataset + ch_dataset = ch_f6_rgb.dataset + in_dataset = indian_f6_rgb.dataset + tbx11k_dataset = tbx11k_f6_rgb.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 7, RGB + mc_ch_in_11k_dataset = mc_ch_in_11k_f7_rgb.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f7_rgb.dataset + ch_dataset = ch_f7_rgb.dataset + in_dataset = indian_f7_rgb.dataset + tbx11k_dataset = tbx11k_f7_rgb.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 8, RGB + mc_ch_in_11k_dataset = mc_ch_in_11k_f8_rgb.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f8_rgb.dataset + ch_dataset = ch_f8_rgb.dataset + in_dataset = indian_f8_rgb.dataset + tbx11k_dataset = tbx11k_f8_rgb.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) + + # Fold 9, RGB + mc_ch_in_11k_dataset = mc_ch_in_11k_f9_rgb.dataset + assert isinstance(mc_ch_in_11k_dataset, dict) + + mc_dataset = mc_f9_rgb.dataset + ch_dataset = ch_f9_rgb.dataset + in_dataset = indian_f9_rgb.dataset + tbx11k_dataset = tbx11k_f9_rgb.dataset + + assert "train" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["train"]) == len(mc_dataset["train"]) + len( + ch_dataset["train"] + ) + len(in_dataset["train"]) + len(tbx11k_dataset["train"]) + + assert "validation" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"]) + len( + tbx11k_dataset["validation"]) + + assert "test" in mc_ch_in_11k_dataset + assert len(mc_ch_in_11k_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"]) + len(tbx11k_dataset["test"]) diff --git a/tests/test_mc_ch_in_11kv2_RS.py b/tests/test_mc_ch_in_11kv2_RS.py new file mode 100644 index 00000000..f2223948 --- /dev/null +++ b/tests/test_mc_ch_in_11kv2_RS.py @@ -0,0 +1,349 @@ +# SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""Tests for the aggregated Montgomery-Shenzhen-Indian dataset.""" + + +def test_dataset_consistency(): + from ptbench.configs.datasets.indian_RS import default as indian_RS + from ptbench.configs.datasets.indian_RS import fold_0 as indian_f0 + from ptbench.configs.datasets.indian_RS import fold_1 as indian_f1 + from ptbench.configs.datasets.indian_RS import fold_2 as indian_f2 + from ptbench.configs.datasets.indian_RS import fold_3 as indian_f3 + from ptbench.configs.datasets.indian_RS import fold_4 as indian_f4 + from ptbench.configs.datasets.indian_RS import fold_5 as indian_f5 + from ptbench.configs.datasets.indian_RS import fold_6 as indian_f6 + from ptbench.configs.datasets.indian_RS import fold_7 as indian_f7 + from ptbench.configs.datasets.indian_RS import fold_8 as indian_f8 + from ptbench.configs.datasets.indian_RS import fold_9 as indian_f9 + from ptbench.configs.datasets.mc_ch_in_11kv2_RS import default as mc_ch_in_11k_RS + from ptbench.configs.datasets.mc_ch_in_11kv2_RS import fold_0 as mc_ch_in_11k_f0 + from ptbench.configs.datasets.mc_ch_in_11kv2_RS import fold_1 as mc_ch_in_11k_f1 + from ptbench.configs.datasets.mc_ch_in_11kv2_RS import fold_2 as mc_ch_in_11k_f2 + from ptbench.configs.datasets.mc_ch_in_11kv2_RS import fold_3 as mc_ch_in_11k_f3 + from ptbench.configs.datasets.mc_ch_in_11kv2_RS import fold_4 as mc_ch_in_11k_f4 + from ptbench.configs.datasets.mc_ch_in_11kv2_RS import fold_5 as mc_ch_in_11k_f5 + from ptbench.configs.datasets.mc_ch_in_11kv2_RS import fold_6 as mc_ch_in_11k_f6 + from ptbench.configs.datasets.mc_ch_in_11kv2_RS import fold_7 as mc_ch_in_11k_f7 + from ptbench.configs.datasets.mc_ch_in_11kv2_RS import fold_8 as mc_ch_in_11k_f8 + from ptbench.configs.datasets.mc_ch_in_11kv2_RS import fold_9 as mc_ch_in_11k_f9 + from ptbench.configs.datasets.montgomery_RS import default as mc_RS + from ptbench.configs.datasets.montgomery_RS import fold_0 as mc_f0 + from ptbench.configs.datasets.montgomery_RS import fold_1 as mc_f1 + from ptbench.configs.datasets.montgomery_RS import fold_2 as mc_f2 + from ptbench.configs.datasets.montgomery_RS import fold_3 as mc_f3 + from ptbench.configs.datasets.montgomery_RS import fold_4 as mc_f4 + from ptbench.configs.datasets.montgomery_RS import fold_5 as mc_f5 + from ptbench.configs.datasets.montgomery_RS import fold_6 as mc_f6 + from ptbench.configs.datasets.montgomery_RS import fold_7 as mc_f7 + from ptbench.configs.datasets.montgomery_RS import fold_8 as mc_f8 + from ptbench.configs.datasets.montgomery_RS import fold_9 as mc_f9 + from ptbench.configs.datasets.shenzhen_RS import default as ch_RS + from ptbench.configs.datasets.shenzhen_RS import fold_0 as ch_f0 + from ptbench.configs.datasets.shenzhen_RS import fold_1 as ch_f1 + from ptbench.configs.datasets.shenzhen_RS import fold_2 as ch_f2 + from ptbench.configs.datasets.shenzhen_RS import fold_3 as ch_f3 + from ptbench.configs.datasets.shenzhen_RS import fold_4 as ch_f4 + from ptbench.configs.datasets.shenzhen_RS import fold_5 as ch_f5 + from ptbench.configs.datasets.shenzhen_RS import fold_6 as ch_f6 + from ptbench.configs.datasets.shenzhen_RS import fold_7 as ch_f7 + from ptbench.configs.datasets.shenzhen_RS import fold_8 as ch_f8 + from ptbench.configs.datasets.shenzhen_RS import fold_9 as ch_f9 + from ptbench.configs.datasets.tbx11k_simplified_v2_RS import default as tbx11k_RS + from ptbench.configs.datasets.tbx11k_simplified_v2_RS import fold_0 as tbx11k_f0 + from ptbench.configs.datasets.tbx11k_simplified_v2_RS import fold_1 as tbx11k_f1 + from ptbench.configs.datasets.tbx11k_simplified_v2_RS import fold_2 as tbx11k_f2 + from ptbench.configs.datasets.tbx11k_simplified_v2_RS import fold_3 as tbx11k_f3 + from ptbench.configs.datasets.tbx11k_simplified_v2_RS import fold_4 as tbx11k_f4 + from ptbench.configs.datasets.tbx11k_simplified_v2_RS import fold_5 as tbx11k_f5 + from ptbench.configs.datasets.tbx11k_simplified_v2_RS import fold_6 as tbx11k_f6 + from ptbench.configs.datasets.tbx11k_simplified_v2_RS import fold_7 as tbx11k_f7 + from ptbench.configs.datasets.tbx11k_simplified_v2_RS import fold_8 as tbx11k_f8 + from ptbench.configs.datasets.tbx11k_simplified_v2_RS import fold_9 as tbx11k_f9 + + # Default protocol + mc_ch_in_11k_RS_dataset = mc_ch_in_11k_RS.dataset + assert isinstance(mc_ch_in_11k_RS_dataset, dict) + + mc_RS_dataset = mc_RS.dataset + ch_RS_dataset = ch_RS.dataset + in_RS_dataset = indian_RS.dataset + tbx11k_RS_dataset = tbx11k_RS.dataset + + assert "train" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["train"]) == len( + mc_RS_dataset["train"] + ) + len(ch_RS_dataset["train"]) + len(in_RS_dataset["train"] + len( + tbx11k_RS_dataset["train"])) + + assert "validation" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["validation"]) == len( + mc_RS_dataset["validation"] + ) + len(ch_RS_dataset["validation"]) + len(in_RS_dataset["validation"] + len( + tbx11k_RS_dataset["validation"])) + + assert "test" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["test"]) == len(mc_RS_dataset["test"]) + len( + ch_RS_dataset["test"] + ) + len(in_RS_dataset["test"] + len(tbx11k_RS_dataset["test"])) + + # Fold 0 + mc_ch_in_11k_RS_dataset = mc_ch_in_11k_f0.dataset + assert isinstance(mc_ch_in_11k_RS_dataset, dict) + + mc_dataset = mc_f0.dataset + ch_dataset = ch_f0.dataset + in_dataset = indian_f0.dataset + tbx11k_dataset = tbx11k_f0.dataset + + assert "train" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["train"]) == len( + mc_dataset["train"] + ) + len(ch_dataset["train"]) + len(in_dataset["train"] + len( + tbx11k_dataset["train"])) + + assert "validation" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"] + len( + tbx11k_dataset["validation"])) + + assert "test" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"] + len(tbx11k_dataset["test"])) + + # Fold 1 + mc_ch_in_11k_RS_dataset = mc_ch_in_11k_f1.dataset + assert isinstance(mc_ch_in_11k_RS_dataset, dict) + + mc_dataset = mc_f1.dataset + ch_dataset = ch_f1.dataset + in_dataset = indian_f1.dataset + tbx11k_dataset = tbx11k_f1.dataset + + assert "train" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["train"]) == len( + mc_dataset["train"] + ) + len(ch_dataset["train"]) + len(in_dataset["train"] + len( + tbx11k_dataset["train"])) + + assert "validation" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"] + len( + tbx11k_dataset["validation"])) + + assert "test" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"] + len(tbx11k_dataset["test"])) + + # Fold 2 + mc_ch_in_11k_RS_dataset = mc_ch_in_11k_f2.dataset + assert isinstance(mc_ch_in_11k_RS_dataset, dict) + + mc_dataset = mc_f2.dataset + ch_dataset = ch_f2.dataset + in_dataset = indian_f2.dataset + tbx11k_dataset = tbx11k_f2.dataset + + assert "train" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["train"]) == len( + mc_dataset["train"] + ) + len(ch_dataset["train"]) + len(in_dataset["train"] + len( + tbx11k_dataset["train"])) + + assert "validation" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"] + len( + tbx11k_dataset["validation"])) + + assert "test" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"] + len(tbx11k_dataset["test"])) + + # Fold 3 + mc_ch_in_11k_RS_dataset = mc_ch_in_11k_f3.dataset + assert isinstance(mc_ch_in_11k_RS_dataset, dict) + + mc_dataset = mc_f3.dataset + ch_dataset = ch_f3.dataset + in_dataset = indian_f3.dataset + tbx11k_dataset = tbx11k_f3.dataset + + assert "train" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["train"]) == len( + mc_dataset["train"] + ) + len(ch_dataset["train"]) + len(in_dataset["train"] + len( + tbx11k_dataset["train"])) + + assert "validation" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"] + len( + tbx11k_dataset["validation"])) + + assert "test" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"] + len(tbx11k_dataset["test"])) + + # Fold 4 + mc_ch_in_11k_RS_dataset = mc_ch_in_11k_f4.dataset + assert isinstance(mc_ch_in_11k_RS_dataset, dict) + + mc_dataset = mc_f4.dataset + ch_dataset = ch_f4.dataset + in_dataset = indian_f4.dataset + tbx11k_dataset = tbx11k_f4.dataset + + assert "train" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["train"]) == len( + mc_dataset["train"] + ) + len(ch_dataset["train"]) + len(in_dataset["train"] + len( + tbx11k_dataset["train"])) + + assert "validation" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"] + len( + tbx11k_dataset["validation"])) + + assert "test" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"] + len(tbx11k_dataset["test"])) + + # Fold 5 + mc_ch_in_11k_RS_dataset = mc_ch_in_11k_f5.dataset + assert isinstance(mc_ch_in_11k_RS_dataset, dict) + + mc_dataset = mc_f5.dataset + ch_dataset = ch_f5.dataset + in_dataset = indian_f5.dataset + tbx11k_dataset = tbx11k_f5.dataset + + assert "train" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["train"]) == len( + mc_dataset["train"] + ) + len(ch_dataset["train"]) + len(in_dataset["train"] + len( + tbx11k_dataset["train"])) + + assert "validation" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"] + len( + tbx11k_dataset["validation"])) + + assert "test" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"] + len(tbx11k_dataset["test"])) + + # Fold 6 + mc_ch_in_11k_RS_dataset = mc_ch_in_11k_f6.dataset + assert isinstance(mc_ch_in_11k_RS_dataset, dict) + + mc_dataset = mc_f6.dataset + ch_dataset = ch_f6.dataset + in_dataset = indian_f6.dataset + tbx11k_dataset = tbx11k_f6.dataset + + assert "train" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["train"]) == len( + mc_dataset["train"] + ) + len(ch_dataset["train"]) + len(in_dataset["train"] + len( + tbx11k_dataset["train"])) + + assert "validation" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"] + len( + tbx11k_dataset["validation"])) + + assert "test" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"] + len(tbx11k_dataset["test"])) + + # Fold 7 + mc_ch_in_11k_RS_dataset = mc_ch_in_11k_f7.dataset + assert isinstance(mc_ch_in_11k_RS_dataset, dict) + + mc_dataset = mc_f7.dataset + ch_dataset = ch_f7.dataset + in_dataset = indian_f7.dataset + tbx11k_dataset = tbx11k_f7.dataset + + assert "train" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["train"]) == len( + mc_dataset["train"] + ) + len(ch_dataset["train"]) + len(in_dataset["train"] + len( + tbx11k_dataset["train"])) + + assert "validation" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"] + len( + tbx11k_dataset["validation"])) + + assert "test" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"] + len(tbx11k_dataset["test"])) + + # Fold 8 + mc_ch_in_11k_RS_dataset = mc_ch_in_11k_f8.dataset + assert isinstance(mc_ch_in_11k_RS_dataset, dict) + + mc_dataset = mc_f8.dataset + ch_dataset = ch_f8.dataset + in_dataset = indian_f8.dataset + tbx11k_dataset = tbx11k_f8.dataset + + assert "train" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["train"]) == len( + mc_dataset["train"] + ) + len(ch_dataset["train"]) + len(in_dataset["train"] + len( + tbx11k_dataset["train"])) + + assert "validation" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"] + len( + tbx11k_dataset["validation"])) + + assert "test" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"] + len(tbx11k_dataset["test"])) + + # Fold 9 + mc_ch_in_11k_RS_dataset = mc_ch_in_11k_f9.dataset + assert isinstance(mc_ch_in_11k_RS_dataset, dict) + + mc_dataset = mc_f9.dataset + ch_dataset = ch_f9.dataset + in_dataset = indian_f9.dataset + tbx11k_dataset = tbx11k_f9.dataset + + assert "train" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["train"]) == len( + mc_dataset["train"] + ) + len(ch_dataset["train"]) + len(in_dataset["train"] + len( + tbx11k_dataset["train"])) + + assert "validation" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["validation"]) == len( + mc_dataset["validation"] + ) + len(ch_dataset["validation"]) + len(in_dataset["validation"] + len( + tbx11k_dataset["validation"])) + + assert "test" in mc_ch_in_11k_RS_dataset + assert len(mc_ch_in_11k_RS_dataset["test"]) == len(mc_dataset["test"]) + len( + ch_dataset["test"] + ) + len(in_dataset["test"] + len(tbx11k_dataset["test"])) -- GitLab