All Projects → ShenghaiRong → caffe_srgan

ShenghaiRong / caffe_srgan

Licence: other
A Caffe Implementation of SRGAN

Programming Languages

C++
36643 projects - #6 most used programming language
matlab
3953 projects
Cuda
1817 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to caffe srgan

Retinaface
Reimplement RetinaFace use C++ and TensorRT
Stars: ✭ 241 (+308.47%)
Mutual labels:  caffe
caffe-conf-matrix
Python layer for the Caffe deep learning framework to compute the accuracy and the confusion matrix.
Stars: ✭ 20 (-66.1%)
Mutual labels:  caffe
vgg16 batchnorm
VGG16 architecture with BatchNorm
Stars: ✭ 14 (-76.27%)
Mutual labels:  caffe
Cnnforandroid
The Convolutional Neural Network(CNN) for Android
Stars: ✭ 245 (+315.25%)
Mutual labels:  caffe
Cgnl Network.pytorch
Compact Generalized Non-local Network (NIPS 2018)
Stars: ✭ 252 (+327.12%)
Mutual labels:  caffe
caffe weight converter
Caffe-to-Keras weight converter. Can also export weights as Numpy arrays for further processing.
Stars: ✭ 68 (+15.25%)
Mutual labels:  caffe
Skimcaffe
Caffe for Sparse Convolutional Neural Network
Stars: ✭ 230 (+289.83%)
Mutual labels:  caffe
caffe-simnets
The SimNets Architecture's Implementation in Caffe
Stars: ✭ 13 (-77.97%)
Mutual labels:  caffe
List-CoreML-Models
A Big Awesome List CoreML Models.
Stars: ✭ 120 (+103.39%)
Mutual labels:  caffe
triplet
Re-implementation of tripletloss function in FaceNet
Stars: ✭ 94 (+59.32%)
Mutual labels:  caffe
Senet
Squeeze-and-Excitation Networks
Stars: ✭ 2,850 (+4730.51%)
Mutual labels:  caffe
Change Detection Review
A review of change detection methods, including codes and open data sets for deep learning. From paper: change detection based on artificial intelligence: state-of-the-art and challenges.
Stars: ✭ 248 (+320.34%)
Mutual labels:  caffe
score-zeroshot
Semantically consistent regularizer for zero-shot learning
Stars: ✭ 65 (+10.17%)
Mutual labels:  caffe
Mtcnn caffe
Simple implementation of kpzhang93's paper from Matlab to c++, and don't change models.
Stars: ✭ 244 (+313.56%)
Mutual labels:  caffe
Scale-Adaptive-Network
Semantic Image Segmentation by Scale-Adaptive Networks (TIP 2019)
Stars: ✭ 42 (-28.81%)
Mutual labels:  caffe
Colorization
Automatic colorization using deep neural networks. "Colorful Image Colorization." In ECCV, 2016.
Stars: ✭ 2,791 (+4630.51%)
Mutual labels:  caffe
mbus
基于RabbitMQ简单实现验证码识别平台,训练网络模型智能识别图形验证码
Stars: ✭ 37 (-37.29%)
Mutual labels:  caffe
caffe-static
在caffe应用到工程实现时,为了方便系统安装,需要尽可能减少软件的依赖库。 本项目以bash shell/PowerShell脚本实现将caffe依赖的所有第三方库与caffe静态编译一起,以满足全静态编译的要求。 通过本项目提供的脚本生成的caffe编译环境不需要在系统安装任何第三方库和软件,就可以自动完成caffe项目静态编译. 目前在centos6.5/ubuntu16/win7/win10上测试通过,windows上VS2013,VS2015,MinGW 5.2.0编译通过
Stars: ✭ 23 (-61.02%)
Mutual labels:  caffe
iAI
🎯 保姆级深度学习从入门到放弃 🤪 🤪
Stars: ✭ 432 (+632.2%)
Mutual labels:  caffe
Image2LMDB
Convert image folder to lmdb, adapted from Efficient-PyTorch
Stars: ✭ 58 (-1.69%)
Mutual labels:  caffe

Caffe_SRGAN

A caffe implementation of Christian et al's "Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network" paper.

Dependencis

Train

  • ubuntu 14.04
  • CUDA 7.5
  • Caffe

Test

1. obtain the SR imgs:

  • ubuntu 14.04
  • pycaffe

2. compute_psnr_ssim:

  • windows 10
  • matlab

Usage

  1. 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/ 
  1. 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)

    • My implementation is in the win10 matlab : run utils/Generate_data/mygenerate_sr_trainx4.m
  2. Training SRResNet-MSE:

     cd yourpath/caffe && sh examples/SRGAN/train_srres_75s.sh
    
  3. Testing SRResNet-MSE:

    cd yourpath/caffe/examples/SRGAN/ && python srres-deploy.py 
    
  4. Training SRGAN-MSE:

     cd yourpath/caffe && sh examples/SRGAN/train_srgan_is2.sh 
    
  5. Testing SRGAN-MSE:

     cd yourpath/caffe/examples/SRGAN/ && python srres-deploy.py 
    

Benchmarks

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

Results

Bicubic SRResNet-MSE(mine) Ground Truth
Alt text Alt text Alt text
Alt text Alt text Alt text
Alt text Alt text Alt text
Alt text Alt text Alt text
Alt text Alt text Alt text

Notes

  1. Before you train the networks , maybe you should change the directory path of training and testing data.
  2. Here offer a model named SRResNet-MSE_74s_sb_iter_180000.caffemodel which you can finetuning .
  3. Currently, the SRGAN-MSE doesn't work well , and it is still training and tuning.

Implementation Details

  1. According the paper "Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network" , I implementated the pixelshffuler_layer, which is added to reshape_layer.hpp && .cpp . If you want to use pixelshuffler_layer by yourself , just following this:
layer{
    name: "psx2_1"
    type: "Reshape"
    bottom: "conv_g35"
    top: "psx2_1"
    reshape_param {
       pixelshuffler: 2
    }
}
  1. For the GAN parts, the code borrows heavily from "在caffe 中实现Generative Adversarial Nets(二)" However , I add some new features to GAN parts. For examples , make gan_mode support the parameter "iter_size". When your gan_networks out of memory ,you can set the iter_sieze : 2 . For more details ,you can refference my srgan_is2_solver.prototxt and train_srgan_is2.prototxt
  2. For the utils of compute_psnr_ssim , the code borrows from this link https://github.com/ShenghaiRong/caffe-vdsr . But I modified the codes a lot.
  3. Because of the different caffe version, you may have problem when compiling the caffe. If so ,you can just modify the step function in your solver.cpp instead of directly using mine.

Plans

  • Finetuning the SRResNet-MSE model.
  • Properly train the SRGAN-MSE model.
  • Train the SRResNet-VGG networks.
  • Train the SRGAN-VGG networks.
  • Improve docs & instructions

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].