Tutorial 2: Prepare datasets¶
In this section, we will detail how to prepare data and adopt the proper dataset in our repo for different methods.
We support multiple datasets of different tasks. There are two ways to use datasets for training and testing models in MMagic:
Using downloaded datasets directly
Preprocessing downloaded datasets before using them.
The structure of this guide is as follows:
You are supposed to download datasets from their homepage first. Most datasets are available after downloaded, so you only need to make sure the folder structure is correct and further preparation is not necessary. For example, you can simply prepare Vimeo90K-triplet datasets by downloading datasets from homepage.
Some datasets need to be preprocessed before training or testing. We support many scripts to prepare datasets in tools/dataset_converters. And you can follow the tutorials of every dataset to run scripts. For example, we recommend cropping the DIV2K images to sub-images. We provide a script to prepare cropped DIV2K dataset. You can run the following command:
python tools/dataset_converters/div2k/preprocess_div2k_dataset.py --data-root ./data/DIV2K