/REDNet-pytorch

PyTorch Implementation of image Restoration Using Very Deep Convolutional Encoder-Decoder Networks with Symmetric Skip Connections (NIPS 2016)

Primary LanguagePython

RED-Net

This repository is implementation of the "Image Restoration Using Very Deep Convolutional Encoder-Decoder Networks with Symmetric Skip Connections".
To reduce computational cost, it adopts stride 2 for the first convolution layer and the last transposed convolution layer.

Requirements

  • PyTorch
  • Tensorflow
  • tqdm
  • Numpy
  • Pillow

Tensorflow is required for quickly fetching image in training phase.

Results

Input JPEG (Quality 10)
AR-CNN RED-Net 10
RED-Net 20 RED-Net 30

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 --arch "REDNet30" \  # REDNet10, REDNet20, REDNet30               
               --images_dir "" \
               --outputs_dir "" \
               --jpeg_quality 10 \
               --patch_size 50 \
               --batch_size 16 \
               --num_epochs 20 \
               --lr 1e-4 \
               --threads 8 \
               --seed 123 \
               --use_fast_loader              

Test

Output results consist of image compressed with JPEG and image with artifacts reduced.

python example --arch "REDNet30" \  # REDNet10, REDNet20, REDNet30
               --weights_path "" \
               --image_path "" \
               --outputs_dir "" \
               --jpeg_quality 10