Skip to content
Snippets Groups Projects
Commit 0ba35d8c authored by Daniel CARRON's avatar Daniel CARRON :b: Committed by André Anjos
Browse files

Moved mc_ch configs to data

parent 00c5f0f0
No related branches found
No related tags found
1 merge request!6Making use of LightningDataModule and simplification of data loading
Showing
with 22 additions and 288 deletions
......@@ -257,28 +257,28 @@ tbx11k_simplified_v2_rs_f7 = "ptbench.configs.datasets.tbx11k_simplified_v2_RS.f
tbx11k_simplified_v2_rs_f8 = "ptbench.configs.datasets.tbx11k_simplified_v2_RS.fold_8"
tbx11k_simplified_v2_rs_f9 = "ptbench.configs.datasets.tbx11k_simplified_v2_RS.fold_9"
# montgomery-shenzhen aggregated dataset
mc_ch = "ptbench.configs.datasets.mc_ch.default"
mc_ch_rgb = "ptbench.configs.datasets.mc_ch.rgb"
mc_ch_f0 = "ptbench.configs.datasets.mc_ch.fold_0"
mc_ch_f1 = "ptbench.configs.datasets.mc_ch.fold_1"
mc_ch_f2 = "ptbench.configs.datasets.mc_ch.fold_2"
mc_ch_f3 = "ptbench.configs.datasets.mc_ch.fold_3"
mc_ch_f4 = "ptbench.configs.datasets.mc_ch.fold_4"
mc_ch_f5 = "ptbench.configs.datasets.mc_ch.fold_5"
mc_ch_f6 = "ptbench.configs.datasets.mc_ch.fold_6"
mc_ch_f7 = "ptbench.configs.datasets.mc_ch.fold_7"
mc_ch_f8 = "ptbench.configs.datasets.mc_ch.fold_8"
mc_ch_f9 = "ptbench.configs.datasets.mc_ch.fold_9"
mc_ch_f0_rgb = "ptbench.configs.datasets.mc_ch.fold_0_rgb"
mc_ch_f1_rgb = "ptbench.configs.datasets.mc_ch.fold_1_rgb"
mc_ch_f2_rgb = "ptbench.configs.datasets.mc_ch.fold_2_rgb"
mc_ch_f3_rgb = "ptbench.configs.datasets.mc_ch.fold_3_rgb"
mc_ch_f4_rgb = "ptbench.configs.datasets.mc_ch.fold_4_rgb"
mc_ch_f5_rgb = "ptbench.configs.datasets.mc_ch.fold_5_rgb"
mc_ch_f6_rgb = "ptbench.configs.datasets.mc_ch.fold_6_rgb"
mc_ch_f7_rgb = "ptbench.configs.datasets.mc_ch.fold_7_rgb"
mc_ch_f8_rgb = "ptbench.configs.datasets.mc_ch.fold_8_rgb"
mc_ch_f9_rgb = "ptbench.configs.datasets.mc_ch.fold_9_rgb"
mc_ch = "ptbench.data.mc_ch.default"
mc_ch_rgb = "ptbench.data.mc_ch.rgb"
mc_ch_f0 = "ptbench.data.mc_ch.fold_0"
mc_ch_f1 = "ptbench.data.mc_ch.fold_1"
mc_ch_f2 = "ptbench.data.mc_ch.fold_2"
mc_ch_f3 = "ptbench.data.mc_ch.fold_3"
mc_ch_f4 = "ptbench.data.mc_ch.fold_4"
mc_ch_f5 = "ptbench.data.mc_ch.fold_5"
mc_ch_f6 = "ptbench.data.mc_ch.fold_6"
mc_ch_f7 = "ptbench.data.mc_ch.fold_7"
mc_ch_f8 = "ptbench.data.mc_ch.fold_8"
mc_ch_f9 = "ptbench.data.mc_ch.fold_9"
mc_ch_f0_rgb = "ptbench.data.mc_ch.fold_0_rgb"
mc_ch_f1_rgb = "ptbench.data.mc_ch.fold_1_rgb"
mc_ch_f2_rgb = "ptbench.data.mc_ch.fold_2_rgb"
mc_ch_f3_rgb = "ptbench.data.mc_ch.fold_3_rgb"
mc_ch_f4_rgb = "ptbench.data.mc_ch.fold_4_rgb"
mc_ch_f5_rgb = "ptbench.data.mc_ch.fold_5_rgb"
mc_ch_f6_rgb = "ptbench.data.mc_ch.fold_6_rgb"
mc_ch_f7_rgb = "ptbench.data.mc_ch.fold_7_rgb"
mc_ch_f8_rgb = "ptbench.data.mc_ch.fold_8_rgb"
mc_ch_f9_rgb = "ptbench.data.mc_ch.fold_9_rgb"
# extended montgomery-shenzhen aggregated dataset
# (with radiological signs)
mc_ch_rs = "ptbench.configs.datasets.mc_ch_RS.default"
......
# Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
from torch.utils.data.dataset import ConcatDataset
def _maker(protocol):
if protocol == "default":
from ..montgomery import default as mc
from ..shenzhen import default as ch
elif protocol == "rgb":
from ..montgomery import rgb as mc
from ..shenzhen import rgb as ch
elif protocol == "fold_0":
from ..montgomery import fold_0 as mc
from ..shenzhen import fold_0 as ch
elif protocol == "fold_1":
from ..montgomery import fold_1 as mc
from ..shenzhen import fold_1 as ch
elif protocol == "fold_2":
from ..montgomery import fold_2 as mc
from ..shenzhen import fold_2 as ch
elif protocol == "fold_3":
from ..montgomery import fold_3 as mc
from ..shenzhen import fold_3 as ch
elif protocol == "fold_4":
from ..montgomery import fold_4 as mc
from ..shenzhen import fold_4 as ch
elif protocol == "fold_5":
from ..montgomery import fold_5 as mc
from ..shenzhen import fold_5 as ch
elif protocol == "fold_6":
from ..montgomery import fold_6 as mc
from ..shenzhen import fold_6 as ch
elif protocol == "fold_7":
from ..montgomery import fold_7 as mc
from ..shenzhen import fold_7 as ch
elif protocol == "fold_8":
from ..montgomery import fold_8 as mc
from ..shenzhen import fold_8 as ch
elif protocol == "fold_9":
from ..montgomery import fold_9 as mc
from ..shenzhen import fold_9 as ch
elif protocol == "fold_0_rgb":
from ..montgomery import fold_0_rgb as mc
from ..shenzhen import fold_0_rgb as ch
elif protocol == "fold_1_rgb":
from ..montgomery import fold_1_rgb as mc
from ..shenzhen import fold_1_rgb as ch
elif protocol == "fold_2_rgb":
from ..montgomery import fold_2_rgb as mc
from ..shenzhen import fold_2_rgb as ch
elif protocol == "fold_3_rgb":
from ..montgomery import fold_3_rgb as mc
from ..shenzhen import fold_3_rgb as ch
elif protocol == "fold_4_rgb":
from ..montgomery import fold_4_rgb as mc
from ..shenzhen import fold_4_rgb as ch
elif protocol == "fold_5_rgb":
from ..montgomery import fold_5_rgb as mc
from ..shenzhen import fold_5_rgb as ch
elif protocol == "fold_6_rgb":
from ..montgomery import fold_6_rgb as mc
from ..shenzhen import fold_6_rgb as ch
elif protocol == "fold_7_rgb":
from ..montgomery import fold_7_rgb as mc
from ..shenzhen import fold_7_rgb as ch
elif protocol == "fold_8_rgb":
from ..montgomery import fold_8_rgb as mc
from ..shenzhen import fold_8_rgb as ch
elif protocol == "fold_9_rgb":
from ..montgomery import fold_9_rgb as mc
from ..shenzhen import fold_9_rgb as ch
mc = mc.dataset
ch = ch.dataset
dataset = {}
dataset["__train__"] = ConcatDataset([mc["__train__"], ch["__train__"]])
dataset["train"] = ConcatDataset([mc["train"], ch["train"]])
dataset["__valid__"] = ConcatDataset([mc["__valid__"], ch["__valid__"]])
dataset["validation"] = ConcatDataset([mc["validation"], ch["validation"]])
dataset["test"] = ConcatDataset([mc["test"], ch["test"]])
return dataset
# Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated dataset composed of Montgomery and Shenzhen datasets (cross
validation fold 0)"""
from . import _maker
dataset = _maker("fold_0")
# Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated dataset composed of Montgomery and Shenzhen datasets (cross
validation fold 0, RGB)"""
from . import _maker
dataset = _maker("fold_0_rgb")
# Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated dataset composed of Montgomery and Shenzhen datasets (cross
validation fold 1)"""
from . import _maker
dataset = _maker("fold_1")
# Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated dataset composed of Montgomery and Shenzhen datasets (cross
validation fold 1, RGB)"""
from . import _maker
dataset = _maker("fold_1_rgb")
# Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated dataset composed of Montgomery and Shenzhen datasets (cross
validation fold 2)"""
from . import _maker
dataset = _maker("fold_2")
# Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated dataset composed of Montgomery and Shenzhen datasets (cross
validation fold 2, RGB)"""
from . import _maker
dataset = _maker("fold_2_rgb")
# Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated dataset composed of Montgomery and Shenzhen datasets (cross
validation fold 3)"""
from . import _maker
dataset = _maker("fold_3")
# Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated dataset composed of Montgomery and Shenzhen datasets (cross
validation fold 3, RGB)"""
from . import _maker
dataset = _maker("fold_3_rgb")
# Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated dataset composed of Montgomery and Shenzhen datasets (cross
validation fold 4)"""
from . import _maker
dataset = _maker("fold_4")
# Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated dataset composed of Montgomery and Shenzhen datasets (cross
validation fold 4, RGB)"""
from . import _maker
dataset = _maker("fold_4_rgb")
# Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated dataset composed of Montgomery and Shenzhen datasets (cross
validation fold 5)"""
from . import _maker
dataset = _maker("fold_5")
# Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated dataset composed of Montgomery and Shenzhen datasets (cross
validation fold 5, RGB)"""
from . import _maker
dataset = _maker("fold_5_rgb")
# Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated dataset composed of Montgomery and Shenzhen datasets (cross
validation fold 6)"""
from . import _maker
dataset = _maker("fold_6")
# Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated dataset composed of Montgomery and Shenzhen datasets (cross
validation fold 6, RGB)"""
from . import _maker
dataset = _maker("fold_6_rgb")
# Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated dataset composed of Montgomery and Shenzhen datasets (cross
validation fold 7)"""
from . import _maker
dataset = _maker("fold_7")
# Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated dataset composed of Montgomery and Shenzhen datasets (cross
validation fold 7, RGB)"""
from . import _maker
dataset = _maker("fold_7_rgb")
# Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated dataset composed of Montgomery and Shenzhen datasets (cross
validation fold 8)"""
from . import _maker
dataset = _maker("fold_8")
# Copyright © 2022 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated dataset composed of Montgomery and Shenzhen datasets (cross
validation fold 8, RGB)"""
from . import _maker
dataset = _maker("fold_8_rgb")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment