/IDN-pytorch

PyTorch Implementation of Fast and Accurate Single Image Super-Resolution via Information Distillation Network (CVPR 2018)

Primary LanguagePython

IDN

This repository is implementation of the "Fast and Accurate Single Image Super-Resolution via Information Distillation Network".

Requirements

  • PyTorch
  • Tensorflow
  • tqdm
  • Numpy
  • Pillow

Tensorflow is required for quickly fetching image in training phase.

Results

Original BICUBIC x2 IDN x2

Usages

Train

When training begins, the model weights will be saved every epoch.
If you want to train quickly, you should use --use_fast_loader option.

python main.py --scale 2 \
               --num_features 64 \
               --d 16 \
               --s 4 \              
               --images_dir "" \
               --outputs_dir "" \               
               --patch_size 29 \
               --batch_size 16 \
               --num_epochs 20 \
               --lr 1e-4 \
               --loss "l1" \
               --threads 8 \
               --seed 123 \
               --use_fast_loader              

Fine-tuning

The fine-tuning artifacts are generated as "IDN_ft_epoch_{}.pth".

python main.py --scale 2 \
               --num_features 64 \
               --d 16 \
               --s 4 \              
               --images_dir "" \
               --outputs_dir "" \
               --weights_path "" \               
               --patch_size 39 \
               --batch_size 16 \
               --num_epochs 20 \
               --lr 1e-5 \
               --loss "l2" \
               --threads 8 \
               --seed 123 \
               --use_fast_loader              

Test

Output results consist of restored images by the BICUBIC and the IDN.

python example --scale 2 \
               --num_features 64 \
               --d 16 \
               --s 4 \              
               --weights_path "" \
               --image_path "" \
               --outputs_dir ""