Skip to content

Latest commit

 

History

History

data

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Dataloader

  • use opencv (cv2) to read and process images.

  • read from image files OR from .lmdb for fast IO speed.

Contents

  • LR_dataset: only reads LR images in test phase where there is no GT images.
  • LRHR_dataset: reads LR and HR pairs from image folder or lmdb files. Used in SR, DeJPEG, Denoising training and validation phase.

How To Prepare Data

SR, DeJPEG, Denoising

  1. Prepare the images. You can download DIV2K dataset can be downloaded from DIV2K offical page, or from Baidu Drive.

  2. We use DIV2K dataset for training the SR, DeJPEG, and Denoising models.

    1. since DIV2K images are large, we first crop them to sub images using codes/scripts/extract_subimgs_single.py.
    2. generate LR images using matlab with codes/scripts/generate_mod_LR_bic.m, codes/scripts/generate_LR_JPEG.m, and codes/scripts/generate_LR_noise.m. If you already have LR images, you can skip this step. Please make sure the LR and HR folders have the same number of images.
    3. generate .lmdb file if needed using codes/scripts/create_lmdb.py.
    4. modify configurations in options/train/xxx.json when training, e.g., dataroot_HR, dataroot_LR.
  3. The same for validation (you can choose some from the test folder) and test folder.

General Data Process

data augmentation

We use random crop, random flip/rotation, (random scale) for data augmentation.