ImageDataset#
- class deepinv.datasets.ImageDataset(use_dict_output=False)[source]#
Bases:
DatasetBase class for imaging datasets in DeepInverse.
All datasets used with DeepInverse should inherit from this class.
Warning
The tuple format is deprecated and will be removed in a future version. It is recommended to use the dict format instead.
We provide the function
check_dataset()to automatically check that__getitem__returns the correct format. We support two distinct formats for dataset outputs: a tuple format and a dict format. The dict format is recommended for better readability and flexibility, while the tuple format is provided for backward compatibility.The tuple format is as follows:
xi.e a dataset that returns only ground truth;(x, y)i.e. a dataset that returns pairs of ground truth and measurement.xcan be equal totorch.nanif your dataset is ground-truth-free.(x, params)i.e. a dataset of ground truth and dict of physics parameters. Useful for training with online measurements.(x, y, params)i.e. a dataset that returns ground truth, measurements and dict of physics params.
Note
When datasets are only composed of measurements
(y)or(y, params)the tuple format returns(torch.nan, y)or(torch.nan, y, params)The dict format is more flexible and allows for arbitrary keys. The only requirement is that the dict contains at least one of the keys
"x"or"y". Parameters used to update the physics should be returned in a nested dict under the key"params". An example of a dataset returning a dict is as follows:{"x": x, "y": y, "params": {"filter": filter}}i.e. a dataset that returns ground truth, measurements and dict of physics params.
This check is also available for datasets using the method
ImageDataset.check_dataset().Datasets should ideally return
torch.Tensorordeepinv.utils.TensorListso that they are batchable and can be used withdeepinv.If using DeepInverse with your own custom dataset, you should inherit from this class and use
check_dataset()to check your dataset is compatible.
Examples using ImageDataset:#
Imaging inverse problems with adversarial networks
Low-intensity STED fluorescence microscopy denoising
Patch priors for limited-angle computed tomography
Regularization by Denoising (RED) for Super-Resolution.
Self-supervised MRI reconstruction with Artifact2Artifact
Self-supervised learning with Equivariant Imaging for MRI.
Self-supervised learning with Equivariant Splitting
Self-supervised learning from incomplete measurements of multiple operators.
Self-supervised denoising with the Neighbor2Neighbor loss.
Self-supervised denoising with the Generalized R2R loss.
Self-supervised learning with measurement splitting
Deep Equilibrium (DEQ) algorithms for image deblurring
Learned Iterative Soft-Thresholding Algorithm (LISTA) for compressed sensing
Unfolded Chambolle-Pock for constrained image inpainting