Urban100HR#

class deepinv.datasets.Urban100HR(root: str, download: bool = False, transform: Callable | None = None)[source]#

Bases: Dataset

Dataset for Urban100.

The Urban100 dataset contains 100 images of urban scenes. It is commonly used as a test set to evaluate the performance of super-resolution models.

Raw data file structure:

self.root --- Urban100_HR --- img_001.png
           |               |
           |               -- img_100.png
           |
           -- Urban100_HR.tar.gz

This dataset wrapper gives access to the 100 high resolution images in the Urban100_HR folder. Raw dataset source : https://huggingface.co/datasets/eugenesiow/Urban100/resolve/main/data/Urban100_HR.tar.gz

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


Examples:

Instantiate dataset and download raw data from the Internet

>>> import shutil
>>> from deepinv.datasets import Urban100HR
>>> dataset = Urban100HR(root="Urban100", download=True)  # download raw data at root and load dataset
Dataset has been successfully downloaded.
>>> print(dataset.check_dataset_exists())                      # check that raw data has been downloaded correctly
True
>>> print(len(dataset))                                        # check that we have 100 images
100
>>> shutil.rmtree("Urban100")                             # remove raw data from disk
check_dataset_exists() bool[source]#

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

self.root should have the following structure:

self.root --- Urban100_HR --- img_001.png
           |               |
           |               -- img_100.png
           |
           -- xxx

Examples using Urban100HR:#

Image transformations for Equivariant Imaging

Image transformations for Equivariant Imaging

Imaging inverse problems with adversarial networks

Imaging inverse problems with adversarial networks