diff --git a/NASH_steato/net/diffusion_pytorch_model.safetensors b/NASH_steato/net/diffusion_pytorch_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..0276e47535d3896cd3a8b2511503d1190adf3d6c --- /dev/null +++ b/NASH_steato/net/diffusion_pytorch_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d22101b90ad60a035434194718b8eefcbf79e6a82c7decd996f43505c17915d +size 97782492 diff --git a/NASH_steato/video_time_encoder/diffusion_pytorch_model.safetensors b/NASH_steato/video_time_encoder/diffusion_pytorch_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..dcf362b206bf7df2786df12af6b76025489ac3b5 --- /dev/null +++ b/NASH_steato/video_time_encoder/diffusion_pytorch_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3fcc2c902c6ed8d14e67b7722d5f8fe48db3a676ace77188046a7835431b6fb3 +size 50104 diff --git a/biotine/my_conf/dataset/BBBC021/BBBC021_196_docetaxel_hard_aug_inference.py b/biotine/my_conf/dataset/BBBC021/BBBC021_196_docetaxel_hard_aug_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..64963aa48595e8d34affd33eeac1c61577f9180d --- /dev/null +++ b/biotine/my_conf/dataset/BBBC021/BBBC021_196_docetaxel_hard_aug_inference.py @@ -0,0 +1,4 @@ +from GaussianProxy.conf.dataset.BBBC021_196_hard_aug_inference import dataset + +dataset.path = "/lustre/fsn1/projects/rech/icr/ufc43hj/datasets/BBBC021/196x196/docetaxel_hard_augmented" +dataset.name += "_docetaxel" diff --git a/biotine/my_conf/dataset/BBBC021/BBBC021_196_docetaxel_inference.py b/biotine/my_conf/dataset/BBBC021/BBBC021_196_docetaxel_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..95ff8768553ef62ad5d542799cd8d340a1b6d1c0 --- /dev/null +++ b/biotine/my_conf/dataset/BBBC021/BBBC021_196_docetaxel_inference.py @@ -0,0 +1,4 @@ +from GaussianProxy.conf.dataset.BBBC021_196_inference import BBBC021_196_inference as BBBC021_196_docetaxel_inference + +BBBC021_196_docetaxel_inference.path = "/lustre/fsn1/projects/rech/icr/ufc43hj/datasets/BBBC021/196x196/docetaxel" +BBBC021_196_docetaxel_inference.name += "_docetaxel" diff --git a/biotine/my_conf/dataset/ChromaLive6h/chromalive6h_3ch_png_hard_aug_inference.py b/biotine/my_conf/dataset/ChromaLive6h/chromalive6h_3ch_png_hard_aug_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..d458f5bd6629995bfe66556c11b44d6162ef32ea --- /dev/null +++ b/biotine/my_conf/dataset/ChromaLive6h/chromalive6h_3ch_png_hard_aug_inference.py @@ -0,0 +1,33 @@ +from torch import float32 +from torchvision.transforms import Compose, ConvertImageDtype, Normalize, Resize + +from GaussianProxy.conf.training_conf import DataSet, DatasetParams +from GaussianProxy.utils.data import ImageDataset + +DEFINITION = 128 +NUMBER_OF_CHANNELS = 3 + +transforms = Compose( + transforms=[ + Resize(DEFINITION), + 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.split("_")[1]), + dataset_class=ImageDataset, +) + +dataset = DataSet( + name="chromaLive6h_3ch_png_patches_380px_hard_aug", + data_shape=(NUMBER_OF_CHANNELS, DEFINITION, DEFINITION), + transforms=transforms, + selected_dists=None, # not used + expected_initial_data_range=(0, 255), + dataset_params=ds_params, + path="/lustre/fsn1/projects/rech/icr/ufc43hj/datasets/20231017ChromaLive_6hr_4ch/MIP_normalized/paired_dataset/patches_hard_augmented", +) diff --git a/biotine/my_conf/dataset/ChromaLive6h/chromalive6h_3ch_png_inference.py b/biotine/my_conf/dataset/ChromaLive6h/chromalive6h_3ch_png_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..186980265e1f3f16e37371ad19289a9a4f3c2ffb --- /dev/null +++ b/biotine/my_conf/dataset/ChromaLive6h/chromalive6h_3ch_png_inference.py @@ -0,0 +1,33 @@ +from torch import float32 +from torchvision.transforms import Compose, ConvertImageDtype, Normalize, Resize + +from GaussianProxy.conf.training_conf import DataSet, DatasetParams +from GaussianProxy.utils.data import ImageDataset + +DEFINITION = 128 +NUMBER_OF_CHANNELS = 3 + +transforms = Compose( + transforms=[ + Resize(DEFINITION), + 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.split("_")[1]), + dataset_class=ImageDataset, +) + +dataset = DataSet( + name="chromaLive6h_3ch_png_patches_380px", + data_shape=(NUMBER_OF_CHANNELS, DEFINITION, DEFINITION), + transforms=transforms, + selected_dists=None, # not used + expected_initial_data_range=(0, 255), + dataset_params=ds_params, + path="/lustre/fsn1/projects/rech/icr/ufc43hj/datasets/20231017ChromaLive_6hr_4ch/MIP_normalized/paired_dataset/patches", +) diff --git a/biotine/my_conf/dataset/Jurkat/Jurkat_inference.py b/biotine/my_conf/dataset/Jurkat/Jurkat_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..19eeca252f8c5ada8889f0c325667ccb41f9d904 --- /dev/null +++ b/biotine/my_conf/dataset/Jurkat/Jurkat_inference.py @@ -0,0 +1,3 @@ +from GaussianProxy.conf.dataset.Jurkat_inference import Jurkat_inference + +Jurkat_inference.path = "/lustre/fsn1/projects/rech/icr/ufc43hj/datasets/Jurkat/rgb_images_all_cell_cycles" diff --git a/biotine/my_conf/dataset/Jurkat/Jurkat_inference_hard_aug.py b/biotine/my_conf/dataset/Jurkat/Jurkat_inference_hard_aug.py new file mode 100644 index 0000000000000000000000000000000000000000..52ecd6ca5f22d5c85cf023d4c6267d0b82ea0868 --- /dev/null +++ b/biotine/my_conf/dataset/Jurkat/Jurkat_inference_hard_aug.py @@ -0,0 +1,3 @@ +from GaussianProxy.conf.dataset.Jurkat_inference import Jurkat_inference as dataset + +dataset.path = "/lustre/fsn1/projects/rech/icr/ufc43hj/datasets/Jurkat/rgb_images_all_cell_cycles_hard_augmented" diff --git a/biotine/my_conf/dataset/NASH_fibrosis/NASH_fibrosis_inference.py b/biotine/my_conf/dataset/NASH_fibrosis/NASH_fibrosis_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..beaa73768127015587be2b2e3cb370bf9ebea96b --- /dev/null +++ b/biotine/my_conf/dataset/NASH_fibrosis/NASH_fibrosis_inference.py @@ -0,0 +1,3 @@ +from GaussianProxy.conf.dataset.NASH_fibrosis_inference import dataset + +dataset.path = "/lustre/fsn1/projects/rech/icr/ufc43hj/datasets/NASH/prepared_data/fibrosis" diff --git a/biotine/my_conf/dataset/NASH_steatosis/NASH_steatosis_inference.py b/biotine/my_conf/dataset/NASH_steatosis/NASH_steatosis_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..3e207e12dc770568032eb1992d143e7eb564b44e --- /dev/null +++ b/biotine/my_conf/dataset/NASH_steatosis/NASH_steatosis_inference.py @@ -0,0 +1,3 @@ +from GaussianProxy.conf.dataset.NASH_steatosis_inference import dataset + +dataset.path = "/lustre/fsn1/projects/rech/icr/ufc43hj/datasets/NASH/prepared_data/steatosis" diff --git a/biotine/my_conf/dataset/biotine/biotine_png_128_hard_aug_inference.py b/biotine/my_conf/dataset/biotine/biotine_png_128_hard_aug_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..d546786791e75b12658ccdb804f9e32b2352c308 --- /dev/null +++ b/biotine/my_conf/dataset/biotine/biotine_png_128_hard_aug_inference.py @@ -0,0 +1,3 @@ +from GaussianProxy.conf.dataset.biotine_png_128_hard_aug_inference import dataset + +dataset.path = "/lustre/fsn1/projects/rech/icr/ufc43hj/datasets/biotine/3_channels_min_99_perc_normalized_rgb_stacks_png/patches_255_hard_augmented" diff --git a/biotine/my_conf/dataset/biotine/biotine_png_128_inference.py b/biotine/my_conf/dataset/biotine/biotine_png_128_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..0e75f3876aa2a2ed9cda852482564d283a0940a1 --- /dev/null +++ b/biotine/my_conf/dataset/biotine/biotine_png_128_inference.py @@ -0,0 +1,3 @@ +from GaussianProxy.conf.dataset.biotine_png_128_inference import dataset + +dataset.path = "/lustre/fsn1/projects/rech/icr/ufc43hj/datasets/biotine/3_channels_min_99_perc_normalized_rgb_stacks_png/patches_255" diff --git a/biotine/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_hard_aug_inference.py b/biotine/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_hard_aug_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..feccbd2a0c9d9cd63a1610630d257c288e5aa3b0 --- /dev/null +++ b/biotine/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_hard_aug_inference.py @@ -0,0 +1,4 @@ +from GaussianProxy.conf.dataset.diabetic_retinopathy_inference import diabetic_retinopathy_inference as dataset + +dataset.path = "/lustre/fsn1/projects/rech/icr/ufc43hj/datasets/DiabeticRetinopathy/prepared_dataset/train_hard_augmented" +dataset.name = "diabetic_retinopathy_inference_hard_augmented" diff --git a/biotine/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_inference.py b/biotine/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..a39977d35a03d0d0fd108ca5ac1e6efe512f4a17 --- /dev/null +++ b/biotine/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_inference.py @@ -0,0 +1,3 @@ +from GaussianProxy.conf.dataset.diabetic_retinopathy_inference import diabetic_retinopathy_inference + +diabetic_retinopathy_inference.path = "/lustre/fsn1/projects/rech/icr/ufc43hj/datasets/DiabeticRetinopathy/prepared_dataset/train" diff --git a/biotine/my_conf/dataset/ependymal_context/ependymal_context_inference.py b/biotine/my_conf/dataset/ependymal_context/ependymal_context_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..bae2a302edf9621fe2722910f0baee57e5f61057 --- /dev/null +++ b/biotine/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, + selected_dists=None, + expected_initial_data_range=(0, 255), + dataset_params=ds_params, + path="/lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/prepared_dataset_context", +) diff --git a/biotine/my_conf/dataset/ependymal_cutout/ependymal_cutout_inference.py b/biotine/my_conf/dataset/ependymal_cutout/ependymal_cutout_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..79ed41ec4ed87d4fb3e8cb8b828f3c780e29e56a --- /dev/null +++ b/biotine/my_conf/dataset/ependymal_cutout/ependymal_cutout_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_cutout", + data_shape=(NUMBER_OF_CHANNELS, DEFINITION, DEFINITION), + transforms=transforms, + selected_dists=[1, 2, 3, 4, 5, 6], # 0 is the trash class! + expected_initial_data_range=(0, 255), + dataset_params=ds_params, + path="/lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/prepared_dataset_crop", +) diff --git a/biotine/my_conf/my_training_conf.py b/biotine/my_conf/my_training_conf.py new file mode 100644 index 0000000000000000000000000000000000000000..67859f6c109636452bf05bb71abb62487fee2644 --- /dev/null +++ b/biotine/my_conf/my_training_conf.py @@ -0,0 +1,194 @@ +from datetime import datetime + +from omegaconf import MISSING + +################################################################################################### +############################################ Base conf ############################################ +################################################################################################### +# These are generic classes that need full instantiation +# pylint: disable=unused-import +from GaussianProxy.conf.training_conf import ( + Accelerate, + AccelerateLaunchArgs, + Checkpointing, + Config, + DataLoader, + DDIMSchedulerConfig, + Evaluation, + ForwardNoising, # noqa: F401 + InvertedRegeneration, # noqa: F401 + IterativeInvertedRegeneration, # noqa: F401 + MetricsComputation, # noqa: F401 + SimilarityWithTrainData, + SimpleGeneration, # noqa: F401 + Slurm, + Training, +) + +# pylint: enable=unused-import + +################################################################################################### +########################################## Defaults conf ########################################## +################################################################################################### +defaults = [ + {"dataset": "biotine/biotine_png_128_fully_ordered"}, + "hydra/job_logging/custom", + "_self_", +] + +# fmt: off + +# ------------------------------------------- Job launch ------------------------------------------ +now = datetime.now().strftime("%Y-%m-%d--%H-%M-%S") +slurm = Slurm( + enabled = True, + monitor = False, + account = "icr@h100", + partition = None, + constraint = "h100", + qos = "t3", + nodes = 1, + num_gpus = 4, + max_num_requeue = 3, + total_job_time = 20 * 60, + output_folder = "${hydra:run.dir}" + f"/{now}_%j", + email = "tboyer@bio.ens.psl.eu", + job_launch_delay = None, +) + +accelerate_launch_args = AccelerateLaunchArgs( + machine_rank = 0, + num_machines = 1, + gpu_ids = "all", + rdzv_backend = "static", + same_network = "true", + mixed_precision = "bf16", + num_processes = slurm.num_gpus, + main_process_port = 29503, + dynamo_backend = "inductor", +) + +accelerate = Accelerate( + launch_args = accelerate_launch_args, + offline = True, +) + +# ---------------------------------------------- Data --------------------------------------------- +data_loader = DataLoader( + num_workers = 4, + train_prefetch_factor = 4, + pin_memory = True, + persistent_workers = True, +) + +# -------------------------------------------- Training ------------------------------------------- +training = Training( + gradient_accumulation_steps = 1, + train_batch_size = 128 - 16, + max_grad_norm = 1, + nb_time_samplings = 1_000_000, + unpaired_data = False, +) + +checkpointing = Checkpointing( + checkpoints_total_limit = 3, + resume_from_checkpoint = True, + checkpoint_every_n_steps = 5000, + chckpt_base_path = MISSING, +) + +# ------------------------------------------- Evaluation ------------------------------------------ +# naming convention is lowercase + underscore; has to be respected for debug args modification +metrics_compute = MetricsComputation( + nb_samples_to_gen_per_time = "adapt half aug", + batch_size = 256, + nb_diffusion_timesteps = 50, + selected_times = [1, 5, 10, 15, 19], + augmentations_for_metrics_comp = ["RandomHorizontalFlip", "RandomVerticalFlip", "RandomRotationSquareSymmetry"], +) + +simple_generation = SimpleGeneration( + nb_diffusion_timesteps = 50, + n_rows_displayed = 4, # TODO: merge training & evaluation configs + nb_generated_samples = 16, # TODO: merge training & evaluation configs +) + +inverted_regeneration = InvertedRegeneration( + nb_diffusion_timesteps = 50, + n_rows_displayed = 8, # TODO: merge training & evaluation configs + nb_generated_samples = 16, # TODO: merge training & evaluation configs + nb_video_times_in_parallel = 8, # TODO: merge training & evaluation configs TODO: not used in training! + nb_video_timesteps = 50, # TODO: merge training & evaluation configs +) + +sim_with_train = SimilarityWithTrainData( # must be put after metrics_compute! + nb_generated_samples = -1, # TODO: not used + batch_size = 2048, + nb_batches_shown = -1, # TODO: not used + n_rows_displayed = -1, # TODO: not used + nb_diffusion_timesteps = -1, # TODO: not used +) + +evaluation = Evaluation( + every_n_opt_steps = 25_000, + batch_size = 16, # TODO: remove this and use config from above + nb_video_timesteps = 50, # TODO: remove this and use config from above + strategies = [simple_generation, inverted_regeneration, metrics_compute, sim_with_train], +) + +# ------------------------------------------- Diffusion ------------------------------------------- +dynamic = DDIMSchedulerConfig( + num_train_timesteps = 3000, + clip_sample = False, + clip_sample_range = 1, + thresholding = True, + sample_max_value = 1, + prediction_type = "v_prediction", + rescale_betas_zero_snr = False, + timestep_spacing = "leading", +) + +# ---------------------------------------------- Model -------------------------------------------- +from my_conf.net.net_128_3 import net, time_encoder # noqa: E402 + +# ------------------------------------------ Final Config ----------------------------------------- +config = Config( + # defaults + defaults = defaults, + # model + dynamic = dynamic, + net = net, + time_encoder = time_encoder, + # script + launcher_script_parent_folder = "/linkhome/rech/genlxz01/ufc43hj/sources/GaussianProxy", + script = "train", + # experiment variables + exp_parent_folder = "/lustre/fsn1/projects/rech/icr/ufc43hj/experiments", + project = MISSING, + run_name = MISSING, + # hydra + hydra = {"run": {"dir": "${exp_parent_folder}/${project}/${run_name}"}}, + # slurm + slurm = slurm, + # accelerate + accelerate = accelerate, + # misc. + debug = False, + profile = False, + tmpdir_location = None, + # experiment tracker + logger = "wandb", + entity = "thomasboyer", + # checkpointing + checkpointing = checkpointing, + # dataset + dataset = MISSING, + # dataloaders + dataloaders = data_loader, + # training + training = training, + # evaluation + evaluation = evaluation, + # optimizer + learning_rate = 1e-4, +) diff --git a/biotine/my_conf/net/net_128_3.py b/biotine/my_conf/net/net_128_3.py new file mode 100644 index 0000000000000000000000000000000000000000..994280ed4d0a7e6e1410e51f2b058157fb17c962 --- /dev/null +++ b/biotine/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/biotine/my_conf/net/net_196_3_12M.py b/biotine/my_conf/net/net_196_3_12M.py new file mode 100644 index 0000000000000000000000000000000000000000..83fa0274707bdde54fd0e1141deec96f779b5393 --- /dev/null +++ b/biotine/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/biotine/my_conf/net/net_66_3_2M.py b/biotine/my_conf/net/net_66_3_2M.py new file mode 100644 index 0000000000000000000000000000000000000000..43f1f32ac81b719f3be41e19ea2d0e1eaeed5477 --- /dev/null +++ b/biotine/my_conf/net/net_66_3_2M.py @@ -0,0 +1,23 @@ +from GaussianProxy.conf.training_conf import UNet2DConditionModelConfig, TimeEncoderConfig + +cross_attn_dim = 64 + +net = UNet2DConditionModelConfig( + sample_size=66, + in_channels=3, + out_channels=3, + down_block_types=("DownBlock2D", "CrossAttnDownBlock2D", "CrossAttnDownBlock2D"), + up_block_types=("CrossAttnUpBlock2D", "CrossAttnUpBlock2D", "UpBlock2D"), + block_out_channels=(24, 40, 72), + norm_num_groups=8, + 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/biotine/net/config.json b/biotine/net/config.json new file mode 100644 index 0000000000000000000000000000000000000000..130679fc064f935fd8354d24a5153a0f76b4153c --- /dev/null +++ b/biotine/net/config.json @@ -0,0 +1,64 @@ +{ + "_class_name": "UNet2DConditionModel", + "_diffusers_version": "0.33.1", + "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": [ + 64, + 128, + 256 + ], + "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": [ + "CrossAttnDownBlock2D", + "CrossAttnDownBlock2D", + "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": 128, + "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", + "CrossAttnUpBlock2D", + "CrossAttnUpBlock2D" + ], + "upcast_attention": false, + "use_linear_projection": false +} diff --git a/biotine/net/diffusion_pytorch_model.safetensors b/biotine/net/diffusion_pytorch_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..92dafd6f4970ed7044ffa52937332fadfe0254ea --- /dev/null +++ b/biotine/net/diffusion_pytorch_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c4f64697a60a90e9e721b7a112c4b8bed3e446b614c99f18ad6530eafd7a46c +size 97782492 diff --git a/biotine/video_time_encoder/config.json b/biotine/video_time_encoder/config.json new file mode 100644 index 0000000000000000000000000000000000000000..cd613a1113b6ed4da3b7a29267a8d8798d07b6b5 --- /dev/null +++ b/biotine/video_time_encoder/config.json @@ -0,0 +1,8 @@ +{ + "_class_name": "VideoTimeEncoding", + "_diffusers_version": "0.33.1", + "downscale_freq_shift": 1.0, + "encoding_dim": 128, + "flip_sin_to_cos": true, + "time_embed_dim": 64 +} diff --git a/biotine/video_time_encoder/diffusion_pytorch_model.safetensors b/biotine/video_time_encoder/diffusion_pytorch_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..3ac03b5e71169128ced02a3961ff04a6dacf5a27 --- /dev/null +++ b/biotine/video_time_encoder/diffusion_pytorch_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2014cc6d77f8388f37ea2664f32528a857c2221f7bb51a1c8049c3836c68c486 +size 50104 diff --git a/biotine_unpaired/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_inference.py b/biotine_unpaired/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..a39977d35a03d0d0fd108ca5ac1e6efe512f4a17 --- /dev/null +++ b/biotine_unpaired/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_inference.py @@ -0,0 +1,3 @@ +from GaussianProxy.conf.dataset.diabetic_retinopathy_inference import diabetic_retinopathy_inference + +diabetic_retinopathy_inference.path = "/lustre/fsn1/projects/rech/icr/ufc43hj/datasets/DiabeticRetinopathy/prepared_dataset/train" diff --git a/biotine_unpaired/my_conf/dataset/ependymal_cutout/ependymal_cutout_01_noised_separate_gt_fully_ordered.yaml b/biotine_unpaired/my_conf/dataset/ependymal_cutout/ependymal_cutout_01_noised_separate_gt_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c12f125a27d852d80c9aca3fbfffc0285aa4ccd5 --- /dev/null +++ b/biotine_unpaired/my_conf/dataset/ependymal_cutout/ependymal_cutout_01_noised_separate_gt_fully_ordered.yaml @@ -0,0 +1,26 @@ +name: ependymal_cutout_01_noised_separate_gt_fully_ordered + +path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/prepared_dataset_noised_0.1_crop/all_imgs +hard_aug_path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/prepared_dataset_noised_0.1_crop_hard_augmented/all_imgs +path_to_single_parquet: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/ependymal_cutout_01_noised__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet + +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: None + +fully_ordered: true diff --git a/biotine_unpaired/my_conf/dataset/ependymal_cutout/ependymal_cutout_03_noised_separate_gt_fully_ordered.yaml b/biotine_unpaired/my_conf/dataset/ependymal_cutout/ependymal_cutout_03_noised_separate_gt_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e58db20d77174474867a4c3d7666ea0b50db51ae --- /dev/null +++ b/biotine_unpaired/my_conf/dataset/ependymal_cutout/ependymal_cutout_03_noised_separate_gt_fully_ordered.yaml @@ -0,0 +1,25 @@ +name: ependymal_cutout_03_noised_separate_gt_fully_ordered + +path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/prepared_dataset_noised_0.3_crop/all_imgs +hard_aug_path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/prepared_dataset_noised_0.3_crop_hard_augmented/all_imgs +path_to_single_parquet: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/ependymal_cutout_03_noised__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet + +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: None + +fully_ordered: true diff --git a/biotine_unpaired/my_conf/dataset/ependymal_cutout/ependymal_cutout_fully_ordered.yaml b/biotine_unpaired/my_conf/dataset/ependymal_cutout/ependymal_cutout_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..861a69e71721d0c84d6dc90a7011c75cfac060e7 --- /dev/null +++ b/biotine_unpaired/my_conf/dataset/ependymal_cutout/ependymal_cutout_fully_ordered.yaml @@ -0,0 +1,19 @@ +name: ependymal_cutout_fully_ordered +path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/prepared_dataset_crop +path_to_single_parquet: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/ependymal_cutout__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet +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! +fully_ordered: true diff --git a/biotine_unpaired/net/diffusion_pytorch_model.safetensors b/biotine_unpaired/net/diffusion_pytorch_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..28940a470696314bc073767c904ebdf705f2a4d1 --- /dev/null +++ b/biotine_unpaired/net/diffusion_pytorch_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e44dec6afd8ae641c88fea7f81ea3900ba8d505a541fe6c2cc79af5b5e99bbb +size 97782492 diff --git a/biotine_unpaired/video_time_encoder/diffusion_pytorch_model.safetensors b/biotine_unpaired/video_time_encoder/diffusion_pytorch_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..244e92af9fa41ab4dfa26b04b17c68ac5736dcc3 --- /dev/null +++ b/biotine_unpaired/video_time_encoder/diffusion_pytorch_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f3dcca738daa8746d4fc1d062787ad10d1a8f81ee9957fe86e41a3aef7b27d4 +size 50104 diff --git a/cell_cycle/dynamic/scheduler_config.json b/cell_cycle/dynamic/scheduler_config.json new file mode 100644 index 0000000000000000000000000000000000000000..13ba576441b70aaf967ceb76f1383c9f4ec1c7da --- /dev/null +++ b/cell_cycle/dynamic/scheduler_config.json @@ -0,0 +1,19 @@ +{ + "_class_name": "DDIMScheduler", + "_diffusers_version": "0.35.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": false, + "sample_max_value": 1.0, + "set_alpha_to_one": true, + "steps_offset": 0, + "thresholding": true, + "timestep_spacing": "leading", + "trained_betas": null +} diff --git a/cell_cycle/my_conf/dataset/BBBC021/BBBC021_196_docetaxel.yaml b/cell_cycle/my_conf/dataset/BBBC021/BBBC021_196_docetaxel.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9b76f4af62e3afa15e8e78937eb473d9cbac562a --- /dev/null +++ b/cell_cycle/my_conf/dataset/BBBC021/BBBC021_196_docetaxel.yaml @@ -0,0 +1,16 @@ +name: BBBC021_196_docetaxel +path: /projects/static2dynamic/datasets/BBBC021/196x196/docetaxel +data_shape: [3, 196, 196] +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/cell_cycle/my_conf/dataset/BBBC021/BBBC021_196_docetaxel_fully_ordered_inference.py b/cell_cycle/my_conf/dataset/BBBC021/BBBC021_196_docetaxel_fully_ordered_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..29419d6196c43f0aa4700ca97214606d539dc509 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/BBBC021/BBBC021_196_docetaxel_hard_aug_inference.py b/cell_cycle/my_conf/dataset/BBBC021/BBBC021_196_docetaxel_hard_aug_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..bd135b459e112c4860f979c12d5bf7064e5032ba --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/BBBC021/BBBC021_196_docetaxel_inference.py b/cell_cycle/my_conf/dataset/BBBC021/BBBC021_196_docetaxel_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..9be4073e5a6906688538d23ece1bb9a85ebe3baf --- /dev/null +++ b/cell_cycle/my_conf/dataset/BBBC021/BBBC021_196_docetaxel_inference.py @@ -0,0 +1,9 @@ +from dataclasses import replace + +from GaussianProxy.conf.dataset.BBBC021.BBBC021_196_inference import dataset + +dataset = replace( + dataset, + name=dataset.name + "_docetaxel", + path="/projects/static2dynamic/datasets/BBBC021/196x196/docetaxel", +) diff --git a/cell_cycle/my_conf/dataset/BBBC021/BBBC021_196_nocodazole_inference.py b/cell_cycle/my_conf/dataset/BBBC021/BBBC021_196_nocodazole_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..af9d4b8db15c7b61616801612c426b9ba0dd629e --- /dev/null +++ b/cell_cycle/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, + dataset_params=ds_params, + path="/projects/static2dynamic/datasets/BBBC021/196x196/nocodazole", + name=dataset.name + "_nocodazole", +) diff --git a/cell_cycle/my_conf/dataset/BBBC048/bbbc048.yaml b/cell_cycle/my_conf/dataset/BBBC048/bbbc048.yaml new file mode 100644 index 0000000000000000000000000000000000000000..10d8775e4a9a54bd5167de52272b15c4e3fc0d46 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/BBBC048/bbbc048_inference.py b/cell_cycle/my_conf/dataset/BBBC048/bbbc048_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..502b4e3398627114cff7a979e77aad44259a0779 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/ChromaLive6h/ChromaLive6h_3ch_png.yaml b/cell_cycle/my_conf/dataset/ChromaLive6h/ChromaLive6h_3ch_png.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fa3f1f1a9e0047d8ae8803fe387ea029199b08a0 --- /dev/null +++ b/cell_cycle/my_conf/dataset/ChromaLive6h/ChromaLive6h_3ch_png.yaml @@ -0,0 +1,19 @@ +name: chromaLive6h_3ch_png_patches_380px +path: /projects/static2dynamic/datasets/20231017ChromaLive_6hr_4ch/MIP_normalized/paired_dataset/patches +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 ] + - _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: diff --git a/cell_cycle/my_conf/dataset/ChromaLive6h/ChromaLive6h_3ch_png_hard_aug.yaml b/cell_cycle/my_conf/dataset/ChromaLive6h/ChromaLive6h_3ch_png_hard_aug.yaml new file mode 100644 index 0000000000000000000000000000000000000000..426907c0883d4aac51c298f00f2e3f77fdda05e7 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/ChromaLive6h/ChromaLive6h_4ch_tif.yaml b/cell_cycle/my_conf/dataset/ChromaLive6h/ChromaLive6h_4ch_tif.yaml new file mode 100644 index 0000000000000000000000000000000000000000..694a2ba580d61c98606c8a5e60213ede4d0b5b5a --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/ChromaLive6h/chromalive6h_3ch_png_fully_ordered_inference.py b/cell_cycle/my_conf/dataset/ChromaLive6h/chromalive6h_3ch_png_fully_ordered_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..20fc6d08aedbed7a927b05d3f3a6ad46cf67b8d9 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/ChromaLive6h/chromalive6h_3ch_png_hard_aug_inference.py b/cell_cycle/my_conf/dataset/ChromaLive6h/chromalive6h_3ch_png_hard_aug_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..02246ed5f528d5b04a2267c44ce65997de4c3596 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/ChromaLive6h/chromalive6h_3ch_png_inference.py b/cell_cycle/my_conf/dataset/ChromaLive6h/chromalive6h_3ch_png_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..e7a99754fdf6a320867784d7f225c4580d8d9bf1 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/ChromaLiveTL24h/ChromaLiveTL24h.yaml b/cell_cycle/my_conf/dataset/ChromaLiveTL24h/ChromaLiveTL24h.yaml new file mode 100644 index 0000000000000000000000000000000000000000..491c42c2bc5ecc036ec55de7ede90b8c1ed88a8b --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/DeepCycle/deepcycle_brightfield_to_3D_inference.py b/cell_cycle/my_conf/dataset/DeepCycle/deepcycle_brightfield_to_3D_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..5d5c7af253559ce6fbec7561ff59e4a9f9c7e4e6 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/DeepCycle/deepcycle_hoechst_brightfield_to_3D_inference.py b/cell_cycle/my_conf/dataset/DeepCycle/deepcycle_hoechst_brightfield_to_3D_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..4ffcf9696a44cd5652089f937d88e2b630002f32 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/DeepCycle/deepcycle_inference.py b/cell_cycle/my_conf/dataset/DeepCycle/deepcycle_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..f4f7cd69d76b72676b9513a5e44dc91ccf130028 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/DeepCycle/deepcycle_markers_inference.py b/cell_cycle/my_conf/dataset/DeepCycle/deepcycle_markers_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..129730fd4014e545f15100c50b4fd60481782e17 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/Jurkat/Jurkat.yaml b/cell_cycle/my_conf/dataset/Jurkat/Jurkat.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6dae2eb460d55c87abf178bad5c7a2f4d43587cb --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/Jurkat/Jurkat_brightfield_fully_ordered.yaml b/cell_cycle/my_conf/dataset/Jurkat/Jurkat_brightfield_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7c4133274ac9c90bb7ec8fde4fe2736a3724fa30 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/Jurkat/Jurkat_brightfield_fully_ordered_inference.py b/cell_cycle/my_conf/dataset/Jurkat/Jurkat_brightfield_fully_ordered_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..b847a2ea0da14b9271d0561105275ead359de4c7 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/Jurkat/Jurkat_brightfield_inference.py b/cell_cycle/my_conf/dataset/Jurkat/Jurkat_brightfield_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..9d9cf49c06507bbebc2f57319f952ce9d5a3073b --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/Jurkat/Jurkat_fully_ordered.yaml b/cell_cycle/my_conf/dataset/Jurkat/Jurkat_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..24e6e21de17a84ad77fba0ddd54fa0f770ea3cdf --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/Jurkat/Jurkat_inference.py b/cell_cycle/my_conf/dataset/Jurkat/Jurkat_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..8f9c110d8ff54daa5c3671481b9580b407d01724 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/Jurkat/Jurkat_inference_hard_aug.py b/cell_cycle/my_conf/dataset/Jurkat/Jurkat_inference_hard_aug.py new file mode 100644 index 0000000000000000000000000000000000000000..cc826ec44e040ea3bdf9931f7434e47f5345cb9c --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/NASH_fibrosis/NASH_fibrosis.yaml b/cell_cycle/my_conf/dataset/NASH_fibrosis/NASH_fibrosis.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a53dc5ec231d267cb6fcdc50c7166e5a792c0d32 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/NASH_fibrosis/NASH_fibrosis_fully_ordered_inference.py b/cell_cycle/my_conf/dataset/NASH_fibrosis/NASH_fibrosis_fully_ordered_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..58a1b0331176b90a44a2209db56dba19005ef998 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/NASH_fibrosis/NASH_fibrosis_inference.py b/cell_cycle/my_conf/dataset/NASH_fibrosis/NASH_fibrosis_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..c9e9e16f31c3c75bb780bc4832868bd0c6cebcce --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/NASH_steatosis/NASH_steatosis.yaml b/cell_cycle/my_conf/dataset/NASH_steatosis/NASH_steatosis.yaml new file mode 100644 index 0000000000000000000000000000000000000000..663b957dadc1791cc3cefb75d269b3579204ea5c --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/NASH_steatosis/NASH_steatosis_fully_ordered.yaml b/cell_cycle/my_conf/dataset/NASH_steatosis/NASH_steatosis_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2ee2b473282b4c7882ddced978e0b4165481f237 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/NASH_steatosis/NASH_steatosis_fully_ordered_inference.py b/cell_cycle/my_conf/dataset/NASH_steatosis/NASH_steatosis_fully_ordered_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..d9918cc6e00541668f1d52847f662fad05fcf329 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/NASH_steatosis/NASH_steatosis_inference.py b/cell_cycle/my_conf/dataset/NASH_steatosis/NASH_steatosis_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..6e1d91853a23054a41429f141a048594f0446074 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/biotine/biotine_png_128.yaml b/cell_cycle/my_conf/dataset/biotine/biotine_png_128.yaml new file mode 100644 index 0000000000000000000000000000000000000000..49ffb167b04d435655c47b359aa8df480319f587 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/biotine/biotine_png_128_fully_ordered.yaml b/cell_cycle/my_conf/dataset/biotine/biotine_png_128_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3cceb83582d9dff9cd838ae1c5f4ac34f99b2af2 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/biotine/biotine_png_128_fully_ordered_inference.py b/cell_cycle/my_conf/dataset/biotine/biotine_png_128_fully_ordered_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..c0ba77af280d7f14f8cf140a19b146664524c38b --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/biotine/biotine_png_128_hard_aug.yaml b/cell_cycle/my_conf/dataset/biotine/biotine_png_128_hard_aug.yaml new file mode 100644 index 0000000000000000000000000000000000000000..07044d90813fe3acadb1a0d996adc1277f60ccbe --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/biotine/biotine_png_128_hard_aug_inference.py b/cell_cycle/my_conf/dataset/biotine/biotine_png_128_hard_aug_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..5fda38ec48345e97464fead2ea49563c1c484cc9 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/biotine/biotine_png_128_inference.py b/cell_cycle/my_conf/dataset/biotine/biotine_png_128_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..2f885668d8f708cce05382366a32dc71a3da7976 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/biotine/biotine_png_256.yaml b/cell_cycle/my_conf/dataset/biotine/biotine_png_256.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b2097e5ff9e66cec4a39e2fccea9f31f8751cbe4 --- /dev/null +++ b/cell_cycle/my_conf/dataset/biotine/biotine_png_256.yaml @@ -0,0 +1,18 @@ +name: biotine_png +path: /projects/static2dynamic/datasets/biotine/3_channels_min_99_perc_normalized_rgb_stacks_png/patches_255 +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} + - _target_: torchvision.transforms.Normalize + mean: [ 0.5, 0.5, 0.5 ] + std: [ 0.5, 0.5, 0.5 ] + - _target_: torchvision.transforms.transforms.Resize + size: 256 + - _target_: torchvision.transforms.RandomHorizontalFlip + - _target_: torchvision.transforms.RandomVerticalFlip + - _target_: GaussianProxy.utils.data.RandomRotationSquareSymmetry +selected_dists: [ 1, 5, 10, 15, 19 ] +expected_initial_data_range: [ 0, 255 ] diff --git a/cell_cycle/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy.yaml b/cell_cycle/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b458e5fc57edb75c902a3ddb5519f9064950f555 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2048_crop_fully_ordered.yaml b/cell_cycle/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/cell_cycle/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/cell_cycle/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2048_crop_inference.py b/cell_cycle/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2048_crop_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..84c134f0c7aa14e0f25ae95c629e26d719e7bd22 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2048_precrop_fully_ordered.yaml b/cell_cycle/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/cell_cycle/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/cell_cycle/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2048_precrop_inference.py b/cell_cycle/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2048_precrop_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..56a796fecda6f42247e83ee7b505cf738c625423 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_hard_aug_inference.py b/cell_cycle/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_hard_aug_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..4f92904332804efa76648f229efa8d99331c7800 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_inference.py b/cell_cycle/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..be31075247d1bb02e35ebcd777f233e0ecba9a55 --- /dev/null +++ b/cell_cycle/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_inference.py @@ -0,0 +1,5 @@ +from dataclasses import replace + +from GaussianProxy.conf.dataset.diabetic_retinopathy.diabetic_retinopathy_inference import dataset + +dataset = replace(dataset, path="/projects/static2dynamic/datasets/DiabeticRetinopathy/prepared_dataset/train") diff --git a/cell_cycle/my_conf/dataset/ependymal_cutout/ependymal_cutout_03_noised_separate_gt_inference.py b/cell_cycle/my_conf/dataset/ependymal_cutout/ependymal_cutout_03_noised_separate_gt_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..9260cff2e9e526d21b1d2db2231d7aae9ce08fed --- /dev/null +++ b/cell_cycle/my_conf/dataset/ependymal_cutout/ependymal_cutout_03_noised_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_03_noised", + path="/projects/static2dynamic/datasets/ependymal/prepared_dataset_noised_0.3_crop/", + dataset_params=dataset_params, +) diff --git a/cell_cycle/my_conf/dataset/ependymal_cutout/ependymal_cutout_fully_ordered_inference.py b/cell_cycle/my_conf/dataset/ependymal_cutout/ependymal_cutout_fully_ordered_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..8aec4fa3fd790e59f62f2c67728c9eca0bfcfff6 --- /dev/null +++ b/cell_cycle/my_conf/dataset/ependymal_cutout/ependymal_cutout_fully_ordered_inference.py @@ -0,0 +1,9 @@ +from dataclasses import replace + +from GaussianProxy.conf.dataset.ependymal_cutout.ependymal_cutout_fully_ordered_inference import dataset + +dataset = replace( + dataset, + path="/projects/static2dynamic/datasets/ependymal/prepared_dataset_crop", + path_to_single_parquet="/projects/static2dynamic/datasets/ependymal/ependymal_cutout__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet", +) diff --git a/cell_cycle/my_conf/dataset/ependymal_cutout/ependymal_cutout_inference.py b/cell_cycle/my_conf/dataset/ependymal_cutout/ependymal_cutout_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..3458d8b0f72c8fc1042d2fcc4feb2b64bb96ece2 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/dataset/imagenet_n01917289_hard_aug_inference.py b/cell_cycle/my_conf/dataset/imagenet_n01917289_hard_aug_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..5092fe7e19d910949c4816bd99d0a8b5a9531d81 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/hydra/job_logging/custom.yaml b/cell_cycle/my_conf/hydra/job_logging/custom.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a0351b01adac5db3c464d4990751266af706f6c6 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/my_dataset_ordering_conf.py b/cell_cycle/my_conf/my_dataset_ordering_conf.py new file mode 100644 index 0000000000000000000000000000000000000000..25ced26629146de66a06f3a5939d0de2d0c98dae --- /dev/null +++ b/cell_cycle/my_conf/my_dataset_ordering_conf.py @@ -0,0 +1,63 @@ +import random +from pathlib import Path + +from scripts.dataset_ordering import Params + +################################################################################################################### +#################################################### Datasets ##################################################### +################################################################################################################### +# Attention: we *might or might not* use our datasets' pipeline as DINO has its own preprocessing pipeline. +# isort: off +from my_conf.dataset.diabetic_retinopathy.diabetic_retinopathy_full_circle_augs_2048_precrop_inference import dataset + +# remove more and more trajs from train set +# # Biotine +# NB_FULL_TRAJS_TO_REMOVE = (12, 24, 48, 72, 96) (10% 20% 40% 60% 80%) +# all_trajectories = [ # 120 big videos in total +# f"{row}_{col}_fld_{field}" +# for row in ("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O") +# for col in (13, 14) +# for field in (1, 2, 3, 4) +# ] +# ChromaLive +# all_trajectories = [ # 120 big videos in total +# f"{well}-{dose}_F{field}" +# for well in ("C", "D", "E") +# for dose in ("02", "03", "04", "05", "06", "07", "08", "09", "10", "11") +# for field in ("0001", "0002", "0003", "0004") +# ] +# sel_common_trajs = r"|".join(random.sample(all_trajectories, 6)) +# times_to_remove = ( +# # (), +# # (2, 4, 6, 8, 10, 12), +# # (2, 3, 5, 6, 8, 9, 11, 12), +# # (2, 3, 4, 6, 7, 8, 10, 11, 12), +# (2, 3, 4, 5, 7, 8, 9, 10, 12, 13), +# ) +# test_regex_list = [ +# sel_common_trajs + "".join(f"|time_{t}" for t in times_to_remove[i]) for i in range(len(times_to_remove)) +# ] + +base_save_dir = Path("/projects/static2dynamic/Thomas/ordering_datasets") +# fmt: off +params = Params( + base_save_dir = base_save_dir, + # experiment_names = [], + datasets = [dataset], + device = "cuda:3", + model_name = "facebook/dinov2-with-registers-giant", + batch_size = 512, + use_model_preprocessor = False, + recompute_encodings = "no-overwrite", + save_policy = "ask-before-overwrite", + seed = random.randint(0, 2**32 - 1), + spline_continuation_range = 0.1, + nb_times_spline_eval = 50_000, + test_split_frac = 0.1, + test_regexes = None, + spline_bc_type = "natural", + concatenate_train_test = True, + times_spacing_method = "centroids_distance", + # precomputed_encodings_path = base_save_dir / "facebook_dinov2-with-registers-giant_dataset_preproc" / "diabetic_retinopathy" / "facebook_dinov2-with-registers-giant_dataset_preproc_encodings.parquet", +) +# fmt: on diff --git a/cell_cycle/my_conf/my_inference_conf.py b/cell_cycle/my_conf/my_inference_conf.py new file mode 100644 index 0000000000000000000000000000000000000000..7187a7c85f375ce09e200f39c2f6fde857a3b4b3 --- /dev/null +++ b/cell_cycle/my_conf/my_inference_conf.py @@ -0,0 +1,97 @@ +# ruff: noqa: F401 + +from pathlib import Path + +from diffusers.schedulers.scheduling_dpmsolver_sde import DPMSolverSDEScheduler +from torch import bfloat16, float16, float32 + +from GaussianProxy.conf.inference_conf import InferenceConfig, ProfileConfig +from GaussianProxy.conf.training_conf import ( + EvaluationStrategy, + ForwardNoising, + ForwardNoisingLinearScaling, + InversionRegenerationOnly, + InvertedRegeneration, + IterativeInvertedRegeneration, + MetricsComputation, + SimilarityWithTrainData, + SimpleGeneration, + VideoGenerationFromNoise, +) + +# -------------------------------------------- Dataset -------------------------------------------- +from my_conf.dataset.biotine.biotine_png_128_fully_ordered_inference import dataset + +# --------------------------------------------- Model --------------------------------------------- +root_experiments_path = Path("/", "projects", "static2dynamic", "Thomas", "experiments") +project_name = "GaussianProxy_v3" +folder_name = dataset.name.removesuffix("_fully_ordered").removesuffix("_separate_gt") + "_JZ_download" +run_path = root_experiments_path / project_name / folder_name +assert run_path.exists(), f"'{run_path}' does not exist" + +# ------------------------------------------ Evaluations ------------------------------------------ +selected_times = Path( + "/projects/static2dynamic/datasets/biotine/3_channels_min_99_perc_normalized_rgb_stacks_png", + "times_above_threshold=100_nbins=100.pickle", +) +assert selected_times.exists(), f"'{selected_times}' does not exist" + +# fmt: off +eval_strats = [ + InvertedRegeneration( + nb_inversion_diffusion_timesteps = 10, + nb_diffusion_timesteps = 20, + nb_video_timesteps = 10, + nb_video_times_in_parallel = 2, + nb_generated_samples = 64, + n_rows_displayed = 8, + selected_times = selected_times, + plate_name_to_simulate = "A_13_fld_2", + ), +] +# fmt: on + +for eval_strat in eval_strats: + if eval_strat.selected_times is not None: + eval_strat.name += f"_DPMSolverSDE_{selected_times.stem}" + +# ------------------------------------------ Profiling -------------------------------------------- +# fmt: off +profile_conf = ProfileConfig( + enabled = False, + record_shapes = False, + profile_memory = True, + with_stack = True, + with_flops = False, + export_chrome_trace = False, +) + +# ------------------------------------------ Final Config ----------------------------------------- +inference_conf = InferenceConfig( + # Choose the experiment (== trained model weights) + root_experiments_path = root_experiments_path, + project_name = project_name, + run_name = folder_name, + saved_model_foldername = "saved_model", + # Choose a custom scheduler + scheduler_type = DPMSolverSDEScheduler, + scheduler_config_path = None, + import_orig_config = True, + # Output directory (where to put the generated images / tensors) + output_dir = run_path / "inferences", + # Device + device = "cuda:2", + # Optimizations + compile = False, + dtype = float16, + # Data + dataset = dataset, + # Evaluations + evaluation_strategies = eval_strats, # type: ignore[reportArgumentType] + # Profiling + profiling = profile_conf, + # Debug + debug = False, + # Temp Dir + tmpdir_location = "/localtmp/tboyer/.tmpdir", +) diff --git a/cell_cycle/my_conf/my_training_conf.py b/cell_cycle/my_conf/my_training_conf.py new file mode 100644 index 0000000000000000000000000000000000000000..516c89c3f75380bfc69648a4b1cabf11ca8436f6 --- /dev/null +++ b/cell_cycle/my_conf/my_training_conf.py @@ -0,0 +1,199 @@ +from pathlib import Path + +from omegaconf import MISSING + +################################################################################################### +############################################ Base conf ############################################ +################################################################################################### +# These are generic classes that need full instantiation +from GaussianProxy.conf.training_conf import ( + Accelerate, + AccelerateLaunchArgs, + Checkpointing, + Config, + DataLoader, + DDIMSchedulerConfig, + Evaluation, + ForwardNoising, # noqa: F401 + InvertedRegeneration, # noqa: F401 + IterativeInvertedRegeneration, # noqa: F401 + LinearLRConfig, # noqa: F401 + MetricsComputation, # noqa: F401 + OneCycleLRConfig, # noqa: F401 + SimilarityWithTrainData, # noqa: F401 + SimpleGeneration, # noqa: F401 + Slurm, + Training, +) + +################################################################################################### +########################################## Defaults conf ########################################## +################################################################################################### +defaults = [ + {"dataset": "BBBC048/bbbc048"}, + "hydra/job_logging/custom", + "_self_", +] +# fmt: off + +# ------------------------------------------- Job launch ------------------------------------------ +slurm = Slurm( + enabled = False, + monitor = False, + account = "icr@a100", + partition = "a100", + constraint = "a100", + qos = "dev", + nodes = 1, + num_gpus = 8, + max_num_requeue = 3, + output_folder = "${hydra:run.dir}", + email = "tboyer@bio.ens.psl.eu", +) + +accelerate_launch_args = AccelerateLaunchArgs( + machine_rank = 0, + num_machines = 1, + gpu_ids = "3,", + rdzv_backend = "static", + same_network = "true", + mixed_precision = "bf16", + num_processes = 1, + main_process_port = 29501, + dynamo_backend = "inductor", +) + +accelerate = Accelerate( + launch_args = accelerate_launch_args, + offline = False, # TODO: move this arg that does not belong here (make it general like debug) +) + +# ---------------------------------------------- Data --------------------------------------------- +data_loader = DataLoader( + num_workers = 4, + train_prefetch_factor = 4, + pin_memory = True, + persistent_workers = True, +) + +# -------------------------------------------- Training ------------------------------------------- +training = Training( + gradient_accumulation_steps = 1, + train_batch_size = 256, + max_grad_norm = 1, + nb_time_samplings = 100_000, + unpaired_data = False, + as_many_samples_as_unpaired = False, + reweight_sampling = False, +) + +checkpointing = Checkpointing( + checkpoints_total_limit = 3, + resume_from_checkpoint = True, + checkpoint_every_n_steps = 5000, + chckpt_base_path = Path("/localtmp/tboyer/static2dynamic"), +) + +lr_scheduler = OneCycleLRConfig( + max_lr = 1e-3, +) + +# ------------------------------------------- Evaluation ------------------------------------------ +# naming convention is lowercase + underscore; has to be respected for debug args modification +metrics_compute = MetricsComputation( + nb_samples_to_gen_per_time = "adapt", + batch_size = 256, + nb_diffusion_timesteps = 50, + selected_times = ["G1", "S", "G2", "Prophase", "Metaphase", "Anaphase", "Telophase"], + augmentations_for_metrics_comp = [], + also_compute_metrics_on_all_times = False, + dtype = "bfloat16", +) + +simple_generation = SimpleGeneration( + nb_diffusion_timesteps = 50, + n_rows_displayed = 4, # TODO: merge training & evaluation configs + nb_generated_samples = 16, # TODO: merge training & evaluation configs +) + +inverted_regeneration = InvertedRegeneration( + nb_diffusion_timesteps = 50, + nb_inversion_diffusion_timesteps = 100, + n_rows_displayed = 8, # TODO: not used in training! + nb_generated_samples = 16, + nb_video_times_in_parallel = 4, # TODO: not used in training! + nb_video_timesteps = 50, +) + +sim_with_train = SimilarityWithTrainData( # must be put after metrics_compute! + nb_generated_samples = -1, # TODO: not used + batch_size = 4096, + nb_batches_shown = -1, # TODO: not used + n_rows_displayed = -1, # TODO: not used + nb_diffusion_timesteps = -1, # TODO: not used +) + +evaluation = Evaluation( + every_n_opt_steps = 10_000, + batch_size = 16, # TODO: remove this and use config from above + nb_video_timesteps = 50, # TODO: remove this and use config from above + strategies = [simple_generation, inverted_regeneration, metrics_compute, sim_with_train], +) + +# ------------------------------------------- Diffusion ------------------------------------------- +dynamic = DDIMSchedulerConfig( + num_train_timesteps = 3000, + clip_sample = False, + clip_sample_range = 1, + thresholding = True, + sample_max_value = 1, + prediction_type = "v_prediction", + rescale_betas_zero_snr = False, + timestep_spacing = "leading", +) + +# ---------------------------------------------- Model -------------------------------------------- +from my_conf.net.net_48_1 import net, time_encoder # noqa: E402 + +# ------------------------------------------ Final Config ----------------------------------------- +config = Config( + # defaults + defaults = defaults, + # model + dynamic = dynamic, + net = net, + time_encoder = time_encoder, + # script + launcher_script_parent_folder = "/workspaces/biocomp/tboyer/sources/GaussianProxy", + script = "train", + # experiment variables + exp_parent_folder = "/projects/static2dynamic/Thomas/experiments", + project = MISSING, + run_name = MISSING, + # hydra + hydra = {"run": {"dir": "${exp_parent_folder}/${project}/${run_name}"}}, + # slurm + slurm = slurm, + # accelerate + accelerate = accelerate, + # misc. + debug = False, + profile = False, + tmpdir_location = "/localtmp/tboyer/.tmpdir", + # experiment tracker + logger = "wandb", + entity = "thomasboyer", + resume_method = "new_run", + # checkpointing + checkpointing = checkpointing, + # dataset + dataset = MISSING, + # dataloaders + dataloaders = data_loader, + # training + training = training, + # evaluation + evaluation = evaluation, + # optimizer + lr_scheduler = lr_scheduler, +) diff --git a/cell_cycle/my_conf/net/net_128_3.py b/cell_cycle/my_conf/net/net_128_3.py new file mode 100644 index 0000000000000000000000000000000000000000..994280ed4d0a7e6e1410e51f2b058157fb17c962 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/net/net_128_3_big.py b/cell_cycle/my_conf/net/net_128_3_big.py new file mode 100644 index 0000000000000000000000000000000000000000..9a12e57ccfc47d7fd0a9ac9cf3647764361adac7 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/net/net_128_4.py b/cell_cycle/my_conf/net/net_128_4.py new file mode 100644 index 0000000000000000000000000000000000000000..0dd136ffaff1c94858ad50bb075d780b7a49bc86 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/net/net_196_3_11M.py b/cell_cycle/my_conf/net/net_196_3_11M.py new file mode 100644 index 0000000000000000000000000000000000000000..e13a50b93f46f33a9a15b3d39525646609e41cb2 --- /dev/null +++ b/cell_cycle/my_conf/net/net_196_3_11M.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=(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/cell_cycle/my_conf/net/net_196_3_12M.py b/cell_cycle/my_conf/net/net_196_3_12M.py new file mode 100644 index 0000000000000000000000000000000000000000..83fa0274707bdde54fd0e1141deec96f779b5393 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/net/net_196_3_4M.py b/cell_cycle/my_conf/net/net_196_3_4M.py new file mode 100644 index 0000000000000000000000000000000000000000..1f099e27892046be5f1559b9e05032a8469d815d --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/net/net_256_3_20M.py b/cell_cycle/my_conf/net/net_256_3_20M.py new file mode 100644 index 0000000000000000000000000000000000000000..af270af831f48c45847a38cb3714d32033855957 --- /dev/null +++ b/cell_cycle/my_conf/net/net_256_3_20M.py @@ -0,0 +1,22 @@ +from GaussianProxy.conf.training_conf import UNet2DConditionModelConfig, TimeEncoderConfig + +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=(64, 128, 224), + 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/cell_cycle/my_conf/net/net_256_3_6M.py b/cell_cycle/my_conf/net/net_256_3_6M.py new file mode 100644 index 0000000000000000000000000000000000000000..96a31d7fa08df8eb436f02c98b53cb154ac10585 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/net/net_256_3_8M.py b/cell_cycle/my_conf/net/net_256_3_8M.py new file mode 100644 index 0000000000000000000000000000000000000000..aaf714c9366c83c288206d012341f1f68c49a302 --- /dev/null +++ b/cell_cycle/my_conf/net/net_256_3_8M.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=(64, 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/cell_cycle/my_conf/net/net_48_1.py b/cell_cycle/my_conf/net/net_48_1.py new file mode 100644 index 0000000000000000000000000000000000000000..df3328413ffc47ff49eb7860ee153939a7fccc22 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/net/net_66_1.py b/cell_cycle/my_conf/net/net_66_1.py new file mode 100644 index 0000000000000000000000000000000000000000..0e2344c593b081433a24dadf810f9451c59ead8e --- /dev/null +++ b/cell_cycle/my_conf/net/net_66_1.py @@ -0,0 +1,23 @@ +from GaussianProxy.conf.training_conf import TimeEncoderConfig, UNet2DConditionModelConfig + +cross_attn_dim = 32 + +net = UNet2DConditionModelConfig( + sample_size=66, + in_channels=1, + out_channels=1, + down_block_types=("DownBlock2D", "CrossAttnDownBlock2D", "CrossAttnDownBlock2D"), + up_block_types=("CrossAttnUpBlock2D", "CrossAttnUpBlock2D", "UpBlock2D"), + 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/cell_cycle/my_conf/net/net_66_3_2M.py b/cell_cycle/my_conf/net/net_66_3_2M.py new file mode 100644 index 0000000000000000000000000000000000000000..43f1f32ac81b719f3be41e19ea2d0e1eaeed5477 --- /dev/null +++ b/cell_cycle/my_conf/net/net_66_3_2M.py @@ -0,0 +1,23 @@ +from GaussianProxy.conf.training_conf import UNet2DConditionModelConfig, TimeEncoderConfig + +cross_attn_dim = 64 + +net = UNet2DConditionModelConfig( + sample_size=66, + in_channels=3, + out_channels=3, + down_block_types=("DownBlock2D", "CrossAttnDownBlock2D", "CrossAttnDownBlock2D"), + up_block_types=("CrossAttnUpBlock2D", "CrossAttnUpBlock2D", "UpBlock2D"), + block_out_channels=(24, 40, 72), + norm_num_groups=8, + 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/cell_cycle/my_conf/net/net_Jurkat.py b/cell_cycle/my_conf/net/net_Jurkat.py new file mode 100644 index 0000000000000000000000000000000000000000..d2caa03e0745f70db79d5cf5b15f5033b43c2300 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/net/net_diabetic_retinopathy.py b/cell_cycle/my_conf/net/net_diabetic_retinopathy.py new file mode 100644 index 0000000000000000000000000000000000000000..deff587c95295fd429062a9ffd3e280a8530e92d --- /dev/null +++ b/cell_cycle/my_conf/net/net_diabetic_retinopathy.py @@ -0,0 +1,22 @@ +from GaussianProxy.conf.training_conf import UNet2DConditionModelConfig, TimeEncoderConfig + +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=(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/cell_cycle/my_conf/scheduler/DDIM_3k_vpred_tresh_SNR_trailing.json b/cell_cycle/my_conf/scheduler/DDIM_3k_vpred_tresh_SNR_trailing.json new file mode 100644 index 0000000000000000000000000000000000000000..f7994596907c2a827c8d9941c86adb19ed8e43f2 --- /dev/null +++ b/cell_cycle/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/cell_cycle/my_conf/scheduler/DDIM_3k_vpred_tresh_leading.json b/cell_cycle/my_conf/scheduler/DDIM_3k_vpred_tresh_leading.json new file mode 100644 index 0000000000000000000000000000000000000000..5ad012575a06c66b4dfe590012c318cf4712f09f --- /dev/null +++ b/cell_cycle/my_conf/scheduler/DDIM_3k_vpred_tresh_leading.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": false, + "sample_max_value": 1.0, + "set_alpha_to_one": true, + "steps_offset": 0, + "thresholding": true, + "timestep_spacing": "leading", + "trained_betas": null +} \ No newline at end of file diff --git a/cell_cycle/net/config.json b/cell_cycle/net/config.json new file mode 100644 index 0000000000000000000000000000000000000000..2ef3c464da1680fee476bad81e582c39b032d543 --- /dev/null +++ b/cell_cycle/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": [ + 16, + 32, + 64 + ], + "center_input_sample": false, + "class_embed_type": null, + "class_embeddings_concat": false, + "conv_in_kernel": 3, + "conv_out_kernel": 3, + "cross_attention_dim": 32, + "cross_attention_norm": null, + "down_block_types": [ + "CrossAttnDownBlock2D", + "CrossAttnDownBlock2D", + "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": 1, + "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": 8, + "num_attention_heads": null, + "num_class_embeds": null, + "only_cross_attention": false, + "out_channels": 1, + "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": 48, + "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", + "CrossAttnUpBlock2D", + "CrossAttnUpBlock2D" + ], + "upcast_attention": false, + "use_linear_projection": false +} diff --git a/cell_cycle/net/diffusion_pytorch_model.safetensors b/cell_cycle/net/diffusion_pytorch_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..f58472a9bf0854456cf1ecf0063e066b1cfe872f --- /dev/null +++ b/cell_cycle/net/diffusion_pytorch_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fbe7fd70248b2e1c8a0ec41e18544c7834993f85d90aec01d5209d0dcbf3c89f +size 6316940 diff --git a/cell_cycle/video_time_encoder/config.json b/cell_cycle/video_time_encoder/config.json new file mode 100644 index 0000000000000000000000000000000000000000..0aa3fbd288b1b197a45056ad24c11b7abc525210 --- /dev/null +++ b/cell_cycle/video_time_encoder/config.json @@ -0,0 +1,8 @@ +{ + "_class_name": "VideoTimeEncoding", + "_diffusers_version": "0.35.2", + "downscale_freq_shift": 1.0, + "encoding_dim": 64, + "flip_sin_to_cos": true, + "time_embed_dim": 32 +} diff --git a/cell_cycle/video_time_encoder/diffusion_pytorch_model.safetensors b/cell_cycle/video_time_encoder/diffusion_pytorch_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..e809508b3dc57d13fe4260c71e340111df926641 --- /dev/null +++ b/cell_cycle/video_time_encoder/diffusion_pytorch_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:44fe99e6965e421fd0e92024ba2d01a71e039e8f20eacf4ce72ef2727daccf6b +size 12984 diff --git a/chromalive/net/diffusion_pytorch_model.safetensors b/chromalive/net/diffusion_pytorch_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..7e0982626a9d9a36be5cb977b27817f75e1bc78f --- /dev/null +++ b/chromalive/net/diffusion_pytorch_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:acbafb29af4bb0f3a6c833ca265d3bd1df117f1a3d9a281c6867f0cd9408689c +size 97782492 diff --git a/chromalive/video_time_encoder/diffusion_pytorch_model.safetensors b/chromalive/video_time_encoder/diffusion_pytorch_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..d520e585bb5f8c495178721c22515f469ea2346c --- /dev/null +++ b/chromalive/video_time_encoder/diffusion_pytorch_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9594fb1a58fb3a09abf42a3686eb795475c0bc15db0c6c0813832bbc871a75e6 +size 50104 diff --git a/diabetic_retinopathy/net/diffusion_pytorch_model.safetensors b/diabetic_retinopathy/net/diffusion_pytorch_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..d46e363414f70ee3904d42ad913daf9fc849153f --- /dev/null +++ b/diabetic_retinopathy/net/diffusion_pytorch_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bcb1194825f573c8b00c42ed454928f6dce01e352ea04ebe5a9d24c36855de26 +size 22534196 diff --git a/diabetic_retinopathy/video_time_encoder/diffusion_pytorch_model.safetensors b/diabetic_retinopathy/video_time_encoder/diffusion_pytorch_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..cfe6edd9a1480160f5a2e1634487cadb9fad26bc --- /dev/null +++ b/diabetic_retinopathy/video_time_encoder/diffusion_pytorch_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f04e51f593899ad4c0f23614615221c812da8638d343de4c7faa62e6aef1271 +size 50104 diff --git a/docetaxel/dynamic/scheduler_config.json b/docetaxel/dynamic/scheduler_config.json new file mode 100644 index 0000000000000000000000000000000000000000..817dc141e488c4ce6d2de8ff710a071f9057bbab --- /dev/null +++ b/docetaxel/dynamic/scheduler_config.json @@ -0,0 +1,19 @@ +{ + "_class_name": "DDIMScheduler", + "_diffusers_version": "0.33.1", + "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": false, + "sample_max_value": 1.0, + "set_alpha_to_one": true, + "steps_offset": 0, + "thresholding": true, + "timestep_spacing": "leading", + "trained_betas": null +} diff --git a/docetaxel/my_conf/dataset/BBBC021/BBBC021_196_DMSO_docetaxel.yaml b/docetaxel/my_conf/dataset/BBBC021/BBBC021_196_DMSO_docetaxel.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fdf54a75447f6740bbab9730af5a70e345193f01 --- /dev/null +++ b/docetaxel/my_conf/dataset/BBBC021/BBBC021_196_DMSO_docetaxel.yaml @@ -0,0 +1,16 @@ +name: BBBC021_196_docetaxel +path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/BBBC021/196x196/docetaxel +data_shape: [3, 196, 196] +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/docetaxel/my_conf/dataset/BBBC021/BBBC021_196_docetaxel.yaml b/docetaxel/my_conf/dataset/BBBC021/BBBC021_196_docetaxel.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fdf54a75447f6740bbab9730af5a70e345193f01 --- /dev/null +++ b/docetaxel/my_conf/dataset/BBBC021/BBBC021_196_docetaxel.yaml @@ -0,0 +1,16 @@ +name: BBBC021_196_docetaxel +path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/BBBC021/196x196/docetaxel +data_shape: [3, 196, 196] +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/docetaxel/my_conf/dataset/BBBC021/BBBC021_196_docetaxel_inference.py b/docetaxel/my_conf/dataset/BBBC021/BBBC021_196_docetaxel_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..95ff8768553ef62ad5d542799cd8d340a1b6d1c0 --- /dev/null +++ b/docetaxel/my_conf/dataset/BBBC021/BBBC021_196_docetaxel_inference.py @@ -0,0 +1,4 @@ +from GaussianProxy.conf.dataset.BBBC021_196_inference import BBBC021_196_inference as BBBC021_196_docetaxel_inference + +BBBC021_196_docetaxel_inference.path = "/lustre/fsn1/projects/rech/icr/ufc43hj/datasets/BBBC021/196x196/docetaxel" +BBBC021_196_docetaxel_inference.name += "_docetaxel" diff --git a/docetaxel/my_conf/dataset/ChromaLive6h/ChromaLive6h_3ch_png_fully_ordered.yaml b/docetaxel/my_conf/dataset/ChromaLive6h/ChromaLive6h_3ch_png_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..192b16ccd121227f6cc53ab2a5b8d68726ced00f --- /dev/null +++ b/docetaxel/my_conf/dataset/ChromaLive6h/ChromaLive6h_3ch_png_fully_ordered.yaml @@ -0,0 +1,21 @@ +name: chromaLive6h_3ch_png_patches_380px_fully_ordered +path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ChromaLive_6hr_4ch/MIP_normalized/patches_380px +path_to_single_parquet: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ChromaLive_6hr_4ch/MIP_normalized/chromaLive6h_3ch_png_patches_380px__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 + - _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: +fully_ordered: true diff --git a/docetaxel/my_conf/dataset/ChromaLive6h/ChromaLive6h_3ch_png_hard_aug.yaml b/docetaxel/my_conf/dataset/ChromaLive6h/ChromaLive6h_3ch_png_hard_aug.yaml new file mode 100644 index 0000000000000000000000000000000000000000..71515cb3816237a88fe5140ee9434a33dd780638 --- /dev/null +++ b/docetaxel/my_conf/dataset/ChromaLive6h/ChromaLive6h_3ch_png_hard_aug.yaml @@ -0,0 +1,16 @@ +name: chromaLive6h_3ch_png_patches_380px_hard_aug +path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/20231017ChromaLive_6hr_4ch/MIP_normalized/paired_dataset/patches_380px_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/docetaxel/my_conf/dataset/Jurkat/Jurkat_inference.py b/docetaxel/my_conf/dataset/Jurkat/Jurkat_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..19eeca252f8c5ada8889f0c325667ccb41f9d904 --- /dev/null +++ b/docetaxel/my_conf/dataset/Jurkat/Jurkat_inference.py @@ -0,0 +1,3 @@ +from GaussianProxy.conf.dataset.Jurkat_inference import Jurkat_inference + +Jurkat_inference.path = "/lustre/fsn1/projects/rech/icr/ufc43hj/datasets/Jurkat/rgb_images_all_cell_cycles" diff --git a/docetaxel/my_conf/dataset/biotine/biotine_png_128_fully_ordered.yaml b/docetaxel/my_conf/dataset/biotine/biotine_png_128_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..718cd8109756d420db2f68a260456b6e8b6ca212 --- /dev/null +++ b/docetaxel/my_conf/dataset/biotine/biotine_png_128_fully_ordered.yaml @@ -0,0 +1,21 @@ +name: biotine_png_fully_ordered +path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/biotine/3_channels_min_99_perc_normalized_rgb_stacks_png/patches_255 +path_to_single_parquet: /lustre/fsn1/projects/rech/icr/ufc43hj/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/docetaxel/my_conf/hydra/job_logging/custom.yaml b/docetaxel/my_conf/hydra/job_logging/custom.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b9e2c72c4ffc16496213000cbc9870eef22ac167 --- /dev/null +++ b/docetaxel/my_conf/hydra/job_logging/custom.yaml @@ -0,0 +1,37 @@ +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.PngImagePlugin: + level: WARNING + PIL: + level: WARNING +disable_existing_loggers: true diff --git a/docetaxel/my_conf/my_inference_conf.py b/docetaxel/my_conf/my_inference_conf.py new file mode 100644 index 0000000000000000000000000000000000000000..9f3bef197a2e14585abf95daf70af6f5a3d97464 --- /dev/null +++ b/docetaxel/my_conf/my_inference_conf.py @@ -0,0 +1,95 @@ +# ruff: noqa: F401 + +from datetime import datetime +from pathlib import Path + +from torch import bfloat16, float16, float32 + +from GaussianProxy.conf.inference_conf import InferenceConfig, ProfileConfig +from GaussianProxy.conf.training_conf import ( + Accelerate, + AccelerateLaunchArgs, + ForwardNoising, + ForwardNoisingLinearScaling, + InversionRegenerationOnly, + InvertedRegeneration, + IterativeInvertedRegeneration, + MetricsComputation, + SimilarityWithTrainData, + SimpleGeneration, + Slurm, +) + +# -------------------------------------------- Dataset -------------------------------------------- +from my_conf.dataset.biotine_png_128_inference import dataset + +# --------------------------------------------- Model --------------------------------------------- +root_experiments_path = Path("/lustre/fsn1/projects/rech/icr/ufc43hj/experiments") +project_name = "GaussianProxy" +run_name = "biotine_all_paired_new_jz" + +# ------------------------------------------ Evaluations ------------------------------------------ +eval_strats = [ + # InvertedRegeneration( + # nb_diffusion_timesteps=100, + # name="InvertedRegeneration_100_diffsteps_no_SNR_leading_f32_J_14_fld_2", + # nb_generated_samples=64, + # plate_name_to_simulate="J_14_fld_2", + # nb_video_times_in_parallel=3, + # nb_video_timesteps=19, + # n_rows_displayed=8, + # ), + MetricsComputation( + nb_samples_to_gen_per_time="adapt aug", + batch_size=512 + 32, + nb_diffusion_timesteps=100, + selected_times=[1, 5, 10, 15, 19], + name="MetricsComputation_100_diffsteps_no_SNR_leading_f32_adapt_aug", + regen_images=False, + ), + # InversionRegenerationOnly( + # nb_diffusion_timesteps=100, + # name="InversionRegenerationOnly_100_diffsteps_no_SNR_leading_f32", + # nb_generated_samples=64, + # plate_name_to_simulate="M_13_fld_3", + # n_rows_displayed=8, + # ) +] + + +# ------------------------------------------ Profiling -------------------------------------------- +# fmt: off +profile_conf = ProfileConfig( + enabled = False, + record_shapes = False, + profile_memory = True, + with_stack = True, + with_flops = False, + export_chrome_trace = False, +) + + +# ------------------------------------------ Final Config ----------------------------------------- +inference_conf = InferenceConfig( + # Choose the experiment (trained model weights) + root_experiments_path = root_experiments_path, + project_name = project_name, + run_name = run_name, + # Choose a custom scheduler + scheduler_config = Path("my_conf", "scheduler", "DDIM_3k_vpred_tresh_leading.json"), + # Output directory (where to put the generated images / tensors) + output_dir = Path(root_experiments_path, project_name, run_name, "inferences"), + # Device + device = "cuda:2", + # Optimizations + compile = True, + dtype = float32, + # Data + dataset = dataset, + # Evaluations + evaluation_strategies = eval_strats, # pyright: ignore[reportArgumentType] + # Profiling + profiling = profile_conf, + # Temp Dir + tmpdir_location = "/tmp", +) diff --git a/docetaxel/my_conf/my_training_conf.py b/docetaxel/my_conf/my_training_conf.py new file mode 100644 index 0000000000000000000000000000000000000000..692b7fedc348bd26789880a56e9e3e9361969e2c --- /dev/null +++ b/docetaxel/my_conf/my_training_conf.py @@ -0,0 +1,194 @@ +from datetime import datetime + +from omegaconf import MISSING + +################################################################################################### +############################################ Base conf ############################################ +################################################################################################### +# These are generic classes that need full instantiation +# pylint: disable=unused-import +from GaussianProxy.conf.training_conf import ( + Accelerate, + AccelerateLaunchArgs, + Checkpointing, + Config, + DataLoader, + DDIMSchedulerConfig, + Evaluation, + ForwardNoising, # noqa: F401 + InvertedRegeneration, # noqa: F401 + IterativeInvertedRegeneration, # noqa: F401 + MetricsComputation, # noqa: F401 + SimilarityWithTrainData, + SimpleGeneration, # noqa: F401 + Slurm, + Training, +) + +# pylint: enable=unused-import + +################################################################################################### +########################################## Defaults conf ########################################## +################################################################################################### +defaults = [ + {"dataset": "BBBC021/BBBC021_196_docetaxel_fully_ordered"}, + "hydra/job_logging/custom", + "_self_", +] + +# fmt: off + +# ------------------------------------------- Job launch ------------------------------------------ +now = datetime.now().strftime("%Y-%m-%d--%H-%M-%S") +slurm = Slurm( + enabled = True, + monitor = False, + account = "icr@h100", + partition = None, + constraint = "h100", + qos = "t3", + nodes = 1, + num_gpus = 4, + max_num_requeue = 4, + total_job_time = 20 * 60, + output_folder = "${hydra:run.dir}" + f"/{now}_%j", + email = "tboyer@bio.ens.psl.eu", + job_launch_delay = None, +) + +accelerate_launch_args = AccelerateLaunchArgs( + machine_rank = 0, + num_machines = 1, + gpu_ids = "all", + rdzv_backend = "static", + same_network = "true", + mixed_precision = "bf16", + num_processes = slurm.num_gpus, + main_process_port = 29503, + dynamo_backend = "no", +) + +accelerate = Accelerate( + launch_args = accelerate_launch_args, + offline = True, +) + +# ---------------------------------------------- Data --------------------------------------------- +data_loader = DataLoader( + num_workers = 4, + train_prefetch_factor = 4, + pin_memory = True, + persistent_workers = True, +) + +# -------------------------------------------- Training ------------------------------------------- +training = Training( + gradient_accumulation_steps = 1, + train_batch_size = 16 + 8, + max_grad_norm = 1, + nb_time_samplings = 1_000_000, + unpaired_data = False, +) + +checkpointing = Checkpointing( + checkpoints_total_limit = 3, + resume_from_checkpoint = True, + checkpoint_every_n_steps = 5000, + chckpt_base_path = MISSING, +) + +# ------------------------------------------- Evaluation ------------------------------------------ +# naming convention is lowercase + underscore; has to be respected for debug args modification +metrics_compute = MetricsComputation( + nb_samples_to_gen_per_time = "adapt half aug", + batch_size = 512 - 64, + nb_diffusion_timesteps = 50, + selected_times = ["0.0003", "0.001", "0.003", "0.01", "0.03", "0.1", "0.3", "1.0"], + augmentations_for_metrics_comp = ["RandomHorizontalFlip", "RandomVerticalFlip", "RandomRotationSquareSymmetry"], +) + +simple_generation = SimpleGeneration( + nb_diffusion_timesteps = 50, + n_rows_displayed = 4, # TODO: merge training & evaluation configs + nb_generated_samples = 16, # TODO: merge training & evaluation configs +) + +inverted_regeneration = InvertedRegeneration( + nb_diffusion_timesteps = 50, + n_rows_displayed = 8, # TODO: merge training & evaluation configs + nb_generated_samples = 16, # TODO: merge training & evaluation configs + nb_video_times_in_parallel = 8, # TODO: merge training & evaluation configs TODO: not used in training! + nb_video_timesteps = 50, # TODO: merge training & evaluation configs +) + +sim_with_train = SimilarityWithTrainData( # must be put after metrics_compute! + nb_generated_samples = -1, # TODO: not used + batch_size = 2048, + nb_batches_shown = -1, # TODO: not used + n_rows_displayed = -1, # TODO: not used + nb_diffusion_timesteps = -1, # TODO: not used +) + +evaluation = Evaluation( + every_n_opt_steps = 25_000, + batch_size = 16, # TODO: remove this and use config from above + nb_video_timesteps = 50, # TODO: remove this and use config from above + strategies = [simple_generation, inverted_regeneration, metrics_compute, sim_with_train], +) + +# ------------------------------------------- Diffusion ------------------------------------------- +dynamic = DDIMSchedulerConfig( + num_train_timesteps = 3000, + clip_sample = False, + clip_sample_range = 1, + thresholding = True, + sample_max_value = 1, + prediction_type = "v_prediction", + rescale_betas_zero_snr = False, + timestep_spacing = "leading", +) + +# ---------------------------------------------- Model -------------------------------------------- +from my_conf.net.net_196_3_12M import net, time_encoder # noqa: E402 + +# ------------------------------------------ Final Config ----------------------------------------- +config = Config( + # defaults + defaults = defaults, + # model + dynamic = dynamic, + net = net, + time_encoder = time_encoder, + # script + launcher_script_parent_folder = "/linkhome/rech/genlxz01/ufc43hj/sources/GaussianProxy", + script = "train", + # experiment variables + exp_parent_folder = "/lustre/fsn1/projects/rech/icr/ufc43hj/experiments", + project = MISSING, + run_name = MISSING, + # hydra + hydra = {"run": {"dir": "${exp_parent_folder}/${project}/${run_name}"}}, + # slurm + slurm = slurm, + # accelerate + accelerate = accelerate, + # misc. + debug = False, + profile = False, + tmpdir_location = None, + # experiment tracker + logger = "wandb", + entity = "thomasboyer", + # checkpointing + checkpointing = checkpointing, + # dataset + dataset = MISSING, + # dataloaders + dataloaders = data_loader, + # training + training = training, + # evaluation + evaluation = evaluation, + # optimizer + learning_rate = 1e-4, +) diff --git a/docetaxel/my_conf/net/net_128_3.py b/docetaxel/my_conf/net/net_128_3.py new file mode 100644 index 0000000000000000000000000000000000000000..994280ed4d0a7e6e1410e51f2b058157fb17c962 --- /dev/null +++ b/docetaxel/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/docetaxel/my_conf/net/net_128_3_big.py b/docetaxel/my_conf/net/net_128_3_big.py new file mode 100644 index 0000000000000000000000000000000000000000..9a12e57ccfc47d7fd0a9ac9cf3647764361adac7 --- /dev/null +++ b/docetaxel/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/docetaxel/my_conf/net/net_196_3_12M.py b/docetaxel/my_conf/net/net_196_3_12M.py new file mode 100644 index 0000000000000000000000000000000000000000..83fa0274707bdde54fd0e1141deec96f779b5393 --- /dev/null +++ b/docetaxel/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/docetaxel/my_conf/net/net_66_3_2M.py b/docetaxel/my_conf/net/net_66_3_2M.py new file mode 100644 index 0000000000000000000000000000000000000000..43f1f32ac81b719f3be41e19ea2d0e1eaeed5477 --- /dev/null +++ b/docetaxel/my_conf/net/net_66_3_2M.py @@ -0,0 +1,23 @@ +from GaussianProxy.conf.training_conf import UNet2DConditionModelConfig, TimeEncoderConfig + +cross_attn_dim = 64 + +net = UNet2DConditionModelConfig( + sample_size=66, + in_channels=3, + out_channels=3, + down_block_types=("DownBlock2D", "CrossAttnDownBlock2D", "CrossAttnDownBlock2D"), + up_block_types=("CrossAttnUpBlock2D", "CrossAttnUpBlock2D", "UpBlock2D"), + block_out_channels=(24, 40, 72), + norm_num_groups=8, + 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/docetaxel/net/config.json b/docetaxel/net/config.json new file mode 100644 index 0000000000000000000000000000000000000000..777f1d7c3dcb5a763962b308d7c8455a2a26398e --- /dev/null +++ b/docetaxel/net/config.json @@ -0,0 +1,64 @@ +{ + "_class_name": "UNet2DConditionModel", + "_diffusers_version": "0.33.1", + "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": [ + 96, + 128, + 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": [ + "CrossAttnDownBlock2D", + "CrossAttnDownBlock2D", + "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": 196, + "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", + "CrossAttnUpBlock2D", + "CrossAttnUpBlock2D" + ], + "upcast_attention": false, + "use_linear_projection": false +} diff --git a/docetaxel/net/diffusion_pytorch_model.safetensors b/docetaxel/net/diffusion_pytorch_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..8da5a43bf430317a784cdb2d20bc90e63badefeb --- /dev/null +++ b/docetaxel/net/diffusion_pytorch_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fcb1e964a04f6c7ac30f16dcd748dacfb20fa0ac756d14a9bd9839a37091fc9d +size 48211124 diff --git a/docetaxel/video_time_encoder/config.json b/docetaxel/video_time_encoder/config.json new file mode 100644 index 0000000000000000000000000000000000000000..cd613a1113b6ed4da3b7a29267a8d8798d07b6b5 --- /dev/null +++ b/docetaxel/video_time_encoder/config.json @@ -0,0 +1,8 @@ +{ + "_class_name": "VideoTimeEncoding", + "_diffusers_version": "0.33.1", + "downscale_freq_shift": 1.0, + "encoding_dim": 128, + "flip_sin_to_cos": true, + "time_embed_dim": 64 +} diff --git a/docetaxel/video_time_encoder/diffusion_pytorch_model.safetensors b/docetaxel/video_time_encoder/diffusion_pytorch_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..d3031f8d689d7ec9547a29e06695c7e9d1ba8da1 --- /dev/null +++ b/docetaxel/video_time_encoder/diffusion_pytorch_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d2d066707a198d889661b770ec2014d02de3b63fd1cc7b3aef022601c439e439 +size 50104 diff --git a/docetaxel_skip_half_doses/net/diffusion_pytorch_model.safetensors b/docetaxel_skip_half_doses/net/diffusion_pytorch_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..096ebc68c92e7de68ea004cc5dea24bdf633a621 --- /dev/null +++ b/docetaxel_skip_half_doses/net/diffusion_pytorch_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98bbbf6bb92c0c96ad83175d082ed49ab299fc5d89eb02f3cd889f9cca0b69b6 +size 48211124 diff --git a/docetaxel_skip_half_doses/video_time_encoder/diffusion_pytorch_model.safetensors b/docetaxel_skip_half_doses/video_time_encoder/diffusion_pytorch_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..92434ba198fdb8da4c88757a3e607abd6f018af6 --- /dev/null +++ b/docetaxel_skip_half_doses/video_time_encoder/diffusion_pytorch_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f7e41fabb6dd524b89bd39be84f588da829870539b9fb307f365acbf205cceb +size 50104 diff --git a/ependymal/net/diffusion_pytorch_model.safetensors b/ependymal/net/diffusion_pytorch_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..ee004d71eef17a486de64591263a8d7b7d09f2c6 --- /dev/null +++ b/ependymal/net/diffusion_pytorch_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8db44851946b7785b517482a0b9959b6021f17beda57f91a54696cb38d83b3ba +size 32597300 diff --git a/ependymal/video_time_encoder/diffusion_pytorch_model.safetensors b/ependymal/video_time_encoder/diffusion_pytorch_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..18b1ddcf05735e6cd5924eb3fd7b7eeeb7b18ddd --- /dev/null +++ b/ependymal/video_time_encoder/diffusion_pytorch_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9f272d9aff8ce6f8c5c2f947e601c80f1dcb61aa6a5c6999328770c3bae4d11 +size 50104 diff --git a/nocodazole/my_conf/dataset/NASH_fibrosis/NASH_fibrosis_fully_ordered.yaml b/nocodazole/my_conf/dataset/NASH_fibrosis/NASH_fibrosis_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9474dcf3c5335e05cdf8207eb4423adcffd99820 --- /dev/null +++ b/nocodazole/my_conf/dataset/NASH_fibrosis/NASH_fibrosis_fully_ordered.yaml @@ -0,0 +1,26 @@ +name: NASH_fibrosis_fully_ordered_dinov2_regs_giant_ds_preproc +path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/NASH/fibrosis +path_to_single_parquet: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/NASH/NASH_fibrosis__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/nocodazole/my_conf/dataset/NASH_steatosis/NASH_steatosis_fully_ordered.yaml b/nocodazole/my_conf/dataset/NASH_steatosis/NASH_steatosis_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ae97d5fc908ae875341f041200f043b1d9d7bbe9 --- /dev/null +++ b/nocodazole/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: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/NASH/steatosis +path_to_single_parquet: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/NASH/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/nocodazole/my_conf/dataset/NASH_steatosis/NASH_steatosis_inference.py b/nocodazole/my_conf/dataset/NASH_steatosis/NASH_steatosis_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..3e207e12dc770568032eb1992d143e7eb564b44e --- /dev/null +++ b/nocodazole/my_conf/dataset/NASH_steatosis/NASH_steatosis_inference.py @@ -0,0 +1,3 @@ +from GaussianProxy.conf.dataset.NASH_steatosis_inference import dataset + +dataset.path = "/lustre/fsn1/projects/rech/icr/ufc43hj/datasets/NASH/prepared_data/steatosis" diff --git a/nocodazole/my_conf/dataset/biotine/biotine_png_128_fully_ordered.yaml b/nocodazole/my_conf/dataset/biotine/biotine_png_128_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..718cd8109756d420db2f68a260456b6e8b6ca212 --- /dev/null +++ b/nocodazole/my_conf/dataset/biotine/biotine_png_128_fully_ordered.yaml @@ -0,0 +1,21 @@ +name: biotine_png_fully_ordered +path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/biotine/3_channels_min_99_perc_normalized_rgb_stacks_png/patches_255 +path_to_single_parquet: /lustre/fsn1/projects/rech/icr/ufc43hj/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/nocodazole/my_conf/dataset/biotine/biotine_png_128_hard_aug.yaml b/nocodazole/my_conf/dataset/biotine/biotine_png_128_hard_aug.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bbd84e2dde4866013cc8cdd8515270628d0f86a2 --- /dev/null +++ b/nocodazole/my_conf/dataset/biotine/biotine_png_128_hard_aug.yaml @@ -0,0 +1,16 @@ +name: biotine_png_hard_aug +path: /lustre/fsn1/projects/rech/icr/ufc43hj/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/nocodazole/my_conf/dataset/biotine/biotine_png_128_hard_aug_inference.py b/nocodazole/my_conf/dataset/biotine/biotine_png_128_hard_aug_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..d546786791e75b12658ccdb804f9e32b2352c308 --- /dev/null +++ b/nocodazole/my_conf/dataset/biotine/biotine_png_128_hard_aug_inference.py @@ -0,0 +1,3 @@ +from GaussianProxy.conf.dataset.biotine_png_128_hard_aug_inference import dataset + +dataset.path = "/lustre/fsn1/projects/rech/icr/ufc43hj/datasets/biotine/3_channels_min_99_perc_normalized_rgb_stacks_png/patches_255_hard_augmented" diff --git a/nocodazole/my_conf/dataset/biotine/biotine_png_128_inference.py b/nocodazole/my_conf/dataset/biotine/biotine_png_128_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..0e75f3876aa2a2ed9cda852482564d283a0940a1 --- /dev/null +++ b/nocodazole/my_conf/dataset/biotine/biotine_png_128_inference.py @@ -0,0 +1,3 @@ +from GaussianProxy.conf.dataset.biotine_png_128_inference import dataset + +dataset.path = "/lustre/fsn1/projects/rech/icr/ufc43hj/datasets/biotine/3_channels_min_99_perc_normalized_rgb_stacks_png/patches_255" diff --git a/nocodazole/my_conf/dataset/biotine/biotine_png_256.yaml b/nocodazole/my_conf/dataset/biotine/biotine_png_256.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6f4a50b0c6d4cf04c9f56b70027b2bcfae4799f8 --- /dev/null +++ b/nocodazole/my_conf/dataset/biotine/biotine_png_256.yaml @@ -0,0 +1,18 @@ +name: biotine_png +path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/biotine/3_channels_min_99_perc_normalized_rgb_stacks_png/patches_255 +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} + - _target_: torchvision.transforms.Normalize + mean: [ 0.5, 0.5, 0.5 ] + std: [ 0.5, 0.5, 0.5 ] + - _target_: torchvision.transforms.transforms.Resize + size: 256 + - _target_: torchvision.transforms.RandomHorizontalFlip + - _target_: torchvision.transforms.RandomVerticalFlip + - _target_: GaussianProxy.utils.data.RandomRotationSquareSymmetry +selected_dists: [ 1, 5, 10, 15, 19 ] +expected_initial_data_range: [ 0, 255 ] diff --git a/nocodazole/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy.yaml b/nocodazole/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bc0af15563d1c82d07a6862117a22c1a7552e637 --- /dev/null +++ b/nocodazole/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy.yaml @@ -0,0 +1,18 @@ +name: diabetic_retinopathy +path: /lustre/fsn1/projects/rech/icr/ufc43hj/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/nocodazole/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2048_crop_fully_ordered.yaml b/nocodazole/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2048_crop_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..37876ed9796f7c528808fa4fdfac66d440b004b0 --- /dev/null +++ b/nocodazole/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: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/DiabeticRetinopathy/prepared_dataset_full_circle_augmented +path_to_single_parquet: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/DiabeticRetinopathy/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 + 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/nocodazole/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2560_crop_fully_ordered.yaml b/nocodazole/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2560_crop_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3ad2095a74de111db5cb53fb5fa6bddb2aa7a87c --- /dev/null +++ b/nocodazole/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_full_circle_augs_2560_crop_fully_ordered.yaml @@ -0,0 +1,25 @@ +name: diabetic_retinopathy_2560_crop_fully_ordered + +path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/DiabeticRetinopathy/prepared_dataset_full_circle_augmented +path_to_single_parquet: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/DiabeticRetinopathy/balanced_classes__diabetic_retinopathy_2560_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: 2560 + - _target_: torchvision.transforms.v2.Resize + size: 256 + - _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/nocodazole/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_fully_ordered.yaml b/nocodazole/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..225480bc8253662b31a2cc4afed18bd968ceaf46 --- /dev/null +++ b/nocodazole/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_fully_ordered.yaml @@ -0,0 +1,25 @@ +name: diabetic_retinopathy_fully_ordered + +path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/DiabeticRetinopathy/train +path_to_single_parquet: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/DiabeticRetinopathy/diabetic_retinopathy__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet + +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 + +fully_ordered: true diff --git a/nocodazole/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_hard_aug_inference.py b/nocodazole/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_hard_aug_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..feccbd2a0c9d9cd63a1610630d257c288e5aa3b0 --- /dev/null +++ b/nocodazole/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_hard_aug_inference.py @@ -0,0 +1,4 @@ +from GaussianProxy.conf.dataset.diabetic_retinopathy_inference import diabetic_retinopathy_inference as dataset + +dataset.path = "/lustre/fsn1/projects/rech/icr/ufc43hj/datasets/DiabeticRetinopathy/prepared_dataset/train_hard_augmented" +dataset.name = "diabetic_retinopathy_inference_hard_augmented" diff --git a/nocodazole/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_inference.py b/nocodazole/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..a39977d35a03d0d0fd108ca5ac1e6efe512f4a17 --- /dev/null +++ b/nocodazole/my_conf/dataset/diabetic_retinopathy/diabetic_retinopathy_inference.py @@ -0,0 +1,3 @@ +from GaussianProxy.conf.dataset.diabetic_retinopathy_inference import diabetic_retinopathy_inference + +diabetic_retinopathy_inference.path = "/lustre/fsn1/projects/rech/icr/ufc43hj/datasets/DiabeticRetinopathy/prepared_dataset/train" diff --git a/nocodazole/my_conf/dataset/ependymal_context/ependymal_context.yaml b/nocodazole/my_conf/dataset/ependymal_context/ependymal_context.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6ca5e76ee1556c3fe2462995128d8466c5502790 --- /dev/null +++ b/nocodazole/my_conf/dataset/ependymal_context/ependymal_context.yaml @@ -0,0 +1,16 @@ +name: ependymal_context +path: /lustre/fsn1/projects/rech/icr/ufc43hj/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/nocodazole/my_conf/dataset/ependymal_context/ependymal_context_avg_t_fully_ordered.yaml b/nocodazole/my_conf/dataset/ependymal_context/ependymal_context_avg_t_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..57782d87c232d1b8d3017631f705179b0e6b0a4e --- /dev/null +++ b/nocodazole/my_conf/dataset/ependymal_context/ependymal_context_avg_t_fully_ordered.yaml @@ -0,0 +1,24 @@ +name: ependymal_context_avg_t_separate_gt_fully_ordered + +path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/prepared_dataset_context_avg_pt_from_01_noised_facebook_dinov2-with-registers-giant/all_imgs +path_to_single_parquet: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/ependymal_context__continuous_time_predictions__avg_t_preds.parquet + +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: None + +fully_ordered: true diff --git a/nocodazole/my_conf/dataset/ependymal_context/ependymal_context_fully_ordered.yaml b/nocodazole/my_conf/dataset/ependymal_context/ependymal_context_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a7de34c5269bcc38520e4237d2a179529a776f35 --- /dev/null +++ b/nocodazole/my_conf/dataset/ependymal_context/ependymal_context_fully_ordered.yaml @@ -0,0 +1,23 @@ +name: ependymal_context_fully_ordered + +path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/prepared_dataset_context +path_to_single_parquet: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/ependymal_context__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet + +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 + +fully_ordered: true diff --git a/nocodazole/my_conf/dataset/ependymal_context/ependymal_context_inference.py b/nocodazole/my_conf/dataset/ependymal_context/ependymal_context_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..bae2a302edf9621fe2722910f0baee57e5f61057 --- /dev/null +++ b/nocodazole/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, + selected_dists=None, + expected_initial_data_range=(0, 255), + dataset_params=ds_params, + path="/lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/prepared_dataset_context", +) diff --git a/nocodazole/my_conf/dataset/ependymal_cutout/ependymal_cutout.yaml b/nocodazole/my_conf/dataset/ependymal_cutout/ependymal_cutout.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bb478c18035d0f740c82a8958cf7a62cee5116cd --- /dev/null +++ b/nocodazole/my_conf/dataset/ependymal_cutout/ependymal_cutout.yaml @@ -0,0 +1,17 @@ +name: ependymal_cutout +path: /lustre/fsn1/projects/rech/icr/ufc43hj/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/nocodazole/my_conf/dataset/ependymal_cutout/ependymal_cutout_01_noised_separate_gt_fully_ordered.yaml b/nocodazole/my_conf/dataset/ependymal_cutout/ependymal_cutout_01_noised_separate_gt_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c12f125a27d852d80c9aca3fbfffc0285aa4ccd5 --- /dev/null +++ b/nocodazole/my_conf/dataset/ependymal_cutout/ependymal_cutout_01_noised_separate_gt_fully_ordered.yaml @@ -0,0 +1,26 @@ +name: ependymal_cutout_01_noised_separate_gt_fully_ordered + +path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/prepared_dataset_noised_0.1_crop/all_imgs +hard_aug_path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/prepared_dataset_noised_0.1_crop_hard_augmented/all_imgs +path_to_single_parquet: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/ependymal_cutout_01_noised__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet + +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: None + +fully_ordered: true diff --git a/nocodazole/my_conf/dataset/ependymal_cutout/ependymal_cutout_03_noised_separate_gt_fully_ordered.yaml b/nocodazole/my_conf/dataset/ependymal_cutout/ependymal_cutout_03_noised_separate_gt_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e58db20d77174474867a4c3d7666ea0b50db51ae --- /dev/null +++ b/nocodazole/my_conf/dataset/ependymal_cutout/ependymal_cutout_03_noised_separate_gt_fully_ordered.yaml @@ -0,0 +1,25 @@ +name: ependymal_cutout_03_noised_separate_gt_fully_ordered + +path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/prepared_dataset_noised_0.3_crop/all_imgs +hard_aug_path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/prepared_dataset_noised_0.3_crop_hard_augmented/all_imgs +path_to_single_parquet: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/ependymal_cutout_03_noised__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet + +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: None + +fully_ordered: true diff --git a/nocodazole/my_conf/dataset/ependymal_cutout/ependymal_cutout_fully_ordered.yaml b/nocodazole/my_conf/dataset/ependymal_cutout/ependymal_cutout_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..861a69e71721d0c84d6dc90a7011c75cfac060e7 --- /dev/null +++ b/nocodazole/my_conf/dataset/ependymal_cutout/ependymal_cutout_fully_ordered.yaml @@ -0,0 +1,19 @@ +name: ependymal_cutout_fully_ordered +path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/prepared_dataset_crop +path_to_single_parquet: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/ependymal_cutout__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet +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! +fully_ordered: true diff --git a/nocodazole/my_conf/dataset/ependymal_cutout/ependymal_cutout_inference.py b/nocodazole/my_conf/dataset/ependymal_cutout/ependymal_cutout_inference.py new file mode 100644 index 0000000000000000000000000000000000000000..79ed41ec4ed87d4fb3e8cb8b828f3c780e29e56a --- /dev/null +++ b/nocodazole/my_conf/dataset/ependymal_cutout/ependymal_cutout_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_cutout", + data_shape=(NUMBER_OF_CHANNELS, DEFINITION, DEFINITION), + transforms=transforms, + selected_dists=[1, 2, 3, 4, 5, 6], # 0 is the trash class! + expected_initial_data_range=(0, 255), + dataset_params=ds_params, + path="/lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/prepared_dataset_crop", +) diff --git a/nocodazole/my_conf/dataset/ependymal_cutout/ependymal_cutout_white_bg_separate_gt_fully_ordered.yaml b/nocodazole/my_conf/dataset/ependymal_cutout/ependymal_cutout_white_bg_separate_gt_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..224bf0a50a5c94c1267a98c01e6298927e30156c --- /dev/null +++ b/nocodazole/my_conf/dataset/ependymal_cutout/ependymal_cutout_white_bg_separate_gt_fully_ordered.yaml @@ -0,0 +1,25 @@ +name: ependymal_cutout_white_bg_separate_gt_fully_ordered + +path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/prepared_dataset_white_bg_crop/all_imgs +hard_aug_path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/prepared_dataset_white_bg_crop_hard_augmented/all_imgs +path_to_single_parquet: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/ependymal/ependymal_cutout_white_bg__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet + +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: None + +fully_ordered: true diff --git a/nocodazole/my_conf/dataset/human_embryo/human_embryo_fully_ordered.yaml b/nocodazole/my_conf/dataset/human_embryo/human_embryo_fully_ordered.yaml new file mode 100644 index 0000000000000000000000000000000000000000..412151680442ae7f72ce4f15aca37850cae1db26 --- /dev/null +++ b/nocodazole/my_conf/dataset/human_embryo/human_embryo_fully_ordered.yaml @@ -0,0 +1,24 @@ +name: human_embryo + +path: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/human_embryo/phases +path_to_single_parquet: /lustre/fsn1/projects/rech/icr/ufc43hj/datasets/human_embryo/human_embryo__continuous_time_predictions__facebook_dinov2-with-registers-giant_dataset_preproc.parquet + +data_shape: [1, 256, 256] + +transforms: + _target_: torchvision.transforms.transforms.Compose + transforms: + - _target_: torchvision.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] + 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/nocodazole/net/diffusion_pytorch_model.safetensors b/nocodazole/net/diffusion_pytorch_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..27007dfd029646c2171ea45b2576ada6a01db2e0 --- /dev/null +++ b/nocodazole/net/diffusion_pytorch_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c866c0e6ee8a5efedf4af32369c6416b5b9013aab896623a71e0a4957f9e6cd +size 44222412 diff --git a/nocodazole/video_time_encoder/diffusion_pytorch_model.safetensors b/nocodazole/video_time_encoder/diffusion_pytorch_model.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..67a50fd570f1ee1a16b432b56ef4c1ae2686f957 --- /dev/null +++ b/nocodazole/video_time_encoder/diffusion_pytorch_model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d02b10cc0fcbb96228dca14adcf8e9965594dd8d052ef8190d45156e2d058d86 +size 50104