McMaster#

class deepinv.datasets.McMaster(root=None, download=False, transform=None, verbose=True, use_dict_output=False)[source]#

Bases: ImageFolder

Dataset for McMaster.

The McMaster dataset [1] is a dataset consisting of 18 images commonly used for testing performance of color demosaicing and image reconstruction algorithms. Images have a fixed size of 500Γ—500 pixels.

Raw data file structure:

self.root --- McM.zip
        |
        --- McM --- 1.tif
        |         |
        |         --- 2.tif
        |         --- 3.tif
        |         --- ...
        |
        --- xxx

Raw dataset source : https://www4.comp.polyu.edu.hk/~cslzhang/DATA/McM.zip

Parameters:
  • root (str) – Root directory of dataset. Directory path from where we load and save the dataset.

  • download (bool) – If True, downloads the dataset from the internet and puts it in root directory. If dataset is already downloaded, it is not downloaded again. Default at False.

  • transform: (Callable) – (optional) A function/transform that takes in a PIL image and returns a transformed version. E.g, torchvision.transforms.RandomCrop

  • verbose (bool) – Print a message if the dataset has been correctly downloaded. Default True.

  • use_dict_output (bool) – whether to return output as dict with keys β€œx”, β€œy”, β€œparams” instead of tuple (default False).


References:

check_dataset_exists()[source]#

Verify that the image folders exist and contain all the images.

self.root should have the following structure:

self.root --- McM --- 1.tif
        |            |
        |            --- 2.tif
        |            --- 3.tif
        |            --- ...
        |
        --- xxx