diff --git a/chromalive/my_conf/dataset/BBBC021/BBBC021_196_nocodazole_inference.py b/chromalive/my_conf/dataset/BBBC021/BBBC021_196_nocodazole_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..2fd645605155ba077146456026029f9c41f1d302 --- /dev/null +++ b/chromalive/my_conf/dataset/BBBC021/BBBC021_196_nocodazole_inference.py @@ -0,0 +1,26 @@ +from dataclasses import replace + +from GaussianProxy.conf.dataset.BBBC021.BBBC021_196_inference import dataset + +# Nocodazole classes + DMSO +CLASSES_IN_ORDER = ( + "DMSO", + "nocodazole_0.001", + "nocodazole_0.003", + "nocodazole_0.01", + "nocodazole_0.03", + "nocodazole_0.1", + "nocodazole_0.3", + "nocodazole_1.0", + "nocodazole_3.0", +) +assert dataset.dataset_params is not None +ds_params = replace(dataset.dataset_params, sorting_func=lambda subdir: CLASSES_IN_ORDER.index(subdir.name)) + +# Path and name +dataset = replace( + dataset, + name=dataset.name + "_nocodazole", + dataset_params=ds_params, + path="/projects/static2dynamic/datasets/BBBC021/196x196/nocodazole", +) diff --git a/chromalive/my_conf/dataset/Jurkat/Jurkat_brightfield_fully_ordered.yaml b/chromalive/my_conf/dataset/Jurkat/Jurkat_brightfield_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7c4133274ac9c90bb7ec8fde4fe2736a3724fa30 --- /dev/null +++ b/chromalive/my_conf/dataset/Jurkat/Jurkat_brightfield_fully_ordered.yaml @@ -0,0 +1,23 @@ +name: Jurkat_brightfield_fully_ordered + +path: /projects/static2dynamic/datasets/Jurkat/brightfield_reprocessed +path_to_single_parquet: /projects/static2dynamic/datasets/Jurkat/Jurkat_brightfield__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet + +data_shape: [ 1, 66, 66 ] + +transforms: + _target_: torchvision.transforms.transforms.Compose + transforms: + - _target_: torchvision.transforms.ConvertImageDtype # this also scales to [0; 1] + dtype: ${torch_dtype:float32} # passed dtype must be accessible as a "torch" attribute + - _target_: torchvision.transforms.Normalize + mean: [ 0.5 ] + std: [ 0.5 ] + - _target_: torchvision.transforms.RandomHorizontalFlip + - _target_: torchvision.transforms.RandomVerticalFlip + - _target_: GaussianProxy.utils.data.RandomRotationSquareSymmetry + +expected_initial_data_range: [ 0, 255 ] +expected_dtype: torch.uint8 + +fully_ordered: true diff --git a/chromalive/my_conf/dataset/Jurkat/Jurkat_brightfield_fully_ordered_inference.py b/chromalive/my_conf/dataset/Jurkat/Jurkat_brightfield_fully_ordered_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..b847a2ea0da14b9271d0561105275ead359de4c7 --- /dev/null +++ b/chromalive/my_conf/dataset/Jurkat/Jurkat_brightfield_fully_ordered_inference.py @@ -0,0 +1,4 @@ +from GaussianProxy.conf.dataset.Jurkat.Jurkat_brightfield_fully_ordered_inference import dataset + +dataset.path = "/projects/static2dynamic/datasets/Jurkat/brightfield_reprocessed" +dataset.path_to_single_parquet = "/projects/static2dynamic/datasets/Jurkat/Jurkat_brightfield__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet" diff --git a/chromalive/my_conf/dataset/Jurkat/Jurkat_inference_hard_aug.py b/chromalive/my_conf/dataset/Jurkat/Jurkat_inference_hard_aug.py new file mode 100644 index 0000000000000000000000000000000000000000..cc826ec44e040ea3bdf9931f7434e47f5345cb9c --- /dev/null +++ b/chromalive/my_conf/dataset/Jurkat/Jurkat_inference_hard_aug.py @@ -0,0 +1,8 @@ +from dataclasses import replace + +from GaussianProxy.conf.dataset.Jurkat.Jurkat_inference import dataset + +dataset = replace( + dataset, + path="/projects/static2dynamic/datasets/Jurkat/rgb_images_all_cell_cycles_hard_augmented", +) diff --git a/chromalive/my_conf/dataset/NASH_fibrosis/NASH_fibrosis_inference.py b/chromalive/my_conf/dataset/NASH_fibrosis/NASH_fibrosis_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..c9e9e16f31c3c75bb780bc4832868bd0c6cebcce --- /dev/null +++ b/chromalive/my_conf/dataset/NASH_fibrosis/NASH_fibrosis_inference.py @@ -0,0 +1,3 @@ +from GaussianProxy.conf.dataset.NASH_fibrosis.NASH_fibrosis_inference import dataset + +dataset.path = "/projects/static2dynamic/datasets/NASH/prepared_data/fibrosis" diff --git a/chromalive/my_conf/dataset/NASH_steatosis/NASH_steatosis.yaml b/chromalive/my_conf/dataset/NASH_steatosis/NASH_steatosis.yaml new file mode 100644 index 0000000000000000000000000000000000000000..663b957dadc1791cc3cefb75d269b3579204ea5c --- /dev/null +++ b/chromalive/my_conf/dataset/NASH_steatosis/NASH_steatosis.yaml @@ -0,0 +1,24 @@ +name: NASH_steatosis +path: /projects/static2dynamic/datasets/NASH/prepared_data/steatosis +data_shape: [ 3, 128, 128 ] +transforms: + _target_: torchvision.transforms.transforms.Compose + transforms: + # Convert to float32 (and normalize to [0, 1]) before resizing + - _target_: torchvision.transforms.ConvertImageDtype + dtype: ${torch_dtype:float32} + # Random crop from 299x299 to 192x192, then resize to 128x128 + - _target_: torchvision.transforms.RandomCrop + size: 192 + - _target_: torchvision.transforms.Resize + size: 128 + # Normalize to [-1, 1] + - _target_: torchvision.transforms.Normalize + mean: [ 0.5, 0.5, 0.5 ] + std: [ 0.5, 0.5, 0.5 ] + # Random 8x square augmentations + - _target_: torchvision.transforms.RandomHorizontalFlip + - _target_: torchvision.transforms.RandomVerticalFlip + - _target_: GaussianProxy.utils.data.RandomRotationSquareSymmetry +selected_dists: +expected_initial_data_range: [ 0, 255 ] diff --git a/chromalive/my_conf/dataset/NASH_steatosis/NASH_steatosis_fully_ordered_inference.py b/chromalive/my_conf/dataset/NASH_steatosis/NASH_steatosis_fully_ordered_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..d9918cc6e00541668f1d52847f662fad05fcf329 --- /dev/null +++ b/chromalive/my_conf/dataset/NASH_steatosis/NASH_steatosis_fully_ordered_inference.py @@ -0,0 +1,4 @@ +from GaussianProxy.conf.dataset.NASH_steatosis.NASH_steatosis_fully_ordered_inference import dataset + +dataset.path = "/projects/static2dynamic/datasets/NASH/prepared_data/steatosis" +dataset.path_to_single_parquet = "/projects/static2dynamic/datasets/NASH/prepared_data/NASH_steatosis__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet" diff --git a/chromalive/my_conf/dataset/NASH_steatosis/NASH_steatosis_inference.py b/chromalive/my_conf/dataset/NASH_steatosis/NASH_steatosis_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..6e1d91853a23054a41429f141a048594f0446074 --- /dev/null +++ b/chromalive/my_conf/dataset/NASH_steatosis/NASH_steatosis_inference.py @@ -0,0 +1,3 @@ +from GaussianProxy.conf.dataset.NASH_steatosis.NASH_steatosis_inference import dataset + +dataset.path = "/projects/static2dynamic/datasets/NASH/prepared_data/steatosis" diff --git a/chromalive/my_conf/dataset/biotine/biotine_png_128_inference.py b/chromalive/my_conf/dataset/biotine/biotine_png_128_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..2f885668d8f708cce05382366a32dc71a3da7976 --- /dev/null +++ b/chromalive/my_conf/dataset/biotine/biotine_png_128_inference.py @@ -0,0 +1,8 @@ +from dataclasses import replace + +from GaussianProxy.conf.dataset.biotine.biotine_png_128_inference import dataset + +dataset = replace( + dataset, + path="/projects/static2dynamic/datasets/biotine/3_channels_min_99_perc_normalized_rgb_stacks_png/patches_255", +) diff --git a/chromalive/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2048_crop_inference.py b/chromalive/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2048_crop_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..84c134f0c7aa14e0f25ae95c629e26d719e7bd22 --- /dev/null +++ b/chromalive/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2048_crop_inference.py @@ -0,0 +1,9 @@ +from dataclasses import replace + +from GaussianProxy.conf.dataset.diabetic_retinopathy.diabetic_retinopathy_full_circle_augs_2048_crop_inference import ( + dataset, +) + +dataset = replace( + dataset, path="/projects/static2dynamic/datasets/DiabeticRetinopathy/prepared_dataset_full_circle_augmented" +) diff --git a/chromalive/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2048_precrop_inference.py b/chromalive/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2048_precrop_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..56a796fecda6f42247e83ee7b505cf738c625423 --- /dev/null +++ b/chromalive/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2048_precrop_inference.py @@ -0,0 +1,10 @@ +from dataclasses import replace + +from GaussianProxy.conf.dataset.diabetic_retinopathy.diabetic_retinopathy_full_circle_augs_2048_precrop_inference import ( + dataset, +) + +dataset = replace( + dataset, + path="/projects/static2dynamic/datasets/DiabeticRetinopathy/prepared_dataset_full_circle_augmented_2048_crop", +) diff --git a/chromalive/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2560_crop_inference.py b/chromalive/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2560_crop_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..1b4d5afef51491f9cb4907ab3c6f7a2eebf301b4 --- /dev/null +++ b/chromalive/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2560_crop_inference.py @@ -0,0 +1,9 @@ +from dataclasses import replace + +from GaussianProxy.conf.dataset.diabetic_retinopathy.diabetic_retinopathy_full_circle_augs_2560_crop_inference import ( + dataset, +) + +dataset = replace( + dataset, path="/projects/static2dynamic/datasets/DiabeticRetinopathy/prepared_dataset_full_circle_augmented" +) diff --git a/chromalive/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_hard_aug_inference.py b/chromalive/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_hard_aug_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..4f92904332804efa76648f229efa8d99331c7800 --- /dev/null +++ b/chromalive/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_hard_aug_inference.py @@ -0,0 +1,9 @@ +from dataclasses import replace + +from GaussianProxy.conf.dataset.diabetic_retinopathy.diabetic_retinopathy_inference import dataset + +dataset = replace( + dataset, + name="diabetic_retinopathy_inference_hard_augmented", + path="/projects/static2dynamic/datasets/DiabeticRetinopathy/prepared_dataset/train_hard_augmented", +) diff --git a/chromalive/my_conf/dataset/ependymal_context/ependymal_context.yaml b/chromalive/my_conf/dataset/ependymal_context/ependymal_context.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4301cfd2c648085445c33cb570d1a0941930efa0 --- /dev/null +++ b/chromalive/my_conf/dataset/ependymal_context/ependymal_context.yaml @@ -0,0 +1,16 @@ +name: ependymal_context +path: /projects/static2dynamic/datasets/ependymal/prepared_dataset_context +data_shape: [3, 256, 256] +transforms: + _target_: torchvision.transforms.transforms.Compose + transforms: + - _target_: torchvision.transforms.ConvertImageDtype # this also scales to [0; 1] + dtype: ${torch_dtype:float32} # passed dtype must be accessible as a "torch" attribute + - _target_: torchvision.transforms.Normalize + mean: [0.5, 0.5, 0.5] + std: [0.5, 0.5, 0.5] + - _target_: torchvision.transforms.RandomHorizontalFlip + - _target_: torchvision.transforms.RandomVerticalFlip + - _target_: GaussianProxy.utils.data.RandomRotationSquareSymmetry +expected_initial_data_range: [0, 255] +expected_dtype: torch.uint8 diff --git a/chromalive/my_conf/dataset/ependymal_context/ependymal_context_avg_t_fully_ordered_inference.py b/chromalive/my_conf/dataset/ependymal_context/ependymal_context_avg_t_fully_ordered_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..83ce32546f7aa4e097ca079b7ae975bbaec9c701 --- /dev/null +++ b/chromalive/my_conf/dataset/ependymal_context/ependymal_context_avg_t_fully_ordered_inference.py @@ -0,0 +1,31 @@ +from dataclasses import replace +from pathlib import Path + +from GaussianProxy.conf.dataset.ependymal_context.ependymal_context_fully_ordered_inference import dataset +from GaussianProxy.conf.training_conf import DatasetParams +from GaussianProxy.utils.data import ContinuousTimeImageDataset + + +# separate gt needs a workaround for sorting_func +def sorting_func(subdir: Path): + if subdir.name == "all_imgs": + return 0 + else: + raise ValueError(f"unexpected subdir: {subdir}") + + +ds_params = DatasetParams( + file_extension="png", + key_transform=str, + sorting_func=sorting_func, + dataset_class=ContinuousTimeImageDataset, +) + +dataset = replace( + dataset, + name="ependymal_context_avg_t_separate_gt_fully_ordered", + path="/projects/static2dynamic/datasets/ependymal/prepared_dataset_context_avg_pt_from_01_noised_facebook_dinov2-with-registers-giant/all_imgs", + path_to_single_parquet="/projects/static2dynamic/datasets/ependymal/prepared_dataset_context_avg_pt_from_01_noised_facebook_dinov2-with-registers-giant/ependymal_context__continuous_time_predictions__avg_t_preds.parquet", + dataset_params=ds_params, + separate_gt_starting_class_path="/projects/static2dynamic/datasets/ependymal/prepared_dataset_context/0" +) diff --git a/chromalive/my_conf/dataset/ependymal_context/ependymal_context_fully_ordered_inference.py b/chromalive/my_conf/dataset/ependymal_context/ependymal_context_fully_ordered_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..b62649854264f1653da9f1d727421730615f77b1 --- /dev/null +++ b/chromalive/my_conf/dataset/ependymal_context/ependymal_context_fully_ordered_inference.py @@ -0,0 +1,9 @@ +from dataclasses import replace + +from GaussianProxy.conf.dataset.ependymal_context.ependymal_context_fully_ordered_inference import dataset + +dataset = replace( + dataset, + path="/projects/static2dynamic/datasets/ependymal/prepared_dataset_context", + path_to_single_parquet="/projects/static2dynamic/datasets/ependymal/ependymal_context__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet", +) diff --git a/chromalive/my_conf/dataset/ependymal_cutout/ependymal_cutout.yaml b/chromalive/my_conf/dataset/ependymal_cutout/ependymal_cutout.yaml new file mode 100644 index 0000000000000000000000000000000000000000..67fc08a415914501a2d04527a3555ddc498f32f4 --- /dev/null +++ b/chromalive/my_conf/dataset/ependymal_cutout/ependymal_cutout.yaml @@ -0,0 +1,17 @@ +name: ependymal_cutout +path: /projects/static2dynamic/datasets/ependymal/prepared_dataset_crop +data_shape: [ 3, 256, 256 ] +transforms: + _target_: torchvision.transforms.transforms.Compose + transforms: + - _target_: torchvision.transforms.ConvertImageDtype # this also scales to [0; 1] + dtype: ${torch_dtype:float32} # passed dtype must be accessible as a "torch" attribute + - _target_: torchvision.transforms.Normalize + mean: [ 0.5, 0.5, 0.5 ] + std: [ 0.5, 0.5, 0.5 ] + - _target_: torchvision.transforms.RandomHorizontalFlip + - _target_: torchvision.transforms.RandomVerticalFlip + - _target_: GaussianProxy.utils.data.RandomRotationSquareSymmetry +expected_initial_data_range: [ 0, 255 ] +expected_dtype: torch.uint8 +selected_dists: [ 1, 2, 3, 4, 5, 6 ] # 0 is the trash class! diff --git a/chromalive/my_conf/dataset/ependymal_cutout/ependymal_cutout_01_noised_fc_augs_sep_gt_fully_ordered_inference.py b/chromalive/my_conf/dataset/ependymal_cutout/ependymal_cutout_01_noised_fc_augs_sep_gt_fully_ordered_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..b216741f454716031f9c01fa984ce0da9a1d64d6 --- /dev/null +++ b/chromalive/my_conf/dataset/ependymal_cutout/ependymal_cutout_01_noised_fc_augs_sep_gt_fully_ordered_inference.py @@ -0,0 +1,18 @@ +from dataclasses import replace + +from GaussianProxy.utils.data import ContinuousTimeImageDataset +from my_conf.dataset.ependymal_cutout.ependymal_cutout_01_noised_fc_augs_sep_gt_inference import dataset + +assert dataset.dataset_params is not None +dataset_params = replace( + dataset.dataset_params, + dataset_class=ContinuousTimeImageDataset, +) + +dataset = replace( + dataset, + fully_ordered=True, + path_to_single_parquet="/projects/static2dynamic/Thomas/ordering_datasets/facebook_dinov2-with-registers-giant_dataset_preproc/ependymal_cutout_01_noised_full_circle_augs/ependymal_cutout_01_noised_full_circle_augs__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet", + selected_dists=["all_imgs"], + dataset_params=dataset_params, +) diff --git a/chromalive/my_conf/dataset/ependymal_cutout/ependymal_cutout_01_noised_separate_gt_inference.py b/chromalive/my_conf/dataset/ependymal_cutout/ependymal_cutout_01_noised_separate_gt_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..3cb66f6d9fa66d668624fb5839d8871e9da68344 --- /dev/null +++ b/chromalive/my_conf/dataset/ependymal_cutout/ependymal_cutout_01_noised_separate_gt_inference.py @@ -0,0 +1,19 @@ +from dataclasses import replace +from pathlib import Path + +from GaussianProxy.conf.dataset.ependymal_cutout.ependymal_cutout_inference import dataset + +# note the data organization is special with separate ground truth folder +assert dataset.dataset_params is not None +dataset_params = replace( + dataset.dataset_params, + sorting_func=lambda subdir: str(subdir.name) if isinstance(subdir, Path) else str(subdir), +) # subdirs are "ground_truth" and "all_imgs" now... + +dataset = replace( + dataset, + name="ependymal_cutout_01_noised", + path="/projects/static2dynamic/datasets/ependymal/prepared_dataset_noised_0.1_crop/", + dataset_params=dataset_params, + separate_gt_starting_class_path="/projects/static2dynamic/datasets/ependymal/prepared_dataset_noised_0.1_crop/ground_truths/1", +) diff --git a/chromalive/my_conf/dataset/ependymal_cutout/ependymal_cutout_03_noised_separate_gt_fully_ordered_inference.py b/chromalive/my_conf/dataset/ependymal_cutout/ependymal_cutout_03_noised_separate_gt_fully_ordered_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..5517fd0b6bb735487c298727d126090536e16193 --- /dev/null +++ b/chromalive/my_conf/dataset/ependymal_cutout/ependymal_cutout_03_noised_separate_gt_fully_ordered_inference.py @@ -0,0 +1,18 @@ +from dataclasses import replace + +from GaussianProxy.utils.data import ContinuousTimeImageDataset +from my_conf.dataset.ependymal_cutout.ependymal_cutout_03_noised_separate_gt_inference import dataset + +assert dataset.dataset_params is not None +dataset_params = replace( + dataset.dataset_params, + dataset_class=ContinuousTimeImageDataset, +) + +dataset = replace( + dataset, + fully_ordered=True, + path_to_single_parquet="/projects/static2dynamic/datasets/ependymal/ependymal_cutout_03_noised__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet", + dataset_params=dataset_params, + selected_dists=["all_imgs"], +) diff --git a/chromalive/my_conf/dataset/ependymal_cutout/ependymal_cutout_white_bg_separate_gt_inference.py b/chromalive/my_conf/dataset/ependymal_cutout/ependymal_cutout_white_bg_separate_gt_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..807c4c6bcee124ac2b3c3ac0cb8a7251e60d71e6 --- /dev/null +++ b/chromalive/my_conf/dataset/ependymal_cutout/ependymal_cutout_white_bg_separate_gt_inference.py @@ -0,0 +1,16 @@ +from dataclasses import replace + +from GaussianProxy.conf.dataset.ependymal_cutout.ependymal_cutout_inference import dataset + +# note the data organization is special with separate ground truth folder +assert dataset.dataset_params is not None +dataset_params = replace( + dataset.dataset_params, sorting_func=lambda subdir: str(subdir.name) +) # subdirs are "ground_truth" and "all_imgs" now... + +dataset = replace( + dataset, + name="ependymal_cutout_white_bg", + path="/projects/static2dynamic/datasets/ependymal/prepared_dataset_white_bg_crop/", + dataset_params=dataset_params, +) diff --git a/chromalive/my_conf/dataset/human_embryo/human_embryo_fully_ordered_inference.py b/chromalive/my_conf/dataset/human_embryo/human_embryo_fully_ordered_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..2c721acb02a7a6aed59823cea62ba861992f8bd0 --- /dev/null +++ b/chromalive/my_conf/dataset/human_embryo/human_embryo_fully_ordered_inference.py @@ -0,0 +1,15 @@ +from dataclasses import replace + +from GaussianProxy.conf.dataset.human_embryo.human_embryo_inference import dataset +from GaussianProxy.utils.data import ContinuousTimeImageDataset1D + +assert dataset.dataset_params is not None +ds_params = replace(dataset.dataset_params, dataset_class=ContinuousTimeImageDataset1D) + +dataset = replace( + dataset, + path="/projects/imagesets3/2022_Gomez/reformated_phases/phases", + fully_ordered=True, + path_to_single_parquet="/projects/imagesets3/2022_Gomez/reformated_phases/human_embryo__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet", + dataset_params=ds_params, +) diff --git a/diabetic_retinopathy/my_conf/dataset/BBBC021/BBBC021_196_docetaxel_fully_ordered_inference.py b/diabetic_retinopathy/my_conf/dataset/BBBC021/BBBC021_196_docetaxel_fully_ordered_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..29419d6196c43f0aa4700ca97214606d539dc509 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/BBBC021/BBBC021_196_docetaxel_fully_ordered_inference.py @@ -0,0 +1,10 @@ +from dataclasses import replace + +from GaussianProxy.conf.dataset.BBBC021.BBBC021_196_fully_ordered_inference import dataset + +dataset = replace( + dataset, + name=dataset.name + "_docetaxel", + path="/projects/static2dynamic/datasets/BBBC021/196x196/docetaxel", + path_to_single_parquet="/projects/static2dynamic/datasets/BBBC021/196x196/BBBC021_196_docetaxel__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet", +) diff --git a/diabetic_retinopathy/my_conf/dataset/BBBC021/BBBC021_196_docetaxel_hard_aug_inference.py b/diabetic_retinopathy/my_conf/dataset/BBBC021/BBBC021_196_docetaxel_hard_aug_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..bd135b459e112c4860f979c12d5bf7064e5032ba --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/BBBC021/BBBC021_196_docetaxel_hard_aug_inference.py @@ -0,0 +1,9 @@ +from dataclasses import replace + +from GaussianProxy.conf.dataset.BBBC021.BBBC021_196_hard_aug_inference import dataset + +dataset = replace( + dataset, + name=dataset.name + "_docetaxel", + path="/projects/static2dynamic/datasets/BBBC021/196x196/docetaxel_hard_augmented", +) diff --git a/diabetic_retinopathy/my_conf/dataset/BBBC048/bbbc048.yaml b/diabetic_retinopathy/my_conf/dataset/BBBC048/bbbc048.yaml new file mode 100644 index 0000000000000000000000000000000000000000..10d8775e4a9a54bd5167de52272b15c4e3fc0d46 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/BBBC048/bbbc048.yaml @@ -0,0 +1,21 @@ +name: BBBC048_fully_ordered + +path: /projects/static2dynamic/datasets/Jurkat/brightfield_reprocessed_full_circle_augmented +path_to_single_parquet: /projects/static2dynamic/Thomas/ordering_datasets/facebook_dinov2-with-registers-giant_dataset_preproc/BBBC048/BBBC048__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet + +data_shape: [ 1, 48, 48 ] + +transforms: + _target_: torchvision.transforms.v2.Compose + transforms: + - _target_: torchvision.transforms.v2.ToDtype + dtype: ${torch_dtype:float32} # passed dtype must be accessible as a "torch" attribute + scale: true + - _target_: torchvision.transforms.v2.Normalize + mean: [ 0.5 ] + std: [ 0.5 ] + +expected_initial_data_range: [ 0, 255 ] +expected_dtype: torch.uint8 + +fully_ordered: true diff --git a/diabetic_retinopathy/my_conf/dataset/BBBC048/bbbc048_inference.py b/diabetic_retinopathy/my_conf/dataset/BBBC048/bbbc048_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..502b4e3398627114cff7a979e77aad44259a0779 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/BBBC048/bbbc048_inference.py @@ -0,0 +1,7 @@ +from dataclasses import replace + +from GaussianProxy.conf.dataset.BBBC048.bbbc048_inference import dataset + +dataset = replace( + dataset, path="/projects/static2dynamic/datasets/Jurkat/brightfield_reprocessed_full_circle_augmented" +) diff --git a/diabetic_retinopathy/my_conf/dataset/ChromaLive6h/ChromaLive6h_3ch_png_hard_aug.yaml b/diabetic_retinopathy/my_conf/dataset/ChromaLive6h/ChromaLive6h_3ch_png_hard_aug.yaml new file mode 100644 index 0000000000000000000000000000000000000000..426907c0883d4aac51c298f00f2e3f77fdda05e7 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/ChromaLive6h/ChromaLive6h_3ch_png_hard_aug.yaml @@ -0,0 +1,16 @@ +name: chromaLive6h_3ch_png_patches_380px_hard_aug +path: /projects/static2dynamic/datasets/20231017ChromaLive_6hr_4ch/MIP_normalized/paired_dataset/patches_hard_augmented +data_shape: [ 3, 128, 128 ] +transforms: + _target_: torchvision.transforms.transforms.Compose + transforms: + - _target_: torchvision.transforms.transforms.Resize + size: 128 + - _target_: torchvision.transforms.ConvertImageDtype # this also scales to [0; 1] + dtype: ${torch_dtype:float32} # passed dtype must be accessible as a "torch" attribute + - _target_: torchvision.transforms.Normalize + mean: [ 0.5, 0.5, 0.5 ] # move to [-1:1] + std: [ 0.5, 0.5, 0.5 ] +expected_initial_data_range: [ 0, 255 ] +expected_dtype: torch.uint8 +selected_dists: diff --git a/diabetic_retinopathy/my_conf/dataset/ChromaLive6h/ChromaLive6h_4ch_tif.yaml b/diabetic_retinopathy/my_conf/dataset/ChromaLive6h/ChromaLive6h_4ch_tif.yaml new file mode 100644 index 0000000000000000000000000000000000000000..694a2ba580d61c98606c8a5e60213ede4d0b5b5a --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/ChromaLive6h/ChromaLive6h_4ch_tif.yaml @@ -0,0 +1,19 @@ +name: chromaLive6h_4ch_tif_patches_380px +path: /projects/static2dynamic/datasets/20231017ChromaLive_6hr_4ch/MIP_normalized/paired_dataset/patches +data_shape: [ 4, 128, 128 ] +transforms: + _target_: torchvision.transforms.transforms.Compose + transforms: + - _target_: torchvision.transforms.transforms.Resize + size: 128 + - _target_: torchvision.transforms.ConvertImageDtype # this also scales to [0; 1] + dtype: ${torch_dtype:float32} # passed dtype must be accessible as a "torch" attribute + - _target_: torchvision.transforms.Normalize + mean: [ 0.5, 0.5, 0.5, 0.5 ] # move to [-1:1] + std: [ 0.5, 0.5, 0.5, 0.5 ] + - _target_: torchvision.transforms.RandomHorizontalFlip + - _target_: torchvision.transforms.RandomVerticalFlip + - _target_: GaussianProxy.utils.data.RandomRotationSquareSymmetry +expected_initial_data_range: [ 0, 65536 ] +expected_dtype: torch.uint16 +selected_dists: [ 'time_1', 'time_3', 'time_5', 'time_7', 'time_9', 'time_11', 'time_13' ] diff --git a/diabetic_retinopathy/my_conf/dataset/ChromaLive6h/chromalive6h_3ch_png_fully_ordered_inference.py b/diabetic_retinopathy/my_conf/dataset/ChromaLive6h/chromalive6h_3ch_png_fully_ordered_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..20fc6d08aedbed7a927b05d3f3a6ad46cf67b8d9 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/ChromaLive6h/chromalive6h_3ch_png_fully_ordered_inference.py @@ -0,0 +1,4 @@ +from GaussianProxy.conf.dataset.ChromaLive6h.chromalive6h_3ch_png_fully_ordered_inference import dataset + +dataset.path = "/projects/static2dynamic/datasets/20231017ChromaLive_6hr_4ch/MIP_normalized/paired_dataset/patches" +dataset.path_to_single_parquet = "/projects/static2dynamic/datasets/20231017ChromaLive_6hr_4ch/MIP_normalized/paired_dataset/chromaLive6h_3ch_png_patches_380px__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet" diff --git a/diabetic_retinopathy/my_conf/dataset/ChromaLive6h/chromalive6h_3ch_png_hard_aug_inference.py b/diabetic_retinopathy/my_conf/dataset/ChromaLive6h/chromalive6h_3ch_png_hard_aug_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..02246ed5f528d5b04a2267c44ce65997de4c3596 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/ChromaLive6h/chromalive6h_3ch_png_hard_aug_inference.py @@ -0,0 +1,6 @@ +from GaussianProxy.conf.dataset.ChromaLive6h.chromalive6h_3ch_png_inference import dataset + +dataset.name = "chromaLive6h_3ch_png_patches_380px_hard_aug" +dataset.path = ( + "/projects/static2dynamic/datasets/20231017ChromaLive_6hr_4ch/MIP_normalized/paired_dataset/patches_hard_augmented" +) diff --git a/diabetic_retinopathy/my_conf/dataset/ChromaLive6h/chromalive6h_3ch_png_inference.py b/diabetic_retinopathy/my_conf/dataset/ChromaLive6h/chromalive6h_3ch_png_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..e7a99754fdf6a320867784d7f225c4580d8d9bf1 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/ChromaLive6h/chromalive6h_3ch_png_inference.py @@ -0,0 +1,3 @@ +from GaussianProxy.conf.dataset.ChromaLive6h.chromalive6h_3ch_png_inference import dataset + +dataset.path = "/projects/static2dynamic/datasets/20231017ChromaLive_6hr_4ch/MIP_normalized/paired_dataset/patches" diff --git a/diabetic_retinopathy/my_conf/dataset/ChromaLiveTL24h/ChromaLiveTL24h.yaml b/diabetic_retinopathy/my_conf/dataset/ChromaLiveTL24h/ChromaLiveTL24h.yaml new file mode 100644 index 0000000000000000000000000000000000000000..491c42c2bc5ecc036ec55de7ede90b8c1ed88a8b --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/ChromaLiveTL24h/ChromaLiveTL24h.yaml @@ -0,0 +1,19 @@ +name: chromalive_tl_24h_380px +path: /projects/static2dynamic/datasets/20230920ChromaLiveTL_24hr4ch/ch_4_3_1___norm_whole_ds_per_channel_per_zslice_0_99perc___patches_380 +data_shape: [3, 256, 256] +transforms: + _target_: torchvision.transforms.transforms.Compose + transforms: + - _target_: torchvision.transforms.transforms.Resize + size: 256 + - _target_: torchvision.transforms.ConvertImageDtype # this also scales to [0; 1] + dtype: ${torch_dtype:float32} # passed dtype must be accessible as a "torch" attribute + - _target_: torchvision.transforms.Normalize + mean: [0.5, 0.5, 0.5] # move to [-1:1] + std: [0.5, 0.5, 0.5] + - _target_: torchvision.transforms.RandomHorizontalFlip + - _target_: torchvision.transforms.RandomVerticalFlip + - _target_: GaussianProxy.utils.data.RandomRotationSquareSymmetry +expected_initial_data_range: [0, 255] +expected_dtype: torch.uint8 +selected_dists: ['time_1', 'time_7', 'time_13', 'time_19', 'time_25', 'time_31', 'time_37', 'time_43', 'time_49', 'time_55', 'time_61', 'time_67', 'time_73', 'time_79', 'time_85', 'time_91', 'time_97', 'time_103', 'time_109', 'time_115', 'time_121', 'time_127', 'time_133', 'time_139', 'time_145'] diff --git a/diabetic_retinopathy/my_conf/dataset/DeepCycle/deepcycle_brightfield_to_3D_inference.py b/diabetic_retinopathy/my_conf/dataset/DeepCycle/deepcycle_brightfield_to_3D_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..5d5c7af253559ce6fbec7561ff59e4a9f9c7e4e6 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/DeepCycle/deepcycle_brightfield_to_3D_inference.py @@ -0,0 +1,3 @@ +from GaussianProxy.conf.dataset.DeepCycle.deepcycle_brightfield_to_3D_inference import dataset + +dataset.path = "/projects/imagesets2/DeepCycle/cells/128x128" diff --git a/diabetic_retinopathy/my_conf/dataset/DeepCycle/deepcycle_hoechst_brightfield_to_3D_inference.py b/diabetic_retinopathy/my_conf/dataset/DeepCycle/deepcycle_hoechst_brightfield_to_3D_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..4ffcf9696a44cd5652089f937d88e2b630002f32 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/DeepCycle/deepcycle_hoechst_brightfield_to_3D_inference.py @@ -0,0 +1,3 @@ +from GaussianProxy.conf.dataset.DeepCycle.deepcycle_hoechst_brightfield_to_3D_inference import dataset + +dataset.path = "/projects/imagesets2/DeepCycle/cells/128x128" diff --git a/diabetic_retinopathy/my_conf/dataset/DeepCycle/deepcycle_inference.py b/diabetic_retinopathy/my_conf/dataset/DeepCycle/deepcycle_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..f4f7cd69d76b72676b9513a5e44dc91ccf130028 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/DeepCycle/deepcycle_inference.py @@ -0,0 +1,3 @@ +from GaussianProxy.conf.dataset.DeepCycle.deepcycle_inference import dataset + +dataset.path = "/projects/imagesets2/DeepCycle/cells/128x128" diff --git a/diabetic_retinopathy/my_conf/dataset/DeepCycle/deepcycle_markers_inference.py b/diabetic_retinopathy/my_conf/dataset/DeepCycle/deepcycle_markers_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..129730fd4014e545f15100c50b4fd60481782e17 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/DeepCycle/deepcycle_markers_inference.py @@ -0,0 +1,3 @@ +from GaussianProxy.conf.dataset.DeepCycle.deepcycle_markers_inference import dataset + +dataset.path = "/projects/imagesets2/DeepCycle/cells/128x128" diff --git a/diabetic_retinopathy/my_conf/dataset/Jurkat/Jurkat.yaml b/diabetic_retinopathy/my_conf/dataset/Jurkat/Jurkat.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6dae2eb460d55c87abf178bad5c7a2f4d43587cb --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/Jurkat/Jurkat.yaml @@ -0,0 +1,16 @@ +name: Jurkat +path: /projects/static2dynamic/datasets/Jurkat/rgb_images_all_cell_cycles +data_shape: [3, 66, 66] +transforms: + _target_: torchvision.transforms.transforms.Compose + transforms: + - _target_: torchvision.transforms.ConvertImageDtype # this also scales to [0; 1] + dtype: ${torch_dtype:float32} # passed dtype must be accessible as a "torch" attribute + - _target_: torchvision.transforms.Normalize + mean: [0.5, 0.5, 0.5] + std: [0.5, 0.5, 0.5] + - _target_: torchvision.transforms.RandomHorizontalFlip + - _target_: torchvision.transforms.RandomVerticalFlip + - _target_: GaussianProxy.utils.data.RandomRotationSquareSymmetry +expected_initial_data_range: [0, 255] +expected_dtype: torch.uint8 diff --git a/diabetic_retinopathy/my_conf/dataset/Jurkat/Jurkat_brightfield_fully_ordered.yaml b/diabetic_retinopathy/my_conf/dataset/Jurkat/Jurkat_brightfield_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7c4133274ac9c90bb7ec8fde4fe2736a3724fa30 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/Jurkat/Jurkat_brightfield_fully_ordered.yaml @@ -0,0 +1,23 @@ +name: Jurkat_brightfield_fully_ordered + +path: /projects/static2dynamic/datasets/Jurkat/brightfield_reprocessed +path_to_single_parquet: /projects/static2dynamic/datasets/Jurkat/Jurkat_brightfield__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet + +data_shape: [ 1, 66, 66 ] + +transforms: + _target_: torchvision.transforms.transforms.Compose + transforms: + - _target_: torchvision.transforms.ConvertImageDtype # this also scales to [0; 1] + dtype: ${torch_dtype:float32} # passed dtype must be accessible as a "torch" attribute + - _target_: torchvision.transforms.Normalize + mean: [ 0.5 ] + std: [ 0.5 ] + - _target_: torchvision.transforms.RandomHorizontalFlip + - _target_: torchvision.transforms.RandomVerticalFlip + - _target_: GaussianProxy.utils.data.RandomRotationSquareSymmetry + +expected_initial_data_range: [ 0, 255 ] +expected_dtype: torch.uint8 + +fully_ordered: true diff --git a/diabetic_retinopathy/my_conf/dataset/Jurkat/Jurkat_brightfield_fully_ordered_inference.py b/diabetic_retinopathy/my_conf/dataset/Jurkat/Jurkat_brightfield_fully_ordered_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..b847a2ea0da14b9271d0561105275ead359de4c7 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/Jurkat/Jurkat_brightfield_fully_ordered_inference.py @@ -0,0 +1,4 @@ +from GaussianProxy.conf.dataset.Jurkat.Jurkat_brightfield_fully_ordered_inference import dataset + +dataset.path = "/projects/static2dynamic/datasets/Jurkat/brightfield_reprocessed" +dataset.path_to_single_parquet = "/projects/static2dynamic/datasets/Jurkat/Jurkat_brightfield__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet" diff --git a/diabetic_retinopathy/my_conf/dataset/Jurkat/Jurkat_brightfield_inference.py b/diabetic_retinopathy/my_conf/dataset/Jurkat/Jurkat_brightfield_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..9d9cf49c06507bbebc2f57319f952ce9d5a3073b --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/Jurkat/Jurkat_brightfield_inference.py @@ -0,0 +1,3 @@ +from GaussianProxy.conf.dataset.Jurkat.Jurkat_brightfield_inference import dataset + +dataset.path = "/projects/static2dynamic/datasets/Jurkat/brightfield_reprocessed" diff --git a/diabetic_retinopathy/my_conf/dataset/Jurkat/Jurkat_fully_ordered.yaml b/diabetic_retinopathy/my_conf/dataset/Jurkat/Jurkat_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..24e6e21de17a84ad77fba0ddd54fa0f770ea3cdf --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/Jurkat/Jurkat_fully_ordered.yaml @@ -0,0 +1,18 @@ +name: Jurkat_fully_ordered_dinov2_regs_giant_ds_preproc +path: /projects/static2dynamic/datasets/Jurkat/rgb_images_all_cell_cycles +path_to_single_parquet: /projects/static2dynamic/datasets/Jurkat/Jurkat__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet +data_shape: [ 3, 66, 66 ] +transforms: + _target_: torchvision.transforms.transforms.Compose + transforms: + - _target_: torchvision.transforms.ConvertImageDtype # this also scales to [0; 1] + dtype: ${torch_dtype:float32} # passed dtype must be accessible as a "torch" attribute + - _target_: torchvision.transforms.Normalize + mean: [ 0.5, 0.5, 0.5 ] + std: [ 0.5, 0.5, 0.5 ] + - _target_: torchvision.transforms.RandomHorizontalFlip + - _target_: torchvision.transforms.RandomVerticalFlip + - _target_: GaussianProxy.utils.data.RandomRotationSquareSymmetry +expected_initial_data_range: [ 0, 255 ] +expected_dtype: torch.uint8 +fully_ordered: true diff --git a/diabetic_retinopathy/my_conf/dataset/Jurkat/Jurkat_inference.py b/diabetic_retinopathy/my_conf/dataset/Jurkat/Jurkat_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..8f9c110d8ff54daa5c3671481b9580b407d01724 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/Jurkat/Jurkat_inference.py @@ -0,0 +1,8 @@ +from dataclasses import replace + +from GaussianProxy.conf.dataset.Jurkat.Jurkat_inference import dataset + +dataset = replace( + dataset, + path="/projects/static2dynamic/datasets/Jurkat/rgb_images_all_cell_cycles", +) diff --git a/diabetic_retinopathy/my_conf/dataset/Jurkat/Jurkat_inference_hard_aug.py b/diabetic_retinopathy/my_conf/dataset/Jurkat/Jurkat_inference_hard_aug.py new file mode 100644 index 0000000000000000000000000000000000000000..cc826ec44e040ea3bdf9931f7434e47f5345cb9c --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/Jurkat/Jurkat_inference_hard_aug.py @@ -0,0 +1,8 @@ +from dataclasses import replace + +from GaussianProxy.conf.dataset.Jurkat.Jurkat_inference import dataset + +dataset = replace( + dataset, + path="/projects/static2dynamic/datasets/Jurkat/rgb_images_all_cell_cycles_hard_augmented", +) diff --git a/diabetic_retinopathy/my_conf/dataset/NASH_fibrosis/NASH_fibrosis.yaml b/diabetic_retinopathy/my_conf/dataset/NASH_fibrosis/NASH_fibrosis.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a53dc5ec231d267cb6fcdc50c7166e5a792c0d32 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/NASH_fibrosis/NASH_fibrosis.yaml @@ -0,0 +1,24 @@ +name: NASH_fibrosis +path: /projects/static2dynamic/datasets/NASH/prepared_data/fibrosis +data_shape: [ 3, 128, 128 ] +transforms: + _target_: torchvision.transforms.transforms.Compose + transforms: + # Convert to float32 (and normalize to [0, 1]) before resizing + - _target_: torchvision.transforms.ConvertImageDtype + dtype: ${torch_dtype:float32} + # Random crop from 299x299 to 192x192, then resize to 128x128 + - _target_: torchvision.transforms.RandomCrop + size: 192 + - _target_: torchvision.transforms.Resize + size: 128 + # Normalize to [-1, 1] + - _target_: torchvision.transforms.Normalize + mean: [ 0.5, 0.5, 0.5 ] + std: [ 0.5, 0.5, 0.5 ] + # Random 8x square augmentations + - _target_: torchvision.transforms.RandomHorizontalFlip + - _target_: torchvision.transforms.RandomVerticalFlip + - _target_: GaussianProxy.utils.data.RandomRotationSquareSymmetry +selected_dists: +expected_initial_data_range: [ 0, 255 ] diff --git a/diabetic_retinopathy/my_conf/dataset/NASH_fibrosis/NASH_fibrosis_fully_ordered_inference.py b/diabetic_retinopathy/my_conf/dataset/NASH_fibrosis/NASH_fibrosis_fully_ordered_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..58a1b0331176b90a44a2209db56dba19005ef998 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/NASH_fibrosis/NASH_fibrosis_fully_ordered_inference.py @@ -0,0 +1,4 @@ +from GaussianProxy.conf.dataset.NASH_fibrosis.NASH_fibrosis_fully_ordered_inference import dataset + +dataset.path = "/projects/static2dynamic/datasets/NASH/prepared_data/fibrosis" +dataset.path_to_single_parquet = "/projects/static2dynamic/datasets/NASH/prepared_data/NASH_fibrosis__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet" diff --git a/diabetic_retinopathy/my_conf/dataset/NASH_fibrosis/NASH_fibrosis_inference.py b/diabetic_retinopathy/my_conf/dataset/NASH_fibrosis/NASH_fibrosis_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..c9e9e16f31c3c75bb780bc4832868bd0c6cebcce --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/NASH_fibrosis/NASH_fibrosis_inference.py @@ -0,0 +1,3 @@ +from GaussianProxy.conf.dataset.NASH_fibrosis.NASH_fibrosis_inference import dataset + +dataset.path = "/projects/static2dynamic/datasets/NASH/prepared_data/fibrosis" diff --git a/diabetic_retinopathy/my_conf/dataset/NASH_steatosis/NASH_steatosis_fully_ordered.yaml b/diabetic_retinopathy/my_conf/dataset/NASH_steatosis/NASH_steatosis_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2ee2b473282b4c7882ddced978e0b4165481f237 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/NASH_steatosis/NASH_steatosis_fully_ordered.yaml @@ -0,0 +1,26 @@ +name: NASH_steatosis_fully_ordered_dinov2_regs_giant_ds_preproc +path: /projects/static2dynamic/datasets/NASH/prepared_data/steatosis +path_to_single_parquet: /projects/static2dynamic/datasets/NASH/prepared_data/NASH_steatosis__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet +data_shape: [ 3, 128, 128 ] +transforms: + _target_: torchvision.transforms.transforms.Compose + transforms: + # Convert to float32 (and normalize to [0, 1]) before resizing + - _target_: torchvision.transforms.ConvertImageDtype + dtype: ${torch_dtype:float32} + # Random crop from 299x299 to 192x192, then resize to 128x128 + - _target_: torchvision.transforms.RandomCrop + size: 192 + - _target_: torchvision.transforms.Resize + size: 128 + # Normalize to [-1, 1] + - _target_: torchvision.transforms.Normalize + mean: [ 0.5, 0.5, 0.5 ] + std: [ 0.5, 0.5, 0.5 ] + # Random 8x square augmentations + - _target_: torchvision.transforms.RandomHorizontalFlip + - _target_: torchvision.transforms.RandomVerticalFlip + - _target_: GaussianProxy.utils.data.RandomRotationSquareSymmetry +selected_dists: +expected_initial_data_range: [ 0, 255 ] +fully_ordered: true diff --git a/diabetic_retinopathy/my_conf/dataset/NASH_steatosis/NASH_steatosis_fully_ordered_inference.py b/diabetic_retinopathy/my_conf/dataset/NASH_steatosis/NASH_steatosis_fully_ordered_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..d9918cc6e00541668f1d52847f662fad05fcf329 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/NASH_steatosis/NASH_steatosis_fully_ordered_inference.py @@ -0,0 +1,4 @@ +from GaussianProxy.conf.dataset.NASH_steatosis.NASH_steatosis_fully_ordered_inference import dataset + +dataset.path = "/projects/static2dynamic/datasets/NASH/prepared_data/steatosis" +dataset.path_to_single_parquet = "/projects/static2dynamic/datasets/NASH/prepared_data/NASH_steatosis__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet" diff --git a/diabetic_retinopathy/my_conf/dataset/NASH_steatosis/NASH_steatosis_inference.py b/diabetic_retinopathy/my_conf/dataset/NASH_steatosis/NASH_steatosis_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..6e1d91853a23054a41429f141a048594f0446074 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/NASH_steatosis/NASH_steatosis_inference.py @@ -0,0 +1,3 @@ +from GaussianProxy.conf.dataset.NASH_steatosis.NASH_steatosis_inference import dataset + +dataset.path = "/projects/static2dynamic/datasets/NASH/prepared_data/steatosis" diff --git a/diabetic_retinopathy/my_conf/dataset/biotine/biotine_png_128.yaml b/diabetic_retinopathy/my_conf/dataset/biotine/biotine_png_128.yaml new file mode 100644 index 0000000000000000000000000000000000000000..49ffb167b04d435655c47b359aa8df480319f587 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/biotine/biotine_png_128.yaml @@ -0,0 +1,19 @@ +name: biotine_png +path: /projects/static2dynamic/datasets/biotine/3_channels_min_99_perc_normalized_rgb_stacks_png/patches_255 +data_shape: [ 3, 128, 128 ] +transforms: + _target_: torchvision.transforms.transforms.Compose + transforms: + - _target_: torchvision.transforms.transforms.Resize + size: 128 + # ConvertImageDtype also scales to [0; 1] (from the *implicit* expected range that depends on the incoming dtype...) + - _target_: torchvision.transforms.ConvertImageDtype + dtype: ${torch_dtype:float32} + - _target_: torchvision.transforms.Normalize + mean: [ 0.5, 0.5, 0.5 ] + std: [ 0.5, 0.5, 0.5 ] + - _target_: torchvision.transforms.RandomHorizontalFlip + - _target_: torchvision.transforms.RandomVerticalFlip + - _target_: GaussianProxy.utils.data.RandomRotationSquareSymmetry +selected_dists: +expected_initial_data_range: [ 0, 255 ] diff --git a/diabetic_retinopathy/my_conf/dataset/biotine/biotine_png_128_fully_ordered.yaml b/diabetic_retinopathy/my_conf/dataset/biotine/biotine_png_128_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3cceb83582d9dff9cd838ae1c5f4ac34f99b2af2 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/biotine/biotine_png_128_fully_ordered.yaml @@ -0,0 +1,21 @@ +name: biotine_png_fully_ordered +path: /projects/static2dynamic/datasets/biotine/3_channels_min_99_perc_normalized_rgb_stacks_png/patches_255 +path_to_single_parquet: /projects/static2dynamic/datasets/biotine/3_channels_min_99_perc_normalized_rgb_stacks_png/biotine_png__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet +data_shape: [ 3, 128, 128 ] +transforms: + _target_: torchvision.transforms.transforms.Compose + transforms: + - _target_: torchvision.transforms.transforms.Resize + size: 128 + # ConvertImageDtype also scales to [0; 1] (from the *implicit* expected range that depends on the incoming dtype...) + - _target_: torchvision.transforms.ConvertImageDtype + dtype: ${torch_dtype:float32} + - _target_: torchvision.transforms.Normalize + mean: [ 0.5, 0.5, 0.5 ] + std: [ 0.5, 0.5, 0.5 ] + - _target_: torchvision.transforms.RandomHorizontalFlip + - _target_: torchvision.transforms.RandomVerticalFlip + - _target_: GaussianProxy.utils.data.RandomRotationSquareSymmetry +selected_dists: +expected_initial_data_range: [ 0, 255 ] +fully_ordered: true diff --git a/diabetic_retinopathy/my_conf/dataset/biotine/biotine_png_128_fully_ordered_inference.py b/diabetic_retinopathy/my_conf/dataset/biotine/biotine_png_128_fully_ordered_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..c0ba77af280d7f14f8cf140a19b146664524c38b --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/biotine/biotine_png_128_fully_ordered_inference.py @@ -0,0 +1,18 @@ +from dataclasses import replace + +from GaussianProxy.conf.dataset.biotine.biotine_png_128_inference import dataset +from GaussianProxy.utils.data import ContinuousTimeImageDataset + +assert dataset.dataset_params is not None +updated_ds_params = replace( + dataset.dataset_params, + dataset_class=ContinuousTimeImageDataset, +) + +dataset = replace( + dataset, + fully_ordered=True, + path="/projects/static2dynamic/datasets/biotine/3_channels_min_99_perc_normalized_rgb_stacks_png/patches_255", + path_to_single_parquet="/projects/static2dynamic/datasets/biotine/3_channels_min_99_perc_normalized_rgb_stacks_png/biotine_png__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet", + dataset_params=updated_ds_params, +) diff --git a/diabetic_retinopathy/my_conf/dataset/biotine/biotine_png_128_hard_aug.yaml b/diabetic_retinopathy/my_conf/dataset/biotine/biotine_png_128_hard_aug.yaml new file mode 100644 index 0000000000000000000000000000000000000000..07044d90813fe3acadb1a0d996adc1277f60ccbe --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/biotine/biotine_png_128_hard_aug.yaml @@ -0,0 +1,16 @@ +name: biotine_png_hard_aug +path: /projects/static2dynamic/datasets/biotine/3_channels_min_99_perc_normalized_rgb_stacks_png/patches_255_hard_augmented +data_shape: [ 3, 128, 128 ] +transforms: + _target_: torchvision.transforms.transforms.Compose + transforms: + - _target_: torchvision.transforms.transforms.Resize + size: 128 + # ConvertImageDtype also scales to [0; 1] (from the *implicit* expected range that depends on the incoming dtype...) + - _target_: torchvision.transforms.ConvertImageDtype + dtype: ${torch_dtype:float32} + - _target_: torchvision.transforms.Normalize + mean: [ 0.5, 0.5, 0.5 ] + std: [ 0.5, 0.5, 0.5 ] +selected_dists: +expected_initial_data_range: [ 0, 255 ] diff --git a/diabetic_retinopathy/my_conf/dataset/biotine/biotine_png_128_hard_aug_inference.py b/diabetic_retinopathy/my_conf/dataset/biotine/biotine_png_128_hard_aug_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..5fda38ec48345e97464fead2ea49563c1c484cc9 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/biotine/biotine_png_128_hard_aug_inference.py @@ -0,0 +1,8 @@ +from dataclasses import replace + +from GaussianProxy.conf.dataset.biotine.biotine_png_128_hard_aug_inference import dataset + +dataset = replace( + dataset, + path="/projects/static2dynamic/datasets/biotine/3_channels_min_99_perc_normalized_rgb_stacks_png/patches_255_hard_augmented", +) diff --git a/diabetic_retinopathy/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy.yaml b/diabetic_retinopathy/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b458e5fc57edb75c902a3ddb5519f9064950f555 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy.yaml @@ -0,0 +1,18 @@ +name: diabetic_retinopathy +path: /projects/static2dynamic/datasets/DiabeticRetinopathy/prepared_dataset/train +data_shape: [3, 256, 256] +transforms: + _target_: torchvision.transforms.transforms.Compose + transforms: + - _target_: torchvision.transforms.transforms.Resize + size: 256 # single int => image resized to (size * aspect_ratio, size) or (size, size * aspect_ratio) with aspect_ratio >= 1 preserved + - _target_: torchvision.transforms.v2.CenterCrop + size: 256 # square centered crop + - _target_: torchvision.transforms.RandomHorizontalFlip + - _target_: torchvision.transforms.ConvertImageDtype # this also scales to [0; 1] + dtype: ${torch_dtype:float32} # passed dtype must be accessible as a "torch" attribute + - _target_: torchvision.transforms.Normalize + mean: [0.5, 0.5, 0.5] + std: [0.5, 0.5, 0.5] +expected_initial_data_range: [0, 255] +expected_dtype: torch.uint8 diff --git a/diabetic_retinopathy/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2048_crop_fully_ordered.yaml b/diabetic_retinopathy/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2048_crop_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a485ac70368ed67577f3e43766139422a2315b58 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2048_crop_fully_ordered.yaml @@ -0,0 +1,25 @@ +name: diabetic_retinopathy_2048_crop_fully_ordered + +path: /projects/static2dynamic/datasets/DiabeticRetinopathy/prepared_dataset_full_circle_augmented +path_to_single_parquet: /projects/static2dynamic/Thomas/ordering_datasets/facebook_dinov2-with-registers-giant_dataset_preproc/balanced_classes__diabetic_retinopathy_2048_crop/balanced_classes__diabetic_retinopathy_2048_crop__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet + +data_shape: [3, 256, 256] + +transforms: + _target_: torchvision.transforms.v2.Compose + transforms: + - _target_: torchvision.transforms.v2.CenterCrop + size: 2048 + - _target_: torchvision.transforms.v2.Resize + size: 256 + - _target_: torchvision.transforms.v2.ToDtype # this also scales to [0; 1] + dtype: ${torch_dtype:float32} + scale: true + - _target_: torchvision.transforms.v2.Normalize + mean: [0.5, 0.5, 0.5] + std: [0.5, 0.5, 0.5] + +expected_initial_data_range: [0, 255] +expected_dtype: torch.uint8 + +fully_ordered: true diff --git a/diabetic_retinopathy/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2048_precrop_fully_ordered.yaml b/diabetic_retinopathy/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2048_precrop_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f4ecf72521e33c733056c5d0927ed58711dad04b --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2048_precrop_fully_ordered.yaml @@ -0,0 +1,21 @@ +name: diabetic_retinopathy_2048_precrop_fully_ordered + +path: /projects/static2dynamic/datasets/DiabeticRetinopathy/prepared_dataset_full_circle_augmented_2048_crop +path_to_single_parquet: /projects/static2dynamic/Thomas/ordering_datasets/facebook_dinov2-with-registers-giant_dataset_preproc/diabetic_retinopathy_full_circle_augs_2048_precrop/diabetic_retinopathy_full_circle_augs_2048_precrop__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet + +data_shape: [ 3, 256, 256 ] + +transforms: + _target_: torchvision.transforms.v2.Compose + transforms: + - _target_: torchvision.transforms.v2.ToDtype + dtype: ${torch_dtype:float32} + scale: true + - _target_: torchvision.transforms.v2.Normalize + mean: [ 0.5, 0.5, 0.5 ] + std: [ 0.5, 0.5, 0.5 ] + +expected_initial_data_range: [ 0, 255 ] +expected_dtype: torch.uint8 + +fully_ordered: true diff --git a/diabetic_retinopathy/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2048_precrop_inference.py b/diabetic_retinopathy/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2048_precrop_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..56a796fecda6f42247e83ee7b505cf738c625423 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2048_precrop_inference.py @@ -0,0 +1,10 @@ +from dataclasses import replace + +from GaussianProxy.conf.dataset.diabetic_retinopathy.diabetic_retinopathy_full_circle_augs_2048_precrop_inference import ( + dataset, +) + +dataset = replace( + dataset, + path="/projects/static2dynamic/datasets/DiabeticRetinopathy/prepared_dataset_full_circle_augmented_2048_crop", +) diff --git a/diabetic_retinopathy/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_fully_ordered_inference.py b/diabetic_retinopathy/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_fully_ordered_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..c03ee29545d35168424e0d9541358fd77f66791f --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_fully_ordered_inference.py @@ -0,0 +1,15 @@ +from dataclasses import replace + +from GaussianProxy.conf.dataset.diabetic_retinopathy.diabetic_retinopathy_inference import dataset +from GaussianProxy.utils.data import ContinuousTimeImageDataset + +assert dataset.dataset_params is not None +updated_ds_params = replace(dataset.dataset_params, dataset_class=ContinuousTimeImageDataset) + +dataset = replace( + dataset, + fully_ordered=True, + path="/projects/static2dynamic/datasets/DiabeticRetinopathy/prepared_dataset/train", + path_to_single_parquet="/projects/static2dynamic/datasets/DiabeticRetinopathy/prepared_dataset/diabetic_retinopathy__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet", + dataset_params=updated_ds_params, +) diff --git a/diabetic_retinopathy/my_conf/dataset/ependymal_context/ependymal_context_inference.py b/diabetic_retinopathy/my_conf/dataset/ependymal_context/ependymal_context_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..f9514fb17a5910cb32bfd7692534a4fefe2ee78d --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/ependymal_context/ependymal_context_inference.py @@ -0,0 +1,32 @@ +from torch import float32 +from torchvision.transforms import Compose, ConvertImageDtype, Normalize + +from GaussianProxy.conf.training_conf import DataSet, DatasetParams +from GaussianProxy.utils.data import ImageDataset + +DEFINITION = 256 +NUMBER_OF_CHANNELS = 3 + +transforms = Compose( + transforms=[ + ConvertImageDtype(float32), + Normalize(mean=[0.5] * NUMBER_OF_CHANNELS, std=[0.5] * NUMBER_OF_CHANNELS), + ] +) + +ds_params = DatasetParams( + file_extension="png", + key_transform=str, + sorting_func=lambda subdir: int(subdir.name), + dataset_class=ImageDataset, +) + +dataset = DataSet( + name="ependymal_context", + data_shape=(NUMBER_OF_CHANNELS, DEFINITION, DEFINITION), + transforms=transforms, + expected_initial_data_range=(0, 255), + dataset_params=ds_params, + path="/projects/static2dynamic/datasets/ependymal/prepared_dataset_context", + selected_dists=["0", "3", "5", "7", "9", "16", "30"], # ignore .REMOVED_IMAGES/16 (imaging artifacts) +) diff --git a/diabetic_retinopathy/my_conf/dataset/ependymal_cutout/ependymal_cutout.yaml b/diabetic_retinopathy/my_conf/dataset/ependymal_cutout/ependymal_cutout.yaml new file mode 100644 index 0000000000000000000000000000000000000000..67fc08a415914501a2d04527a3555ddc498f32f4 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/ependymal_cutout/ependymal_cutout.yaml @@ -0,0 +1,17 @@ +name: ependymal_cutout +path: /projects/static2dynamic/datasets/ependymal/prepared_dataset_crop +data_shape: [ 3, 256, 256 ] +transforms: + _target_: torchvision.transforms.transforms.Compose + transforms: + - _target_: torchvision.transforms.ConvertImageDtype # this also scales to [0; 1] + dtype: ${torch_dtype:float32} # passed dtype must be accessible as a "torch" attribute + - _target_: torchvision.transforms.Normalize + mean: [ 0.5, 0.5, 0.5 ] + std: [ 0.5, 0.5, 0.5 ] + - _target_: torchvision.transforms.RandomHorizontalFlip + - _target_: torchvision.transforms.RandomVerticalFlip + - _target_: GaussianProxy.utils.data.RandomRotationSquareSymmetry +expected_initial_data_range: [ 0, 255 ] +expected_dtype: torch.uint8 +selected_dists: [ 1, 2, 3, 4, 5, 6 ] # 0 is the trash class! diff --git a/diabetic_retinopathy/my_conf/dataset/ependymal_cutout/ependymal_cutout_inference.py b/diabetic_retinopathy/my_conf/dataset/ependymal_cutout/ependymal_cutout_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..3458d8b0f72c8fc1042d2fcc4feb2b64bb96ece2 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/ependymal_cutout/ependymal_cutout_inference.py @@ -0,0 +1,8 @@ +from dataclasses import replace + +from GaussianProxy.conf.dataset.ependymal_cutout.ependymal_cutout_inference import dataset + +dataset = replace( + dataset, + path="/projects/static2dynamic/datasets/ependymal/prepared_dataset_crop", +) diff --git a/diabetic_retinopathy/my_conf/dataset/imagenet_n01917289_hard_aug_inference.py b/diabetic_retinopathy/my_conf/dataset/imagenet_n01917289_hard_aug_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..5092fe7e19d910949c4816bd99d0a8b5a9531d81 --- /dev/null +++ b/diabetic_retinopathy/my_conf/dataset/imagenet_n01917289_hard_aug_inference.py @@ -0,0 +1,36 @@ +from torch import float32 +from torchvision.transforms import Compose, ConvertImageDtype, Normalize, Resize +from torchvision.transforms.v2 import CenterCrop + +from GaussianProxy.conf.training_conf import DataSet, DatasetParams +from GaussianProxy.utils.data import ImageDataset + +DEFINITION = 128 +NUMBER_OF_CHANNELS = 3 + +transforms = Compose( + transforms=[ + # single int => image resized to (size * aspect_ratio, size) or (size, size * aspect_ratio) with aspect_ratio >= 1 preserved + Resize(DEFINITION), + CenterCrop(DEFINITION), # pyright: ignore[reportAttributeAccessIssue] + ConvertImageDtype(float32), + Normalize(mean=[0.5] * NUMBER_OF_CHANNELS, std=[0.5] * NUMBER_OF_CHANNELS), + ] +) + +ds_params = DatasetParams( + file_extension="JPEG", + key_transform=int, + sorting_func=lambda subdir: int(subdir.name), + dataset_class=ImageDataset, +) + +dataset = DataSet( + path="/localtmp/tboyer/augmented_imagenet_n01917289", + name="imagenet_n01917289_hard_aug_inference", + data_shape=(NUMBER_OF_CHANNELS, DEFINITION, DEFINITION), + transforms=transforms, + selected_dists=None, # not used + expected_initial_data_range=(0, 255), + dataset_params=ds_params, +) diff --git a/diabetic_retinopathy/my_conf/hydra/job_logging/custom.yaml b/diabetic_retinopathy/my_conf/hydra/job_logging/custom.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a0351b01adac5db3c464d4990751266af706f6c6 --- /dev/null +++ b/diabetic_retinopathy/my_conf/hydra/job_logging/custom.yaml @@ -0,0 +1,35 @@ +version: 1 +formatters: + simple: + format: '[%(asctime)s][%(name)s][%(levelname)s] - %(message)s' + colorlog: + (): colorlog.ColoredFormatter + format: '[%(cyan)s%(asctime)s%(reset)s][%(blue)s%(name)s%(reset)s][%(log_color)s%(levelname)s%(reset)s] - %(message)s' + log_colors: + DEBUG: purple + INFO: green + WARNING: yellow + ERROR: red + CRITICAL: red +handlers: + console: + class: logging.StreamHandler + formatter: colorlog + stream: ext://sys.stdout + level: INFO + file: + class: logging.FileHandler + formatter: simple + filename: ${hydra:run.dir}/logs.log # unify logs from launcher and script + level: DEBUG +root: + level: DEBUG + handlers: + - console + - file +logger: + matplotlib: + level: INFO + PIL: + level: INFO +disable_existing_loggers: true diff --git a/diabetic_retinopathy/my_conf/net/net_128_3.py b/diabetic_retinopathy/my_conf/net/net_128_3.py new file mode 100644 index 0000000000000000000000000000000000000000..994280ed4d0a7e6e1410e51f2b058157fb17c962 --- /dev/null +++ b/diabetic_retinopathy/my_conf/net/net_128_3.py @@ -0,0 +1,22 @@ +from GaussianProxy.conf.training_conf import UNet2DConditionModelConfig, TimeEncoderConfig + +cross_attn_dim = 64 + +net = UNet2DConditionModelConfig( + sample_size=128, + in_channels=3, + out_channels=3, + down_block_types=("CrossAttnDownBlock2D", "CrossAttnDownBlock2D", "CrossAttnDownBlock2D"), + up_block_types=("CrossAttnUpBlock2D", "CrossAttnUpBlock2D", "CrossAttnUpBlock2D"), + block_out_channels=(64, 128, 256), + layers_per_block=2, + act_fn="silu", + cross_attention_dim=cross_attn_dim, +) + +time_encoder = TimeEncoderConfig( + encoding_dim=128, + time_embed_dim=cross_attn_dim, + flip_sin_to_cos=True, + downscale_freq_shift=1, +) diff --git a/diabetic_retinopathy/my_conf/net/net_128_3_big.py b/diabetic_retinopathy/my_conf/net/net_128_3_big.py new file mode 100644 index 0000000000000000000000000000000000000000..9a12e57ccfc47d7fd0a9ac9cf3647764361adac7 --- /dev/null +++ b/diabetic_retinopathy/my_conf/net/net_128_3_big.py @@ -0,0 +1,22 @@ +from GaussianProxy.conf.training_conf import UNet2DConditionModelConfig, TimeEncoderConfig + +cross_attn_dim = 64 + +net = UNet2DConditionModelConfig( + sample_size=128, + in_channels=3, + out_channels=3, + down_block_types=("DownBlock2D", "CrossAttnDownBlock2D", "CrossAttnDownBlock2D"), + up_block_types=("CrossAttnUpBlock2D", "CrossAttnUpBlock2D", "UpBlock2D"), + block_out_channels=(128, 256, 512), + layers_per_block=2, + act_fn="silu", + cross_attention_dim=cross_attn_dim, +) + +time_encoder = TimeEncoderConfig( + encoding_dim=128, + time_embed_dim=cross_attn_dim, + flip_sin_to_cos=True, + downscale_freq_shift=1, +) diff --git a/diabetic_retinopathy/my_conf/net/net_128_4.py b/diabetic_retinopathy/my_conf/net/net_128_4.py new file mode 100644 index 0000000000000000000000000000000000000000..0dd136ffaff1c94858ad50bb075d780b7a49bc86 --- /dev/null +++ b/diabetic_retinopathy/my_conf/net/net_128_4.py @@ -0,0 +1,22 @@ +from GaussianProxy.conf.training_conf import UNet2DConditionModelConfig, TimeEncoderConfig + +cross_attn_dim = 64 + +net = UNet2DConditionModelConfig( + sample_size=128, + in_channels=4, + out_channels=4, + down_block_types=("CrossAttnDownBlock2D", "CrossAttnDownBlock2D", "CrossAttnDownBlock2D"), + up_block_types=("CrossAttnUpBlock2D", "CrossAttnUpBlock2D", "CrossAttnUpBlock2D"), + block_out_channels=(64, 128, 256), + layers_per_block=2, + act_fn="silu", + cross_attention_dim=cross_attn_dim, +) + +time_encoder = TimeEncoderConfig( + encoding_dim=128, + time_embed_dim=cross_attn_dim, + flip_sin_to_cos=True, + downscale_freq_shift=1, +) diff --git a/diabetic_retinopathy/my_conf/net/net_196_3_12M.py b/diabetic_retinopathy/my_conf/net/net_196_3_12M.py new file mode 100644 index 0000000000000000000000000000000000000000..83fa0274707bdde54fd0e1141deec96f779b5393 --- /dev/null +++ b/diabetic_retinopathy/my_conf/net/net_196_3_12M.py @@ -0,0 +1,22 @@ +from GaussianProxy.conf.training_conf import UNet2DConditionModelConfig, TimeEncoderConfig + +cross_attn_dim = 64 + +net = UNet2DConditionModelConfig( + sample_size=196, + in_channels=3, + out_channels=3, + down_block_types=("CrossAttnDownBlock2D", "CrossAttnDownBlock2D", "CrossAttnDownBlock2D"), + up_block_types=("CrossAttnUpBlock2D", "CrossAttnUpBlock2D", "CrossAttnUpBlock2D"), + block_out_channels=(96, 128, 128), + layers_per_block=2, + act_fn="silu", + cross_attention_dim=cross_attn_dim, +) + +time_encoder = TimeEncoderConfig( + encoding_dim=128, + time_embed_dim=cross_attn_dim, + flip_sin_to_cos=True, + downscale_freq_shift=1, +) diff --git a/diabetic_retinopathy/my_conf/net/net_196_3_4M.py b/diabetic_retinopathy/my_conf/net/net_196_3_4M.py new file mode 100644 index 0000000000000000000000000000000000000000..1f099e27892046be5f1559b9e05032a8469d815d --- /dev/null +++ b/diabetic_retinopathy/my_conf/net/net_196_3_4M.py @@ -0,0 +1,22 @@ +from GaussianProxy.conf.training_conf import UNet2DConditionModelConfig, TimeEncoderConfig + +cross_attn_dim = 64 + +net = UNet2DConditionModelConfig( + sample_size=196, + in_channels=3, + out_channels=3, + down_block_types=("DownBlock2D", "CrossAttnDownBlock2D", "CrossAttnDownBlock2D"), + up_block_types=("CrossAttnUpBlock2D", "CrossAttnUpBlock2D", "UpBlock2D"), + block_out_channels=(32, 64, 96), + layers_per_block=2, + act_fn="silu", + cross_attention_dim=cross_attn_dim, +) + +time_encoder = TimeEncoderConfig( + encoding_dim=128, + time_embed_dim=cross_attn_dim, + flip_sin_to_cos=True, + downscale_freq_shift=1, +) diff --git a/diabetic_retinopathy/my_conf/net/net_256_3_6M.py b/diabetic_retinopathy/my_conf/net/net_256_3_6M.py new file mode 100644 index 0000000000000000000000000000000000000000..96a31d7fa08df8eb436f02c98b53cb154ac10585 --- /dev/null +++ b/diabetic_retinopathy/my_conf/net/net_256_3_6M.py @@ -0,0 +1,22 @@ +from GaussianProxy.conf.training_conf import TimeEncoderConfig, UNet2DConditionModelConfig + +cross_attn_dim = 64 + +net = UNet2DConditionModelConfig( + sample_size=256, + in_channels=3, + out_channels=3, + down_block_types=("DownBlock2D", "DownBlock2D", "CrossAttnDownBlock2D"), + up_block_types=("CrossAttnUpBlock2D", "UpBlock2D", "UpBlock2D"), + block_out_channels=(32, 64, 128), + layers_per_block=2, + act_fn="silu", + cross_attention_dim=cross_attn_dim, +) + +time_encoder = TimeEncoderConfig( + encoding_dim=128, + time_embed_dim=cross_attn_dim, + flip_sin_to_cos=True, + downscale_freq_shift=1, +) diff --git a/diabetic_retinopathy/my_conf/net/net_256_3_7M.py b/diabetic_retinopathy/my_conf/net/net_256_3_7M.py new file mode 100644 index 0000000000000000000000000000000000000000..b47baf8af721f2e80ad3650c59cb7c6150420880 --- /dev/null +++ b/diabetic_retinopathy/my_conf/net/net_256_3_7M.py @@ -0,0 +1,22 @@ +from GaussianProxy.conf.training_conf import TimeEncoderConfig, UNet2DConditionModelConfig + +cross_attn_dim = 64 + +net = UNet2DConditionModelConfig( + sample_size=256, + in_channels=3, + out_channels=3, + down_block_types=("DownBlock2D", "CrossAttnDownBlock2D", "CrossAttnDownBlock2D"), + up_block_types=("CrossAttnUpBlock2D", "CrossAttnUpBlock2D", "UpBlock2D"), + block_out_channels=(32, 96, 128), + layers_per_block=2, + act_fn="silu", + cross_attention_dim=cross_attn_dim, +) + +time_encoder = TimeEncoderConfig( + encoding_dim=128, + time_embed_dim=cross_attn_dim, + flip_sin_to_cos=True, + downscale_freq_shift=1, +) diff --git a/diabetic_retinopathy/my_conf/net/net_48_1.py b/diabetic_retinopathy/my_conf/net/net_48_1.py new file mode 100644 index 0000000000000000000000000000000000000000..df3328413ffc47ff49eb7860ee153939a7fccc22 --- /dev/null +++ b/diabetic_retinopathy/my_conf/net/net_48_1.py @@ -0,0 +1,23 @@ +from GaussianProxy.conf.training_conf import TimeEncoderConfig, UNet2DConditionModelConfig + +cross_attn_dim = 32 + +net = UNet2DConditionModelConfig( + sample_size=48, + in_channels=1, + out_channels=1, + down_block_types=("CrossAttnDownBlock2D", "CrossAttnDownBlock2D", "CrossAttnDownBlock2D"), + up_block_types=("CrossAttnUpBlock2D", "CrossAttnUpBlock2D", "CrossAttnUpBlock2D"), + block_out_channels=(16, 32, 64), + norm_num_groups=8, + layers_per_block=2, + act_fn="silu", + cross_attention_dim=cross_attn_dim, +) + +time_encoder = TimeEncoderConfig( + encoding_dim=64, + time_embed_dim=cross_attn_dim, + flip_sin_to_cos=True, + downscale_freq_shift=1, +) diff --git a/diabetic_retinopathy/my_conf/net/net_Jurkat.py b/diabetic_retinopathy/my_conf/net/net_Jurkat.py new file mode 100644 index 0000000000000000000000000000000000000000..d2caa03e0745f70db79d5cf5b15f5033b43c2300 --- /dev/null +++ b/diabetic_retinopathy/my_conf/net/net_Jurkat.py @@ -0,0 +1,22 @@ +from GaussianProxy.conf.training_conf import UNet2DConditionModelConfig, TimeEncoderConfig + +cross_attn_dim = 64 + +net = UNet2DConditionModelConfig( + sample_size=66, # torch.compile seems to *silently* crash on this sample size (gives NaN gradients)! + in_channels=3, + out_channels=3, + down_block_types=("CrossAttnDownBlock2D", "CrossAttnDownBlock2D", "CrossAttnDownBlock2D"), + up_block_types=("CrossAttnUpBlock2D", "CrossAttnUpBlock2D", "CrossAttnUpBlock2D"), + block_out_channels=(64, 128, 256), + layers_per_block=2, + act_fn="silu", + cross_attention_dim=cross_attn_dim, +) + +time_encoder = TimeEncoderConfig( + encoding_dim=128, + time_embed_dim=cross_attn_dim, + flip_sin_to_cos=True, + downscale_freq_shift=1, +) diff --git a/diabetic_retinopathy/my_conf/scheduler/DDIM_3k_vpred_tresh_SNR_trailing.json b/diabetic_retinopathy/my_conf/scheduler/DDIM_3k_vpred_tresh_SNR_trailing.json new file mode 100644 index 0000000000000000000000000000000000000000..f7994596907c2a827c8d9941c86adb19ed8e43f2 --- /dev/null +++ b/diabetic_retinopathy/my_conf/scheduler/DDIM_3k_vpred_tresh_SNR_trailing.json @@ -0,0 +1,19 @@ +{ + "_class_name": "DDIMScheduler", + "_diffusers_version": "0.32.2", + "beta_end": 0.02, + "beta_schedule": "linear", + "beta_start": 0.0001, + "clip_sample": false, + "clip_sample_range": 1.0, + "dynamic_thresholding_ratio": 0.995, + "num_train_timesteps": 3000, + "prediction_type": "v_prediction", + "rescale_betas_zero_snr": true, + "sample_max_value": 1.0, + "set_alpha_to_one": true, + "steps_offset": 0, + "thresholding": true, + "timestep_spacing": "trailing", + "trained_betas": null +} \ No newline at end of file diff --git a/diabetic_retinopathy/net/config.json b/diabetic_retinopathy/net/config.json new file mode 100644 index 0000000000000000000000000000000000000000..37afdc42e07467daa04af5d2554527d05a765bff --- /dev/null +++ b/diabetic_retinopathy/net/config.json @@ -0,0 +1,64 @@ +{ + "_class_name": "UNet2DConditionModel", + "_diffusers_version": "0.35.2", + "act_fn": "silu", + "addition_embed_type": null, + "addition_embed_type_num_heads": 64, + "addition_time_embed_dim": null, + "attention_head_dim": 8, + "attention_type": "default", + "block_out_channels": [ + 32, + 64, + 128 + ], + "center_input_sample": false, + "class_embed_type": null, + "class_embeddings_concat": false, + "conv_in_kernel": 3, + "conv_out_kernel": 3, + "cross_attention_dim": 64, + "cross_attention_norm": null, + "down_block_types": [ + "DownBlock2D", + "DownBlock2D", + "CrossAttnDownBlock2D" + ], + "downsample_padding": 1, + "dropout": 0.0, + "dual_cross_attention": false, + "encoder_hid_dim": null, + "encoder_hid_dim_type": null, + "flip_sin_to_cos": true, + "freq_shift": 0, + "in_channels": 3, + "layers_per_block": 2, + "mid_block_only_cross_attention": null, + "mid_block_scale_factor": 1, + "mid_block_type": "UNetMidBlock2DCrossAttn", + "norm_eps": 1e-05, + "norm_num_groups": 32, + "num_attention_heads": null, + "num_class_embeds": null, + "only_cross_attention": false, + "out_channels": 3, + "projection_class_embeddings_input_dim": null, + "resnet_out_scale_factor": 1.0, + "resnet_skip_time_act": false, + "resnet_time_scale_shift": "default", + "reverse_transformer_layers_per_block": null, + "sample_size": 256, + "time_cond_proj_dim": null, + "time_embedding_act_fn": null, + "time_embedding_dim": null, + "time_embedding_type": "positional", + "timestep_post_act": null, + "transformer_layers_per_block": 1, + "up_block_types": [ + "CrossAttnUpBlock2D", + "UpBlock2D", + "UpBlock2D" + ], + "upcast_attention": false, + "use_linear_projection": false +}