wbhu / DnCNN-tensorflow

:octocat::octocat:A tensorflow implement of the paper "Beyond a Gaussian Denoiser: Residual Learning of Deep CNN for Image Denoising"
GNU General Public License v3.0
362 stars 150 forks source link

Blind gaussian denoising #28

Open Shakarim94 opened 6 years ago

Shakarim94 commented 6 years ago

Hello! Thank you for this amazing code!

I want to ask about the DnCNN-B model. How one would implement it using this code?

In the paper they say that the patch size is set to 50x50 and the number of layers increased to 20. They also nearly doubled the number of layers. What about the noise level? Do we just pick random sigma between [0,50] at each batch?

SaoYan commented 6 years ago

My PyTorch implementation maybe helpful.

https://github.com/SaoYan/DnCNN-PyTorch

Please refer to line 70~75 in train.py

qwbmiao commented 6 years ago

Hello!Your code looks so cool!

I want to ask you that how I do to implement blind guassian noise by using the code.I try to change the sigma by "feed" like learning rate(lr) in the code,but failed.

self.X = self.Y_ + tf.randomnormal(shape=tf.shape(self.Y), stddev=self.sigma)

So can you tell me how to implement it?Thank you very much

clausmichele commented 6 years ago

In my fork I implemented blind denoising with 0-50 levels for RGB images https://github.com/clausmichele/DnCNN-tensorflow

liting11 commented 6 years ago

hi,your code is very cool that is modified.But I went wrong when I work it.I run the main program directly.I don't know that reason is what.can you tell me why?could you tell your email?i want to learn for you.thank you so much

clausmichele commented 6 years ago

Can you explain more in detail what kind of problem you have? It is impossible to say what went wrong without any details of where you are running the software.

liting11 commented 6 years ago

I am very happy to receive your reply.thank you very much.you are very good man .I can't run the program you modified。When I run main.py,there was an error about 'TypeError: 'range' object does not support item assignment',I think there are questions about my opencv.I installed OpenCV on the software of spyder, but I couldn't use it.I don't why?You can help me analyze it?Thanks for dear.

clausmichele commented 6 years ago

Please post the full error you get, so I can see the line number and try to understand what's the problem. By the way, I am using OpenCV 3.4 compiled from source, because the python version available is older, but this should not be the problem.

liting11 commented 6 years ago

This is result about when runned 'main.py' directly. runfile('F:/dncnn/DnCNN-tensorflow-master/DnCNN-tensorflow-master/main.py', wdir='F:/dncnn/DnCNN-tensorflow-master/DnCNN-tensorflow-master') GPU

Traceback (most recent call last):

File "", line 1, in runfile('F:/dncnn/DnCNN-tensorflow-master/DnCNN-tensorflow-master/main.py', wdir='F:/dncnn/DnCNN-tensorflow-master/DnCNN-tensorflow-master')

File "D:\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile execfile(filename, namespace)

File "D:\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "F:/dncnn/DnCNN-tensorflow-master/DnCNN-tensorflow-master/main.py", line 84, in tf.app.run()

File "D:\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough))

File "F:/dncnn/DnCNN-tensorflow-master/DnCNN-tensorflow-master/main.py", line 56, in main model = denoiser(sess)

File "F:\dncnn\DnCNN-tensorflow-master\DnCNN-tensorflow-master\model.py", line 41, in init self.dataset = dataset(sess)

File "F:\dncnn\DnCNN-tensorflow-master\DnCNN-tensorflow-master\model.py", line 204, in init random.shuffle(ind)

File "D:\Anaconda3\lib\random.py", line 272, in shuffle x[i], x[j] = x[j], x[i]

TypeError: 'range' object does not support item assignment

clausmichele commented 6 years ago

Running main.py only starts the training, is what you want? Do you have the images in the correct folders? Try main.py --phase=test with some test images in the right folders first.

liting11 commented 6 years ago

yes,I want to run your code to strart the training.I haved the images in the correct folders.Did your code work successful?Result?

clausmichele commented 6 years ago

Check that ind isn't empty or None and try without random.shuffle(ind)

Pichairen commented 5 years ago

@clausmichele Hi,When I run main.py --phase=test,there is an error happen, AssertionError: No testing data! whether I need download other testing data?

Shakarim94 commented 5 years ago

Hello guys, I recently implemented CDnCNN-B (blind color denoising) based on this repository