Flickr2kHR#
- class deepinv.datasets.Flickr2kHR(root: str, download: bool = False, transform: Callable | None = None)[source]#
Bases:
Dataset
Dataset for Flickr2K.
Raw data file structure:
self.root --- Flickr2K --- 000001.png | | | -- 002650.png | -- Flickr2K.zip
Partial raw dataset source (only HR images) : https://huggingface.co/datasets/goodfellowliu/Flickr2K/resolve/main/Flickr2K.zipFull raw dataset source (HR and LR images) : https://cv.snu.ac.kr/research/EDSR/Flickr2K.tar- 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
from deepinv.datasets import Flickr2kHR root = "/path/to/dataset/Flickr2K" dataset = Flickr2kHR(root=root, download=True) # download raw data at root and load dataset print(dataset.check_dataset_exists()) # check that raw data has been downloaded correctly print(len(dataset)) # check that we have 100 images