hhb072 / WaveletSRNet

A pytorch implementation of Paper "Wavelet-srnet: A wavelet-based cnn for multi-scale face super resolution"
MIT License
240 stars 67 forks source link

Test result and dicussion #9

Open JasonBournePark opened 5 years ago

JasonBournePark commented 5 years ago

Hello, authors. Thanks for your contribution and good approach.

I have tried to test your code by making test only code and today fully tested you network. I trained your network (for 950 epoch) and then tested several images by importing the trained model. Then I found very good result for some images but sometimes I saw very strange noise. One of the most serious artifact on reconstructed images was like a small snake (let me call it small snake noise, SSN).

When the network has very clean image, the performance was excellent!! However, when I input a noisy image such as jpeg noise, in the reconstructed images, I could see that noises. It look like trying to connect every tiny details (some times noises), so very small noises were connected one another and boosted up. In my opinion, they originated from Wavelet method and hence I thought it can be improved by adjusting Wavelet method or something. Could you please tell me how can I or please guide me if I have a wrong point for the problem.

Thank you so much.

JasonBournePark commented 5 years ago

I add some more experimental information that I tried. I tried to upscale x4 times by using x4 times trained network. I set all hyperparamters as described in the paper. If I want to upscale input images by x4 times, do I need to use any other options such as pickle file?? please let me know.

JNUChenYiHong commented 5 years ago

Hello, authors. Thanks for your contribution and good approach.

I have tried to test your code by making test only code and today fully tested you network. I trained your network (for 950 epoch) and then tested several images by importing the trained model. Then I found very good result for some images but sometimes I saw very strange noise. One of the most serious artifact on reconstructed images was like a small snake (let me call it small snake noise, SSN).

When the network has very clean image, the performance was excellent!! However, when I input a noisy image such as jpeg noise, in the reconstructed images, I could see that noises. It look like trying to connect every tiny details (some times noises), so very small noises were connected one another and boosted up. In my opinion, they originated from Wavelet method and hence I thought it can be improved by adjusting Wavelet method or something. Could you please tell me how can I or please guide me if I have a wrong point for the problem.

Thank you so much.

I also tried to write the test code, but I failed. Could you share your code? Thank you so much!

kiranvarghesev commented 5 years ago

I add some more experimental information that I tried. I tried to upscale x4 times by using x4 times trained network. I set all hyperparamters as described in the paper. If I want to upscale input images by x4 times, do I need to use any other options such as pickle file?? please let me know.

Hello, authors. Thanks for your contribution and good approach.

I have tried to test your code by making test only code and today fully tested you network. I trained your network (for 950 epoch) and then tested several images by importing the trained model. Then I found very good result for some images but sometimes I saw very strange noise. One of the most serious artifact on reconstructed images was like a small snake (let me call it small snake noise, SSN).

When the network has very clean image, the performance was excellent!! However, when I input a noisy image such as jpeg noise, in the reconstructed images, I could see that noises. It look like trying to connect every tiny details (some times noises), so very small noises were connected one another and boosted up. In my opinion, they originated from Wavelet method and hence I thought it can be improved by adjusting Wavelet method or something. Could you please tell me how can I or please guide me if I have a wrong point for the problem.

Thank you so much.

Could you please share the test only code? Thank you so much!

JNUChenYiHong commented 5 years ago

thank you so much

