sefibk / KernelGAN

Other
337 stars 77 forks source link

The given ground-truth kernels are not compatible with corresponding LR images in DIV2KRK #33

Closed greatlog closed 3 years ago

greatlog commented 4 years ago

Hi, thanks for sharing your testing dataset. But I find a problem with it. By using your provided ground-truth kernels and codes, I can not generate the same LR images as you did. In other words, the ground-truth kernels are are not compatible with corresponding LR images. Would you mind fixing it and share me the truly ground-truth kernels? Thanks!

sefibk commented 4 years ago

The code provided generates RANDOM kernel, therefore random corresponding LR images. If you want ours, simply use the dataset we provided. Not sure I understand your issue

greatlog commented 4 years ago

I mean that your dataset has also provided 'gt_k_x2' and 'gt_k_x4', but I can not re-generate the dataset with your provided kernels. You may have made a mistake about the provided kernels in your dataset.

sefibk commented 4 years ago

What function are you using to get the LR from the HR+kernel?

greatlog commented 4 years ago

fileter.correlate(), the same as your provided code.

sefibk commented 4 years ago

You can use the 'imresize' function in my code which gets the HR and the kernel and downscales it.

MeLonJ10 commented 3 years ago

Hi, @greatlog. Did you get the consistent LR? I try to get LR using the following code. However, it does not match LR provided in official DIV2KRK.

ker = sio.loadmat("e:/Dataset/SR/DIV2KRK/gt_k_x2/kernel_1.mat")['Kernel']
hr = cv2.imread("e:/Dataset/SR/DIV2KRK/gt/img_1_gt.png")
lr = cv2.imread("e:/Dataset/SR/DIV2KRK/lr_x2/im_1.png")
lr_my = imresize(hr, 1/2, kernel=ker)
err = np.mean(np.abs(np.float32(lr) - np.float32(lr_my)))

err: 2.51 @sefibk May you offer me some help. Thank you so much.

greatlog commented 3 years ago

Hi, @greatlog. Did you get the consistent LR? I try to get LR using the following code. However, it does not match LR provided in official DIV2KRK.

ker = sio.loadmat("e:/Dataset/SR/DIV2KRK/gt_k_x2/kernel_1.mat")['Kernel']
hr = cv2.imread("e:/Dataset/SR/DIV2KRK/gt/img_1_gt.png")
lr = cv2.imread("e:/Dataset/SR/DIV2KRK/lr_x2/im_1.png")
lr_my = imresize(hr, 1/2, kernel=ker)
err = np.mean(np.abs(np.float32(lr) - np.float32(lr_my)))

err: 2.51 @sefibk May you offer me some help. Thank you so much.

I can not get the consistent LR either. There seems to be some slight bias in the provided kernels or the processing method. This slight difference may not cause visual differences, however, it may heavily influence the results of a neural model. I have not fixed the problem yet. So I did not use the provided kernels as GT kernels.

sefibk commented 3 years ago

Weird - IDK exactly why. I was not the one that created this dataset. You can find a detailed Git repo for the dataset here - https://github.com/assafshocher/BlindSR_dataset_generator