我正在尝试计算两个图像的 SSIM 值,但出现错误。
img_np.shape = (1,256,256)
out.detach()[0].cpu().numpy().shape = (1,256)
-
out
是模型生成的输出图像
当我尝试查找 SSIM 值 ssim_ = compare_ssim(img_np,out.detach().cpu().numpy()[0])
时出现错误 ValueError: win_size exceeds image extent. If the input is a multichannel (color) image,set multichannel=True.
我试过了
-
ssim_ = compare_ssim(img_np,out.detach().cpu().numpy()[0],full=True)
但同样的错误 -
ssim_ = compare_ssim(img_np,full=True,win_size=1,use_sample_covariance=False)
然后我将输出作为数组而不是数字