------------------ 原始邮件 ------------------ 发件人: "Kiran Varghese"notifications@github.com; 发送时间: 2019年4月22日(星期一) 晚上9:32 收件人: "hhb072/WaveletSRNet"WaveletSRNet@noreply.github.com; 抄送: "反射弧"1663288225@qq.com; "Comment"comment@noreply.github.com; 主题: Re: [hhb072/WaveletSRNet] Test result and dicussion (#9)

I add some more experimental information that I tried. I tried to upscale x4 times by using x4 times trained network. I set all hyperparamters as described in the paper. If I want to upscale input images by x4 times, do I need to use any other options such as pickle file?? please let me know.

Hello, authors. Thanks for your contribution and good approach.

I have tried to test your code by making test only code and today fully tested you network. I trained your network (for 950 epoch) and then tested several images by importing the trained model. Then I found very good result for some images but sometimes I saw very strange noise. One of the most serious artifact on reconstructed images was like a small snake (let me call it small snake noise, SSN).

When the network has very clean image, the performance was excellent!! However, when I input a noisy image such as jpeg noise, in the reconstructed images, I could see that noises. It look like trying to connect every tiny details (some times noises), so very small noises were connected one another and boosted up. In my opinion, they originated from Wavelet method and hence I thought it can be improved by adjusting Wavelet method or something. Could you please tell me how can I or please guide me if I have a wrong point for the problem.

Thank you so much.

Could you please share the test only code? Thank you so much!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

hwpengTristin commented 5 years ago

Hello, authors. Thanks for your contribution and good approach.

I have tried to test your code by making test only code and today fully tested you network. I trained your network (for 950 epoch) and then tested several images by importing the trained model. Then I found very good result for some images but sometimes I saw very strange noise. One of the most serious artifact on reconstructed images was like a small snake (let me call it small snake noise, SSN).

When the network has very clean image, the performance was excellent!! However, when I input a noisy image such as jpeg noise, in the reconstructed images, I could see that noises. It look like trying to connect every tiny details (some times noises), so very small noises were connected one another and boosted up. In my opinion, they originated from Wavelet method and hence I thought it can be improved by adjusting Wavelet method or something. Could you please tell me how can I or please guide me if I have a wrong point for the problem.

Thank you so much.

Would you like to share your pre-trained model? Thank you!

yangyingni commented 4 years ago

Hello, authors. Thanks for your contribution and good approach. I have tried to test your code by making test only code and today fully tested you network. I trained your network (for 950 epoch) and then tested several images by importing the trained model. Then I found very good result for some images but sometimes I saw very strange noise. One of the most serious artifact on reconstructed images was like a small snake (let me call it small snake noise, SSN). When the network has very clean image, the performance was excellent!! However, when I input a noisy image such as jpeg noise, in the reconstructed images, I could see that noises. It look like trying to connect every tiny details (some times noises), so very small noises were connected one another and boosted up. In my opinion, they originated from Wavelet method and hence I thought it can be improved by adjusting Wavelet method or something. Could you please tell me how can I or please guide me if I have a wrong point for the problem. Thank you so much.

I also tried to write the test code, but I failed. Could you share your code? Thank you so much!

Hello,I was also trying my best to reproduce this paper,but i failed.can you share test code with me?Thang you very much.

yangyingni commented 4 years ago

I add some more experimental information that I tried. I tried to upscale x4 times by using x4 times trained network. I set all hyperparamters as described in the paper. If I want to upscale input images by x4 times, do I need to use any other options such as pickle file?? please let me know.

Hello, authors. Thanks for your contribution and good approach. I have tried to test your code by making test only code and today fully tested you network. I trained your network (for 950 epoch) and then tested several images by importing the trained model. Then I found very good result for some images but sometimes I saw very strange noise. One of the most serious artifact on reconstructed images was like a small snake (let me call it small snake noise, SSN). When the network has very clean image, the performance was excellent!! However, when I input a noisy image such as jpeg noise, in the reconstructed images, I could see that noises. It look like trying to connect every tiny details (some times noises), so very small noises were connected one another and boosted up. In my opinion, they originated from Wavelet method and hence I thought it can be improved by adjusting Wavelet method or something. Could you please tell me how can I or please guide me if I have a wrong point for the problem. Thank you so much.

Could you please share the test only code? Thank you so much!

Hello,I was trying to test images without training,and i wrote some codes,but it failed,it shows list index out of range.Can you share me with your test.py?Thank you very much.I really need it.Thank you .

yangyingni commented 4 years ago

thank you so much … ------------------ 原始邮件 ------------------ 发件人: "Kiran Varghese"notifications@github.com; 发送时间: 2019年4月22日(星期一) 晚上9:32 收件人: "hhb072/WaveletSRNet"WaveletSRNet@noreply.github.com; 抄送: "反射弧"1663288225@qq.com; "Comment"comment@noreply.github.com; 主题: Re: [hhb072/WaveletSRNet] Test result and dicussion (#9)

I add some more experimental information that I tried. I tried to upscale x4 times by using x4 times trained network. I set all hyperparamters as described in the paper. If I want to upscale input images by x4 times, do I need to use any other options such as pickle file?? please let me know.

Hello, authors. Thanks for your contribution and good approach.

I have tried to test your code by making test only code and today fully tested you network. I trained your network (for 950 epoch) and then tested several images by importing the trained model. Then I found very good result for some images but sometimes I saw very strange noise. One of the most serious artifact on reconstructed images was like a small snake (let me call it small snake noise, SSN).

When the network has very clean image, the performance was excellent!! However, when I input a noisy image such as jpeg noise, in the reconstructed images, I could see that noises. It look like trying to connect every tiny details (some times noises), so very small noises were connected one another and boosted up. In my opinion, they originated from Wavelet method and hence I thought it can be improved by adjusting Wavelet method or something. Could you please tell me how can I or please guide me if I have a wrong point for the problem.

Thank you so much.

Could you please share the test only code? Thank you so much!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Hello,can you share e with your test.py.I wrote some codes but it failed.I really need it.Thank you.

LiJieqin commented 4 years ago

thank you so much … ------------------ 原始邮件 ------------------ 发件人: "Kiran Varghese"notifications@github.com; 发送时间: 2019年4月22日(星期一) 晚上9:32 收件人: "hhb072/WaveletSRNet"WaveletSRNet@noreply.github.com; 抄送: "反射弧"1663288225@qq.com; "Comment"comment@noreply.github.com; 主题: Re: [hhb072/WaveletSRNet] Test result and dicussion (#9) I add some more experimental information that I tried. I tried to upscale x4 times by using x4 times trained network. I set all hyperparamters as described in the paper. If I want to upscale input images by x4 times, do I need to use any other options such as pickle file?? please let me know. Hello, authors. Thanks for your contribution and good approach. I have tried to test your code by making test only code and today fully tested you network. I trained your network (for 950 epoch) and then tested several images by importing the trained model. Then I found very good result for some images but sometimes I saw very strange noise. One of the most serious artifact on reconstructed images was like a small snake (let me call it small snake noise, SSN). When the network has very clean image, the performance was excellent!! However, when I input a noisy image such as jpeg noise, in the reconstructed images, I could see that noises. It look like trying to connect every tiny details (some times noises), so very small noises were connected one another and boosted up. In my opinion, they originated from Wavelet method and hence I thought it can be improved by adjusting Wavelet method or something. Could you please tell me how can I or please guide me if I have a wrong point for the problem. Thank you so much. Could you please share the test only code? Thank you so much! — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Hello,can you share e with your test.py.I wrote some codes but it failed.I really need it.Thank you.

test.py from dataset import from networks import import math import torch import cv2 import numpy as np import os os.environ["CUDA_VISIBLE_DEVICES"] = "5" class option(): def init(self): self.testfiles = '/home/lijieqin/WaveletSRNet/celeba/test.list' self.testsize = 1 self.testroot = '/home/lijieqin/WaveletSRNet/celeba/LR4' self.output_height = 128 self.output_width = 128 self.upscale = 2 self.scale_back = False self.test_batchSize = 1 self.workers = 1 self.cuda = True self.ngpu = 1 self.outf = 'results/' self.nrow = 1

srnet = torch.load('/home/WaveletSRNet/model1/sr_model_epoch_200_iter_0.pth')

def forward_parallel(net, input, ngpu): if ngpu > 1: return torch.nn.parallel.data_parallel(net, input, range(ngpu)) else: return net(input)

def save_images(images, name, path, nrow=10): img = images.cpu() im = img.data.numpy().astype(np.float32) im = im.transpose(0,2,3,1) imsave(im, [nrow, int(math.ceil(im.shape[0]/float(nrow)))], os.path.join(path, name) )

def imsave(images, size, path): img = merge(images, size) return cv2.imwrite(path, img)

def merge(images, size): h, w = images.shape[1], images.shape[2] img = np.zeros((h size[0], w size[1], 3)) for idx, image in enumerate(images): image = image 255 image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) i = idx % size[1] j = idx // size[1] img[jh:jh+h, iw:i*w+w, :] = image return img

opt = option()

if not os.path.isdir(opt.outf): os.mkdir(opt.outf)

srnet = srnet['model']

srnet.eval() wavelet_rec = WaveletTransform(scale=opt.upscale, dec=False) criterion_m = torch.nn.MSELoss(size_average=True)

if opt.cuda: srnet = srnet.cuda() wavelet_rec = wavelet_rec.cuda() criterion_m = criterion_m.cuda()

mag = int(math.pow(2, opt.upscale)) if opt.scale_back: is_scale_back = True else: is_scale_back = False testlist, = loadFromFile(opt.testfiles, opt.testsize) test_set = ImageDatasetFromFile(test_list, opt.testroot, input_height=opt.output_height, input_width=opt.output_width, output_height=opt.output_height, output_width=opt.output_width, crop_height=None, crop_width=None, is_random_crop=False, is_mirror=False, is_gray=False, upscale=mag, is_scale_back=is_scale_back)

test_data_loader = torch.utils.data.DataLoader(test_set, batch_size=opt.test_batchSize, shuffle=False, num_workers=int(opt.workers))

for titer, batch in enumerate(test_data_loader,0): input, target = torch.autograd.Variable(batch[0]), torch.autograd.Variable(batch[1]) if opt.cuda: input = input.cuda() target = target.cuda()

wavelets = forward_parallel(srnet, input, opt.ngpu)
prediction = wavelet_rec(wavelets)
mse = criterion_m(prediction, target)
psnr = 10 * math.log10(1 / (mse.item()) )

fileName = test_list[titer]
print("saving file: " + fileName)
save_images(prediction, fileName, path=opt.outf, nrow=opt.nrow)
yangyingni commented 4 years ago

Thank you very much!

------------------ 原始邮件 ------------------ 发件人: "notifications"<notifications@github.com>; 发送时间: 2019年12月18日(星期三) 中午1:57 收件人: "hhb072/WaveletSRNet"<WaveletSRNet@noreply.github.com>; 抄送: "泱渶"<2676426668@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [hhb072/WaveletSRNet] Test result and dicussion (#9)

thank you so much … ------------------ 原始邮件 ------------------ 发件人: "Kiran Varghese"notifications@github.com; 发送时间: 2019年4月22日(星期一) 晚上9:32 收件人: "hhb072/WaveletSRNet"WaveletSRNet@noreply.github.com; 抄送: "反射弧"1663288225@qq.com; "Comment"comment@noreply.github.com; 主题: Re: [hhb072/WaveletSRNet] Test result and dicussion (#9) I add some more experimental information that I tried. I tried to upscale x4 times by using x4 times trained network. I set all hyperparamters as described in the paper. If I want to upscale input images by x4 times, do I need to use any other options such as pickle file?? please let me know. Hello, authors. Thanks for your contribution and good approach. I have tried to test your code by making test only code and today fully tested you network. I trained your network (for 950 epoch) and then tested several images by importing the trained model. Then I found very good result for some images but sometimes I saw very strange noise. One of the most serious artifact on reconstructed images was like a small snake (let me call it small snake noise, SSN). When the network has very clean image, the performance was excellent!! However, when I input a noisy image such as jpeg noise, in the reconstructed images, I could see that noises. It look like trying to connect every tiny details (some times noises), so very small noises were connected one another and boosted up. In my opinion, they originated from Wavelet method and hence I thought it can be improved by adjusting Wavelet method or something. Could you please tell me how can I or please guide me if I have a wrong point for the problem. Thank you so much. Could you please share the test only code? Thank you so much! — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Hello,can you share e with your test.py.I wrote some codes but it failed.I really need it.Thank you.

test.py from dataset import from networks import import math import torch import cv2 import numpy as np import os os.environ["CUDA_VISIBLE_DEVICES"] = "5" class option(): def init(self): self.testfiles = '/home/lijieqin/WaveletSRNet/celeba/test.list' self.testsize = 1 self.testroot = '/home/lijieqin/WaveletSRNet/celeba/LR4' self.output_height = 128 self.output_width = 128 self.upscale = 2 self.scale_back = False self.test_batchSize = 1 self.workers = 1 self.cuda = True self.ngpu = 1 self.outf = 'results/' self.nrow = 1

srnet = torch.load('/home/WaveletSRNet/model1/sr_model_epoch_200_iter_0.pth')

def forward_parallel(net, input, ngpu): if ngpu > 1: return torch.nn.parallel.data_parallel(net, input, range(ngpu)) else: return net(input)

def save_images(images, name, path, nrow=10): img = images.cpu() im = img.data.numpy().astype(np.float32) im = im.transpose(0,2,3,1) imsave(im, [nrow, int(math.ceil(im.shape[0]/float(nrow)))], os.path.join(path, name) )

def imsave(images, size, path): img = merge(images, size) return cv2.imwrite(path, img)

def merge(images, size): h, w = images.shape[1], images.shape[2] img = np.zeros((h size[0], w size[1], 3)) for idx, image in enumerate(images): image = image * 255 image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) i = idx % size[1] j = idx // size[1] img[jh:jh+h, iw:iw+w, :] = image return img

opt = option()

if not os.path.isdir(opt.outf): os.mkdir(opt.outf)

srnet = srnet['model']

srnet.eval() wavelet_rec = WaveletTransform(scale=opt.upscale, dec=False) criterion_m = torch.nn.MSELoss(size_average=True)

if opt.cuda: srnet = srnet.cuda() wavelet_rec = wavelet_rec.cuda() criterion_m = criterion_m.cuda()

mag = int(math.pow(2, opt.upscale)) if opt.scale_back: is_scale_back = True else: is_scale_back = False testlist, = loadFromFile(opt.testfiles, opt.testsize) test_set = ImageDatasetFromFile(test_list, opt.testroot, input_height=opt.output_height, input_width=opt.output_width, output_height=opt.output_height, output_width=opt.output_width, crop_height=None, crop_width=None, is_random_crop=False, is_mirror=False, is_gray=False, upscale=mag, is_scale_back=is_scale_back)

test_data_loader = torch.utils.data.DataLoader(test_set, batch_size=opt.test_batchSize, shuffle=False, num_workers=int(opt.workers))

for titer, batch in enumerate(test_data_loader,0): input, target = torch.autograd.Variable(batch[0]), torch.autograd.Variable(batch[1]) if opt.cuda: input = input.cuda() target = target.cuda() wavelets = forward_parallel(srnet, input, opt.ngpu) prediction = wavelet_rec(wavelets) mse = criterion_m(prediction, target) psnr = 10 * math.log10(1 / (mse.item()) ) fileName = test_list[titer] print("saving file: " + fileName) save_images(prediction, fileName, path=opt.outf, nrow=opt.nrow)
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.