jterrace / pyssim

A Python module for computing the Structural Similarity Image Metric (SSIM)
MIT License
340 stars 62 forks source link

SSIM.ssim_value() broken #32

Open JuriAbramov opened 5 years ago

JuriAbramov commented 5 years ago

PIL (no longer) supports image multiplication with * operator, causing error:

File ".../lib/python3.6/site-packages/ssim/ssimlib.py", line 126, in ssim_value img_mat_12 = self.img.img_gray target.img_gray TypeError: unsupported operand type(s) for : 'Image' and 'Image'

One needs to add ndarray conversion, like cw_ssim_value() counterpart.

jterrace commented 5 years ago

Looks like it's still passing on Travis CI: https://travis-ci.org/jterrace/pyssim

Is python 3.6 the missing part? We're only testing 3.4 and 3.5 at the moment.

jterrace commented 5 years ago

Passing with 3.6 also, what's different? https://travis-ci.org/jterrace/pyssim/builds/492949779?utm_medium=notification&utm_source=email

JuriAbramov commented 5 years ago

I think the difference to your test is that I do not pass gaussian_kernel_1d to SSIM constructor, like you do on line 238, after which the greyscale conversion has a different type.