diff --git a/src/ptbench/configs/datasets/tbx11k_simplified/fold_0.py b/src/ptbench/configs/datasets/tbx11k_simplified/fold_0.py new file mode 100644 index 0000000000000000000000000000000000000000..10c7f549de385770c6585612ebd2b2bafb9310ee --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified/fold_0.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_0") diff --git a/src/ptbench/configs/datasets/tbx11k_simplified/fold_0_rgb.py b/src/ptbench/configs/datasets/tbx11k_simplified/fold_0_rgb.py new file mode 100644 index 0000000000000000000000000000000000000000..6fe4cb2db658b4823cab36eb795d2a9563218fb3 --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified/fold_0_rgb.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_0", RGB=True) diff --git a/src/ptbench/configs/datasets/tbx11k_simplified/fold_1.py b/src/ptbench/configs/datasets/tbx11k_simplified/fold_1.py new file mode 100644 index 0000000000000000000000000000000000000000..ec8d22e871a1678553d37392a6cd4193d084130d --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified/fold_1.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_1") diff --git a/src/ptbench/configs/datasets/tbx11k_simplified/fold_1_rgb.py b/src/ptbench/configs/datasets/tbx11k_simplified/fold_1_rgb.py new file mode 100644 index 0000000000000000000000000000000000000000..33ded940784985f195c4ebd95cbbeb0e8d8980e8 --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified/fold_1_rgb.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_1", RGB=True) diff --git a/src/ptbench/configs/datasets/tbx11k_simplified/fold_2.py b/src/ptbench/configs/datasets/tbx11k_simplified/fold_2.py new file mode 100644 index 0000000000000000000000000000000000000000..77493339ddc90f708f0dbc7de00dbb88f3bd9ccf --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified/fold_2.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_2") diff --git a/src/ptbench/configs/datasets/tbx11k_simplified/fold_2_rgb.py b/src/ptbench/configs/datasets/tbx11k_simplified/fold_2_rgb.py new file mode 100644 index 0000000000000000000000000000000000000000..fd7e7b6549c8bda7b9902fb6ce7fb471d9a4cfb8 --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified/fold_2_rgb.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_2", RGB=True) diff --git a/src/ptbench/configs/datasets/tbx11k_simplified/fold_3.py b/src/ptbench/configs/datasets/tbx11k_simplified/fold_3.py new file mode 100644 index 0000000000000000000000000000000000000000..4906ed7bf1310f3333bd64899c5645554238e3d9 --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified/fold_3.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_3") diff --git a/src/ptbench/configs/datasets/tbx11k_simplified/fold_3_rgb.py b/src/ptbench/configs/datasets/tbx11k_simplified/fold_3_rgb.py new file mode 100644 index 0000000000000000000000000000000000000000..0b764e095e764fba27efbac92f61ba8b3b7bfced --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified/fold_3_rgb.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_3", RGB=True) diff --git a/src/ptbench/configs/datasets/tbx11k_simplified/fold_4.py b/src/ptbench/configs/datasets/tbx11k_simplified/fold_4.py new file mode 100644 index 0000000000000000000000000000000000000000..5179e359319e9face3b4e8b32eb8d5a86eb619b0 --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified/fold_4.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_4") diff --git a/src/ptbench/configs/datasets/tbx11k_simplified/fold_4_rgb.py b/src/ptbench/configs/datasets/tbx11k_simplified/fold_4_rgb.py new file mode 100644 index 0000000000000000000000000000000000000000..4f57495482f3a8ae82f3aae4b7657e94689609af --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified/fold_4_rgb.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_4", RGB=True) diff --git a/src/ptbench/configs/datasets/tbx11k_simplified/fold_5.py b/src/ptbench/configs/datasets/tbx11k_simplified/fold_5.py new file mode 100644 index 0000000000000000000000000000000000000000..4ec01f68557b0cd016f9f6f5780c1fbb8db86a7b --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified/fold_5.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_5") diff --git a/src/ptbench/configs/datasets/tbx11k_simplified/fold_5_rgb.py b/src/ptbench/configs/datasets/tbx11k_simplified/fold_5_rgb.py new file mode 100644 index 0000000000000000000000000000000000000000..46bc55302aebd6e519a4c4e63c3f01ab9f9c699b --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified/fold_5_rgb.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_5", RGB=True) diff --git a/src/ptbench/configs/datasets/tbx11k_simplified/fold_6.py b/src/ptbench/configs/datasets/tbx11k_simplified/fold_6.py new file mode 100644 index 0000000000000000000000000000000000000000..f88776c9d0fb877e48cb555984bd2724a68af3ac --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified/fold_6.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_6") diff --git a/src/ptbench/configs/datasets/tbx11k_simplified/fold_6_rgb.py b/src/ptbench/configs/datasets/tbx11k_simplified/fold_6_rgb.py new file mode 100644 index 0000000000000000000000000000000000000000..26adeb38171bbd15fe6f7b29c3618885600397bc --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified/fold_6_rgb.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_6", RGB=True) diff --git a/src/ptbench/configs/datasets/tbx11k_simplified/fold_7.py b/src/ptbench/configs/datasets/tbx11k_simplified/fold_7.py new file mode 100644 index 0000000000000000000000000000000000000000..756dc9c877ec3f14950b5406c7ecaa7036b8d9c0 --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified/fold_7.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_7") diff --git a/src/ptbench/configs/datasets/tbx11k_simplified/fold_7_rgb.py b/src/ptbench/configs/datasets/tbx11k_simplified/fold_7_rgb.py new file mode 100644 index 0000000000000000000000000000000000000000..17c2f7494f0ff4532db3791413fe7d9b1096a7ca --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified/fold_7_rgb.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_7", RGB=True) diff --git a/src/ptbench/configs/datasets/tbx11k_simplified/fold_8.py b/src/ptbench/configs/datasets/tbx11k_simplified/fold_8.py new file mode 100644 index 0000000000000000000000000000000000000000..1b267cd5dfe004bf11217a0ac61489b9de8f720d --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified/fold_8.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_8") diff --git a/src/ptbench/configs/datasets/tbx11k_simplified/fold_8_rgb.py b/src/ptbench/configs/datasets/tbx11k_simplified/fold_8_rgb.py new file mode 100644 index 0000000000000000000000000000000000000000..dea5aa546a8c89c1bc3c1f87e5737c255ff487b8 --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified/fold_8_rgb.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_8", RGB=True) diff --git a/src/ptbench/configs/datasets/tbx11k_simplified/fold_9.py b/src/ptbench/configs/datasets/tbx11k_simplified/fold_9.py new file mode 100644 index 0000000000000000000000000000000000000000..74696cf6f8fc31d0bfcbc3c4e63bcf51571cdb2f --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified/fold_9.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_9") diff --git a/src/ptbench/configs/datasets/tbx11k_simplified/fold_9_rgb.py b/src/ptbench/configs/datasets/tbx11k_simplified/fold_9_rgb.py new file mode 100644 index 0000000000000000000000000000000000000000..a00ab68d9b3f44584b8efe9248a9947796c4694b --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified/fold_9_rgb.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_9", RGB=True) diff --git a/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_0.py b/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_0.py new file mode 100644 index 0000000000000000000000000000000000000000..10c7f549de385770c6585612ebd2b2bafb9310ee --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_0.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_0") diff --git a/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_1.py b/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_1.py new file mode 100644 index 0000000000000000000000000000000000000000..ec8d22e871a1678553d37392a6cd4193d084130d --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_1.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_1") diff --git a/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_2.py b/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_2.py new file mode 100644 index 0000000000000000000000000000000000000000..77493339ddc90f708f0dbc7de00dbb88f3bd9ccf --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_2.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_2") diff --git a/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_3.py b/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_3.py new file mode 100644 index 0000000000000000000000000000000000000000..4906ed7bf1310f3333bd64899c5645554238e3d9 --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_3.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_3") diff --git a/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_4.py b/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_4.py new file mode 100644 index 0000000000000000000000000000000000000000..5179e359319e9face3b4e8b32eb8d5a86eb619b0 --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_4.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_4") diff --git a/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_5.py b/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_5.py new file mode 100644 index 0000000000000000000000000000000000000000..4ec01f68557b0cd016f9f6f5780c1fbb8db86a7b --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_5.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_5") diff --git a/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_6.py b/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_6.py new file mode 100644 index 0000000000000000000000000000000000000000..f88776c9d0fb877e48cb555984bd2724a68af3ac --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_6.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_6") diff --git a/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_7.py b/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_7.py new file mode 100644 index 0000000000000000000000000000000000000000..756dc9c877ec3f14950b5406c7ecaa7036b8d9c0 --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_7.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_7") diff --git a/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_8.py b/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_8.py new file mode 100644 index 0000000000000000000000000000000000000000..1b267cd5dfe004bf11217a0ac61489b9de8f720d --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_8.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_8") diff --git a/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_9.py b/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_9.py new file mode 100644 index 0000000000000000000000000000000000000000..74696cf6f8fc31d0bfcbc3c4e63bcf51571cdb2f --- /dev/null +++ b/src/ptbench/configs/datasets/tbx11k_simplified_RS/fold_9.py @@ -0,0 +1,17 @@ +# Copyright © 2022 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""TBX11k simplified dataset for TB detection (default protocol) + +* Split reference: first 62.5% of TB and healthy CXR for "train" 15.9% for +* "validation", 21.6% for "test" +* This split only consists of healthy and active TB samples +* "Latent TB" or "sick & non-TB" samples are not included in this configuration +* This configuration resolution: 512 x 512 (default) +* See :py:mod:`ptbench.data.tbx11k` for dataset details +""" + +from . import _maker + +dataset = _maker("fold_9") diff --git a/src/ptbench/data/tbx11k_simplified/__init__.py b/src/ptbench/data/tbx11k_simplified/__init__.py index aa5abf05b9fc6f698d6451f48fbf2fd89e2106d4..0b47442003653f438592fa001ab005a363da086c 100644 --- a/src/ptbench/data/tbx11k_simplified/__init__.py +++ b/src/ptbench/data/tbx11k_simplified/__init__.py @@ -32,16 +32,16 @@ from ..loader import load_pil_baw, make_delayed _protocols = [ importlib.resources.files(__name__).joinpath("default.json.bz2"), - # importlib.resources.files(__name__).joinpath("fold_0.json.bz2"), - # importlib.resources.files(__name__).joinpath("fold_1.json.bz2"), - # importlib.resources.files(__name__).joinpath("fold_2.json.bz2"), - # importlib.resources.files(__name__).joinpath("fold_3.json.bz2"), - # importlib.resources.files(__name__).joinpath("fold_4.json.bz2"), - # importlib.resources.files(__name__).joinpath("fold_5.json.bz2"), - # importlib.resources.files(__name__).joinpath("fold_6.json.bz2"), - # importlib.resources.files(__name__).joinpath("fold_7.json.bz2"), - # importlib.resources.files(__name__).joinpath("fold_8.json.bz2"), - # importlib.resources.files(__name__).joinpath("fold_9.json.bz2"), + importlib.resources.files(__name__).joinpath("fold_0.json.bz2"), + importlib.resources.files(__name__).joinpath("fold_1.json.bz2"), + importlib.resources.files(__name__).joinpath("fold_2.json.bz2"), + importlib.resources.files(__name__).joinpath("fold_3.json.bz2"), + importlib.resources.files(__name__).joinpath("fold_4.json.bz2"), + importlib.resources.files(__name__).joinpath("fold_5.json.bz2"), + importlib.resources.files(__name__).joinpath("fold_6.json.bz2"), + importlib.resources.files(__name__).joinpath("fold_7.json.bz2"), + importlib.resources.files(__name__).joinpath("fold_8.json.bz2"), + importlib.resources.files(__name__).joinpath("fold_9.json.bz2"), ] _datadir = load_rc().get( diff --git a/src/ptbench/data/tbx11k_simplified/fold_0.json.bz2 b/src/ptbench/data/tbx11k_simplified/fold_0.json.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..4463da3f0d7e6a8dfe15cd699d626ef335cb182b Binary files /dev/null and b/src/ptbench/data/tbx11k_simplified/fold_0.json.bz2 differ diff --git a/src/ptbench/data/tbx11k_simplified/fold_1.json.bz2 b/src/ptbench/data/tbx11k_simplified/fold_1.json.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..c4a712decdeab35f8a9b0c488fcc9155e4478e56 Binary files /dev/null and b/src/ptbench/data/tbx11k_simplified/fold_1.json.bz2 differ diff --git a/src/ptbench/data/tbx11k_simplified/fold_2.json.bz2 b/src/ptbench/data/tbx11k_simplified/fold_2.json.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..5c6bdd7684adf0f995cd15271f64f793e97e7505 Binary files /dev/null and b/src/ptbench/data/tbx11k_simplified/fold_2.json.bz2 differ diff --git a/src/ptbench/data/tbx11k_simplified/fold_3.json.bz2 b/src/ptbench/data/tbx11k_simplified/fold_3.json.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..738a75b4ced0ccf953887f857a3ce1dab8c4a501 Binary files /dev/null and b/src/ptbench/data/tbx11k_simplified/fold_3.json.bz2 differ diff --git a/src/ptbench/data/tbx11k_simplified/fold_4.json.bz2 b/src/ptbench/data/tbx11k_simplified/fold_4.json.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..dfe34d4b1b8ec43fd36f24b47f676a65a6569ce2 Binary files /dev/null and b/src/ptbench/data/tbx11k_simplified/fold_4.json.bz2 differ diff --git a/src/ptbench/data/tbx11k_simplified/fold_5.json.bz2 b/src/ptbench/data/tbx11k_simplified/fold_5.json.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..c88efb07aed02ec7856e4b933d8d0e3c5a0d4f79 Binary files /dev/null and b/src/ptbench/data/tbx11k_simplified/fold_5.json.bz2 differ diff --git a/src/ptbench/data/tbx11k_simplified/fold_6.json.bz2 b/src/ptbench/data/tbx11k_simplified/fold_6.json.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..6f4dc219979fb063ba935c94e930ebb54e242001 Binary files /dev/null and b/src/ptbench/data/tbx11k_simplified/fold_6.json.bz2 differ diff --git a/src/ptbench/data/tbx11k_simplified/fold_7.json.bz2 b/src/ptbench/data/tbx11k_simplified/fold_7.json.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..b632c2d24fde97542f3bc71b486221c64b373a55 Binary files /dev/null and b/src/ptbench/data/tbx11k_simplified/fold_7.json.bz2 differ diff --git a/src/ptbench/data/tbx11k_simplified/fold_8.json.bz2 b/src/ptbench/data/tbx11k_simplified/fold_8.json.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..c1307ff0a76c7613b9c28b9a87f9ab5d4c085406 Binary files /dev/null and b/src/ptbench/data/tbx11k_simplified/fold_8.json.bz2 differ diff --git a/src/ptbench/data/tbx11k_simplified/fold_9.json.bz2 b/src/ptbench/data/tbx11k_simplified/fold_9.json.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..c94fbf01598c0179e52794606e4643db81963ee0 Binary files /dev/null and b/src/ptbench/data/tbx11k_simplified/fold_9.json.bz2 differ diff --git a/tests/test_11k.py b/tests/test_11k.py index e418f700fe57b220a22f93ab9d4afdd4dbd40bc2..9f795f5f6fb4d858eb4300289b505f609db1170e 100644 --- a/tests/test_11k.py +++ b/tests/test_11k.py @@ -39,65 +39,35 @@ def test_protocol_consistency(): for s in subset["test"]: assert s.label in [0.0, 1.0] - # Cross-validation fold 0-7 - #for f in range(8): - # subset = dataset.subsets("fold_" + str(f)) - # assert len(subset) == 3 - # - # assert "train" in subset - # assert len(subset["train"]) == 99 - # for s in subset["train"]: - # assert s.key.startswith("CXR_png/MCUCXR_0") - # - # assert "validation" in subset - # assert len(subset["validation"]) == 25 - # for s in subset["validation"]: - # assert s.key.startswith("CXR_png/MCUCXR_0") - # - # assert "test" in subset - # assert len(subset["test"]) == 14 - # for s in subset["test"]: - # assert s.key.startswith("CXR_png/MCUCXR_0") - # - # Check labels - # for s in subset["train"]: - # assert s.label in [0.0, 1.0] - # - # for s in subset["validation"]: - # assert s.label in [0.0, 1.0] - # - # for s in subset["test"]: - # assert s.label in [0.0, 1.0] - # - # Cross-validation fold 8-9 - #for f in range(8, 10): - # subset = dataset.subsets("fold_" + str(f)) - # assert len(subset) == 3 - # - # assert "train" in subset - # assert len(subset["train"]) == 100 - # for s in subset["train"]: - # assert s.key.startswith("CXR_png/MCUCXR_0") - # - # assert "validation" in subset - # assert len(subset["validation"]) == 25 - # for s in subset["validation"]: - # assert s.key.startswith("CXR_png/MCUCXR_0") - # - # assert "test" in subset - # assert len(subset["test"]) == 13 - # for s in subset["test"]: - # assert s.key.startswith("CXR_png/MCUCXR_0") - # + # Cross-validation fold 0-9 + for f in range(10): + subset = dataset.subsets("fold_" + str(f)) + assert len(subset) == 3 + + assert "train" in subset + assert len(subset["train"]) == 3177 + for s in subset["train"]: + assert s.key.startswith("images/") + + assert "validation" in subset + assert len(subset["validation"]) == 810 + for s in subset["validation"]: + assert s.key.startswith("images/") + + assert "test" in subset + assert len(subset["test"]) == 443 + for s in subset["test"]: + assert s.key.startswith("images/") + # Check labels - # for s in subset["train"]: - # assert s.label in [0.0, 1.0] - # - # for s in subset["validation"]: - # assert s.label in [0.0, 1.0] - # - # for s in subset["test"]: - # assert s.label in [0.0, 1.0] + for s in subset["train"]: + assert s.label in [0.0, 1.0] + + for s in subset["validation"]: + assert s.label in [0.0, 1.0] + + for s in subset["test"]: + assert s.label in [0.0, 1.0] @pytest.mark.skip_if_rc_var_not_set("datadir.tbx11k_simplified")