peal.data.dataset_factory.get_datasets¶
- peal.data.dataset_factory.get_datasets(config, base_dir=None, task_config=None, return_dict=False, test_config=None, data_dir=None)[source]¶
Instantiate the train, validation and test datasets of a data config.
- Parameters:
config (
DataConfigorstr) – Data config object or path of its yaml (resolved byload_yaml_config). Consumed keys:dataset_path,input_type,output_type,dataset_class,invariances,crop_size,input_size,normalization,split,diffusion_augmented,batch_wise_augmentationand the diffusion augmentation keysgenerator,sampling_time_fraction,num_discretization_steps.base_dir (
str, optional) – Root directory of the dataset; defaults toconfig.dataset_path.task_config (
TaskConfig, optional) – Stored on every returned dataset astask_config.return_dict (
bool, defaultFalse) – Passed through to the dataset constructors.test_config (
DataConfigorstr, optional) – Separate config for the test split; defaults toconfig.data_dir (
str, optional) – Passed through to the train / val dataset constructors.
- Returns:
(train_data, val_data, test_data). Whentest_config.splitis[x, 1.0]the validation dataset object is reused as test set. Each dataset getsnormalizationandtask_configattributes.- Return type:
tupleofPealDataset- Raises:
ValueError – If
dataset_classis unknown and theinput_type/output_typecombination has no default dataset class.
Notes
Augmentations are selected by name from
config.invariances:circular_cut,rotation,rotation10,hflipping,vflipping,random_resize10/20/50,color_jitter,sharpness,blur,crop,horizontalflip. An emptynormalizationlist is filled in place with the per-channel mean and std of the training split.