-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test result and dicussion #9
Comments
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. |
I also tried to write the test code, but I failed. Could you share your code? Thank you so much! |
Could you please share the test only code? Thank you so much! |
thank you so much
…------------------ 原始邮件 ------------------
发件人: "Kiran Varghese"<[email protected]>;
发送时间: 2019年4月22日(星期一) 晚上9:32
收件人: "hhb072/WaveletSRNet"<[email protected]>;
抄送: "反射弧"<[email protected]>; "Comment"<[email protected]>;
主题: 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.
|
Would you like to share your pre-trained model? Thank you! |
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. |
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 . |
Hello,can you share e with your test.py.I wrote some codes but it failed.I really need it.Thank you. |
test.py srnet = torch.load('/home/WaveletSRNet/model1/sr_model_epoch_200_iter_0.pth') def forward_parallel(net, input, ngpu): def save_images(images, name, path, nrow=10): def imsave(images, size, path): def merge(images, size): opt = option() if not os.path.isdir(opt.outf): srnet = srnet['model'] srnet.eval() if opt.cuda: mag = int(math.pow(2, opt.upscale)) test_data_loader = torch.utils.data.DataLoader(test_set, batch_size=opt.test_batchSize, for titer, batch in enumerate(test_data_loader,0):
|
Thank you very much!
…------------------ 原始邮件 ------------------
发件人: "notifications"<[email protected]>;
发送时间: 2019年12月18日(星期三) 中午1:57
收件人: "hhb072/WaveletSRNet"<[email protected]>;
抄送: "泱渶"<[email protected]>;"Comment"<[email protected]>;
主题: Re: [hhb072/WaveletSRNet] Test result and dicussion (#9)
thank you so much
…
------------------ 原始邮件 ------------------
发件人: "Kiran Varghese"[email protected];
发送时间: 2019年4月22日(星期一) 晚上9:32
收件人: "hhb072/WaveletSRNet"[email protected];
抄送: "反射弧"[email protected]; "Comment"[email protected];
主题: 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
test_list, _ = 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.
|
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.
The text was updated successfully, but these errors were encountered: