Git Product home page Git Product logo

srcnn-pytorch's Introduction

SRCNN

This repository is implementation of the "Image Super-Resolution Using Deep Convolutional Networks".

Differences from the original

  • Added the zero-padding
  • Used the Adam instead of the SGD
  • Removed the weights initialization

Requirements

  • PyTorch 1.0.0
  • Numpy 1.15.4
  • Pillow 5.4.1
  • h5py 2.8.0
  • tqdm 4.30.0

Train

The 91-image, Set5 dataset converted to HDF5 can be downloaded from the links below.

Dataset Scale Type Link
91-image 2 Train Download
91-image 3 Train Download
91-image 4 Train Download
Set5 2 Eval Download
Set5 3 Eval Download
Set5 4 Eval Download

Otherwise, you can use prepare.py to create custom dataset.

python train.py --train-file "BLAH_BLAH/91-image_x3.h5" \
                --eval-file "BLAH_BLAH/Set5_x3.h5" \
                --outputs-dir "BLAH_BLAH/outputs" \
                --scale 3 \
                --lr 1e-4 \
                --batch-size 16 \
                --num-epochs 400 \
                --num-workers 8 \
                --seed 123                

Test

Pre-trained weights can be downloaded from the links below.

Model Scale Link
9-5-5 2 Download
9-5-5 3 Download
9-5-5 4 Download

The results are stored in the same path as the query image.

python test.py --weights-file "BLAH_BLAH/srcnn_x3.pth" \
               --image-file "data/butterfly_GT.bmp" \
               --scale 3

Results

We used the network settings for experiments, i.e., .

PSNR was calculated on the Y channel.

Set5

Eval. Mat Scale SRCNN SRCNN (Ours)
PSNR 2 36.66 36.65
PSNR 3 32.75 33.29
PSNR 4 30.49 30.25
Original BICUBIC x3 SRCNN x3 (27.53 dB)
Original BICUBIC x3 SRCNN x3 (29.30 dB)
Original BICUBIC x3 SRCNN x3 (28.58 dB)

srcnn-pytorch's People

Contributors

yjn870 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

srcnn-pytorch's Issues

PSNR calculation

Hi,

How come you are calculating PSNR between the bicubic image and predicted image? Shouldn't it be the PSNR between ground truth and predicted?

About the results

thanks for your great contribution to this project ,but the SR result looks like the same as the original one,even worse,however ,the image size is larger than original one ,am i wrong with run this project?

Reproduced results

Did you achieve your posted results using the default parameters only varying the scale, training file and eval file? This would be interesting because I believe the results you posted from the paper were based on the imagenet dataset und not the T91 dataset.

Also, why did you use a custom RGB to Y function? Wouldn't a standard grayscale function do the trick?

Training parameters

Hi,

  1. Why did you do zero-padding?
  2. Why use Adam instead of the SGD? How come you didn't just use SG like the paper?
  3. Why remove the weights initialization? Why remove it?

网盘链接

请问能提供百度网盘或者谷歌网盘吗?Dropbox网盘打不开,谢谢了!
Can you provide baidu net disk or Google net disk? Thanks for failing to open the Dropbox.

About ssim

Sorry to bother you, but what should I do if I want to calculate the average SSIM?

train my dataset

如果我想根据我自己的低分辨率图像生成高分辨图像,怎样训练呢

测试

请问怎么直接使用预训练的模型 直接进行测试

Does not outputs resized image

Hi, Ive ran inference of this code but output image is not resized to x2 or x3.
input image
butterfly_GT

output image
butterfly_GT_srcnn_x3

Is there anything which could be done ? Output image is needed to be resized to 2x..

数据处理

为什么hr那里就需要插值,不是就下采样后再进行插值作为输入吗,那里训练集的处理不太懂

test运行报错

您好,我是新手
测试的时候需要修改哪些位置,
我已经改了项目说明里的三个路径,
但是argparse返回了一个错误信息,
TypeError: 'required' is an invalid argument for positionals.

关于test.py的psnr计算

with torch.no_grad():
preds = model(y).clamp(0.0, 1.0)

psnr = calc_psnr(y, preds)
print('PSNR: {:.2f}'.format(psnr))

在test中的计算原图与生成的图的psnr也有问题吧?psnr = calc_psnr(y, preds) 这里的y是低分辨率图像的y通道,不是应当计算原图与preds的psnr吗?
有大佬知道吗?

About prepare.py

How did you use prepare.py? You say that we can use prepare.py to create custom dataset. But I don't know how to use the output-path.

About transfer RGB to YCbCr

I found the y channel is multipy 64.738 while I searched the value is 65.738. I wonder what is the right answer. Thanks!

About input channel

why input channel is 1 rather than 3? I checkout the code and find that the image is converted from rgb to y channel. I don't konw why converted?

Test set problem

Hi,
I had a problem running the eval set.The. H5 file generated by Set14 and BSD100 cannot be read. What is the reason?
and always report errors:
ValueError: Field names only allowed for compound types

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.