A Caffe Implementation of SRGAN
A caffe implementation of Christian et al's "Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network" paper.
Overload or add the caffe_gan/caffe.proto, solver.cpp and caffe_gan/include/_layer.hpp and caffe_gan/src/_layer.cpp *_layer.cu to your caffe
cd caffe && make clean && make all && make pycaffe
cp -r SRGAN caffe/examples/
Preparing training data: randomly crop images of the ImageNet dataset into 216000 sub-imgs and save as .h5 format(my finally training set: 216000x3x74x74, 21600x3x296x296)
Training SRResNet-MSE:
cd yourpath/caffe && sh examples/SRGAN/train_srres_75s.sh
Testing SRResNet-MSE:
cd yourpath/caffe/examples/SRGAN/ && python srres-deploy.py
Training SRGAN-MSE:
cd yourpath/caffe && sh examples/SRGAN/train_srgan_is2.sh
Testing SRGAN-MSE:
cd yourpath/caffe/examples/SRGAN/ && python srres-deploy.py
After fixing the SRResNet-MSE architecture(Add Scale_layer) and the deploy.prototxt(For test, use global stats in the BN_layer) , the SRResNet-MSE worked well and its results are close to the offical results. My results of SRGAN-MSE are weird, and I don't know what's going wrong with it...
Set5 [4x upscaling]:
Model/Benchmarks | PSNR | SSIM |
---|---|---|
SRResNet-MSE(official) | 32.05 | 0.9019 |
SRResNet-MSE(mine) | 32.01 | 0.8914 |
SRGAN-MSE(official) | 29.40 | 0.8472 |
SRGAN-MSE(mine) | 32.01 | 0.8916 |
Set14 [4x upscaling]:
Model/Benchmarks | PSNR | SSIM |
---|---|---|
SRResNet-MSE(official) | 28.49 | 0.8184 |
SRResNet-MSE(mine) | 28.55 | 0.7786 |
SRGAN-MSE(official) | 26.02 | 0.7397 |
SRGAN-MSE(mine) | 28.52 | 0.7794 |
Bicubic | SRResNet-MSE(mine) | Ground Truth |
---|---|---|
layer{
name: "psx2_1"
type: "Reshape"
bottom: "conv_g35"
top: "psx2_1"
reshape_param {
pixelshuffler: 2
}
}