Skip to content
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

how to generate LR in detail #8

Open
nmber5 opened this issue Dec 5, 2018 · 13 comments
Open

how to generate LR in detail #8

nmber5 opened this issue Dec 5, 2018 · 13 comments

Comments

@nmber5
Copy link

nmber5 commented Dec 5, 2018

hi @tyshiwo thanks for your work.

when i run the model using my own img, i found the performance was not good.
the img i use is a result of resize the face img to (128, 128).

can you help me how to generate lr img in more detail?

thanks a lot

@tyshiwo
Copy link
Owner

tyshiwo commented Dec 5, 2018

Hi,

which model are you using?

@nmber5
Copy link
Author

nmber5 commented Dec 5, 2018

tks for your reply.
I tried both CelebA models. I think for the helen model, it will be the same situation.
but when i tried the test data you given, both CelebA and helen models can get pretty good results.

so i think there must something wrong of my test_img.
for me, i just resize the face_img(detect by some face_detector) to size of (128, 128), and then fed them to the net.
can you share how to generate LR images?

my email is: [email protected]

@nmber5
Copy link
Author

nmber5 commented Dec 7, 2018

tks for your reply.
I tried both CelebA models. I think for the helen model, it will be the same situation.
but when i tried the test data you given, both CelebA and helen models can get pretty good results.

so i think there must something wrong of my test_img.
for me, i just resize the face_img(detect by some face_detector) to size of (128, 128), and then fed them to the net.
can you share how to generate LR images?

my email is: [email protected]

I have tried to use the HR data you given to generate the LR imgs, but there is a difference between yours and mine LR img, which leads to a bad results.
so, what's your method or tools about this?

@tyshiwo
Copy link
Owner

tyshiwo commented Dec 8, 2018

I think the difference comes from different frameworks we use. You can use torch to generate the LR image and see if the results are good or not.

@nmber5
Copy link
Author

nmber5 commented Dec 10, 2018

I think the difference comes from different frameworks we use. You can use torch to generate the LR image and see if the results are good or not.

hi @tyshiwo i have tried to generate the LR image with the celeba_HR data you given.
the resize torch command goes to:

  1. local img = image.load('201600.jpg')
  2. img_x8_downScale = image.scale(img, 16, 16, bicubic) --x8 downscale
  3. img_x8_LR = image.scale(img_x8_downScale, 128, 128, bicubic) --x8 upscale

there is still a difference between your LR img.
when i fed this LR image to fsrnet, the sr results is normal, but is bad than the results of your test LR .
where goes wrong?
the lr img i generated is different form yours.

mine LR: test__x8_bicubic_bicubic_lr
yours LR: 201600

mine resutls:fstnet_results
using your lr img results:fstnet_results_original

there is almost 6db bader.

@tyshiwo would you take some time to help? thks!
it seems there is a zoom in/out between ours lr img.

@flycoderRuan
Copy link

@nmber5 hello , can i ask you some question about the environment? i meet some error when i run the code. what is the version of your lua , torch ,cuda and cudnn?
image
i meet the error in the picture, do you know how to fix it? thanks a lot.

@nmber5
Copy link
Author

nmber5 commented Jan 16, 2019

@nmber5 hello , can i ask you some question about the environment? i meet some error when i run the code. what is the version of your lua , torch ,cuda and cudnn?
image
i meet the error in the picture, do you know how to fix it? thanks a lot.

my env:
ubuntu18.04, luda 5.2, torch 7 ,cuda7.0, cudnn4

when i try my own lr img, the results is bad。

@flycoderRuan
Copy link

@nmber5 hello , can i ask you some question about the environment? i meet some error when i run the code. what is the version of your lua , torch ,cuda and cudnn?
image
i meet the error in the picture, do you know how to fix it? thanks a lot.

my env:
ubuntu18.04, luda 5.2, torch 7 ,cuda7.0, cudnn4

when i try my own lr img, the results is bad。

thanks, i will try it later.

@JuheonYi
Copy link

JuheonYi commented Apr 2, 2019

@nmber5 Hi, I am facing the same issue here (the LR face generated by my code is different from the LR faces provided in the author's repo.

Did you find the solution? Would really appreciate it if you could share it!

Thanks

@hellosher
Copy link

@nmber5 hello,i meet some error when i run the FSRNet code.Which packages have you installed for lua. This picture describe the error, do you know how to fix it? thanks a lot.
图片

@Steve-Tod
Copy link

Hi @tyshiwo , I'm facing the same issue here. My own bicubic (PIL) image gets way worse results than yours. Could you please provide the code that generates LR images?

@kabutohui
Copy link

Hi guys, look here! You can create LR by using PIL(Image) like this:

from PIL import Image
img = Image.open(HR_IMAGE)
img_cubic = img.resize((16, 16), Image.BICUBIC)
img_cubic = img_cubic.resize((128, 128), Image.BICUBIC)

img_cubic.save(IMAGE_NAME, 'png')

Here are two points:

  • use Image.BICUBIC to downsample and upsample
  • save as 'png' instead of 'jpg'

@TeiZouen
Copy link

TeiZouen commented Oct 5, 2023

@kabutohui
I created LR data using the method you described, using a standard face image (original image) that I had on hand.
The original image and the newly created LR were used as input and successfully processed.
Thank you very much.

I have one question.
If I only have a low-resolution image at hand, how can I check the effect of super-resolution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants