You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I just test pytorch_msssim.ssim and skimage. When I compute ssim value with these two methods on 2d matrix, I got different results, I want to know what the problem is. Maybe I use ssim in a wrong way? Here are my codes and results.
code:
`import torch
from skimage.metrics import structural_similarity
from pytorch_msssim import ssim
Hi, I just test pytorch_msssim.ssim and skimage. When I compute ssim value with these two methods on 2d matrix, I got different results, I want to know what the problem is. Maybe I use ssim in a wrong way? Here are my codes and results.
code:
`import torch
from skimage.metrics import structural_similarity
from pytorch_msssim import ssim
m0 = torch.ones(7, 7, dtype=torch.float) # OR matrix
m0[4:7, 0:3] = 0
m_sig = torch.ones(7, 7, dtype=torch.float)
m_sig[4:7, 0] = 0
ssim_out = ssim(m0.reshape(1, 1, 7, 7), m_sig.reshape(1, 1, 7, 7))
print('pytorch_ssim_value = ' + str(ssim_out.numpy()))
ssim_value2 = structural_similarity(m_sig.numpy(), m0.numpy())
print('ssim_value = ' + str(ssim_value2))`
results:
ytorch_ssim_value = 0.9836789
ssim_value = 0.4858374093651142
The text was updated successfully, but these errors were encountered: