ESRT icon indicating copy to clipboard operation
ESRT copied to clipboard

error of psnr/ssim

Open sc-56 opened this issue 2 years ago • 2 comments

sorry for bothering,

when i run the original code, the size of 'im_pre' and 'im_label' is different, and always 'im_pre' is 6-8 pixels less than the 'im_label'. May i ask why this happened and how to solve this issue?

thanks in advance for your support and attention.

sc-56 avatar Feb 15 '23 07:02 sc-56

sorry for bothering,

when i run the original code, the size of 'im_pre' and 'im_label' is different, and always 'im_pre' is 6-8 pixels less than the 'im_label'. May i ask why this happened and how to solve this issue?

thanks in advance for your support and attention.

i have this problem too, so i resized im_pre as below:

  if opt.is_y is True:
    #print("if opt.is_y is True\n")
    im_label = quantize(sc.rgb2ycbcr(cropped_gt_img)[:, :, 0])
    im_pre = quantize(sc.rgb2ycbcr(cropped_sr_img)[:, :, 0])
    #print("y im_pre:\n" , im_pre.shape)
    #print("y im_label:\n", im_label.shape)
    if(im_label.shape != im_pre.shape):
      #print("im_label shape:\n" , im_label.shape)
      im_pre = cv2.resize((im_pre) , (int(im_label.shape[1]) , int(im_label.shape[0])))
      #print("im_pre resized shape:\n" , im_pre.shape)

you can uncomment the lines to see exactly what is happening. but I am not sure it affects the results or not.

shshojaei avatar Feb 16 '23 08:02 shshojaei

thanks bro, your code solve this problem...

chenxu2349 avatar May 20 '23 03:05 chenxu2349