Closed CBD88 closed 4 years ago
Hi, see example below:
psnr = PSNR()
ssim = SSIM() # creates a class object
score = psnr(img1, img2)
score_ssim = ssim(img1, img2)
Hi, see example below:
psnr = PSNR() ssim = SSIM() # creates a class object score = psnr(img1, img2) score_ssim = ssim(img1, img2)
It shows the error that NameError: name 'PSNR' is not defined I am calling it from another class forward function.
This error has nothing to do with content of psnr.py file.
It's states, that something is wrong with the way you import function.
Try: from .psnr import PSNR, SSIM
, but generally just make sure that your module is visible
This error has nothing to do with content of psnr.py file. It's states, that something is wrong with the way you import function. Try:
from .psnr import PSNR, SSIM
, but generally just make sure that your module is visible
It works. But for SSIM it gives the value None. PSNR works fine.
@CBD88 I'm not using PSNR and SSIM and because of that they are not tested and may not work :c Here you can find well-tested implementations of both SSIM and PSNR: https://github.com/photosynthesis-team/photosynthesis.metrics
I want to use psnr.py in my project. I downloaded the file and put in my project folder. I import it using " from . import psnr ". Now how can i pass the two image and calculate PSNR and SSIM?