Po-Hsun-Su / pytorch-ssim

pytorch structural similarity (SSIM) loss
Other
1.87k stars 364 forks source link

Reproducability with scikit-image ssim #17

Open MortenHannemose opened 5 years ago

MortenHannemose commented 5 years ago

It would be great if there was a flag to make the results identical to the output of compare_ssim from scikit image. Their implementation uses no padding, but there's still a slight difference in my results, that I haven't found.

veritas9872 commented 5 years ago

Hello. I would also like it if there were a comparison with skimage.compare_ssim. Could you include a unit test which asserts that the outputs are at least np.allclose with the outputs from skimage?

ucalyptus commented 4 years ago

Nice issue

tmabraham commented 4 years ago

The difference may be from the constants C1=(0.01)2 and `C2=(0.03)2which assume the range of pixel values is 0 to 1. If instead it isC1=(0.01*255)*2andC2=(0.03255)**2`, along which removing padding, then the implementations match.