BSDS500#

class deepinv.datasets.BSDS500(root, download=False, train=True, splits=None, transform=None, rotate=False)[source]#

Bases: ImageDataset

Dataset for BSDS500.

BSDS500 dataset for image restoration benchmarks. BSDS stands for The Berkeley Segmentation Dataset and Benchmark from Martin et al.[1]. Originally, BSDS500 was used for image segmentation. However, this dataset only loads the ground truth images. The dataset consists of RGB color images of size 481 x 321 or 321 x 481 and is divided into three splits:

  • “train”: contains 200 training images

  • “val”: contains 100 validation images

  • “test”: contains 200 test images

Despite the name, the “val” split is often used for testing (e.g., it is a superset of CBSD68), while the “train” and “test” splits are used for training.

This dataset uses the file structure from the github repository BIDS/BSDS500 from the institute which published the dataset.

Raw data file structure:

self.root --- BSDS500-master --- (all files from the github repo)
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.

  • train (bool) – If True, the standard training dataset (containing the splits “train” and “test”) will be loaded. If False, the standard test set (containing the “val” split) is loaded (which is a superset of CBSD68). Default at True

  • splits (list of str) – Alternatively to the train parameter, the precise splits used can be defined. E.g., pass ["train", "val"] to load the “train” and “val” splits. None for using the splits defined by the train parameter. Default None.

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

  • rotate (bool) – If set to True images are rotated to have all the same orientation. This can be important to use a torch dataloader. Default at False.


References: