FSRNet icon indicating copy to clipboard operation
FSRNet copied to clipboard

how to generate LR in detail

Open nmber5 opened this issue 6 years ago • 13 comments

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

nmber5 avatar Dec 05 '18 13:12 nmber5

Hi,

which model are you using?

tyshiwo avatar Dec 05 '18 13:12 tyshiwo

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 avatar Dec 05 '18 14:12 nmber5

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?

nmber5 avatar Dec 07 '18 06:12 nmber5

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.

tyshiwo avatar Dec 08 '18 06:12 tyshiwo

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.

nmber5 avatar Dec 10 '18 03:12 nmber5

@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.

flycoderRuan avatar Jan 16 '19 07:01 flycoderRuan

@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。

nmber5 avatar Jan 16 '19 09:01 nmber5

@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.

flycoderRuan avatar Jan 18 '19 07:01 flycoderRuan

@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

JuheonYi avatar Apr 02 '19 23:04 JuheonYi

@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. 图片

hellosher avatar Apr 19 '19 02:04 hellosher

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?

Steve-Tod avatar Oct 12 '19 05:10 Steve-Tod

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'

kabutohui avatar Dec 22 '20 02:12 kabutohui

@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?

TeiZouen avatar Oct 05 '23 02:10 TeiZouen