I want to calculate the Structural Similarity Index (SSIM) between a generated and a target image (that have been picked randomly from an array of images).
This is what I have tried-
from skimage.metrics import structural_similarity as ssim
print(tar_image.shape)
print(gen_image.shape)
ssim_skimg = ssim(tar_image, gen_image,
data_range = gen_image.max() - gen_image.min(),
multichannel = True)
print("SSIM: based on scikit-image = ", ssim_skimg)
But I am getting this output:
(1, 128, 128, 3)
(1, 128, 128, 3)
ValueError: win_size exceeds image extent. If the input is a multichannel (color) image, set multichannel=True.
Can someone please tell me where I am going wrong and how I can fix this problem?