我正在尝试计算两个图像的 SSIM 值,但出现错误。
img_np.shape = (1, 256, 256)out.detach()[0].cpu().numpy().shape = (1, 256, 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, out.detach().cpu().numpy()[0], full=True, win_size=1,use_sample_covariance=False)然后我将输出作为数组而不是数字