Open victordomingos opened 5 years ago
Looks like the two things being used are:
The latter is only used in the CW-SSIM algorithm, so it'd be easy to make CW-SSIM unavailable if scipy isn't available.
The former (correlate1d) is used in several places, so you'd have to find a pure numpy implementation.
I have been looking for that, without success. I have even placed a question on StackOverflow to see if someone could help, but until now I just got a tip identifying a function that seems to be a C implementation on top of Numpy, that would need to be "translated" to Python. Unfortunately, that is a task I am not prepared for, as my C language knowledge is very rudimentary.
I have been working on a Python application (optimize-images) that could benefit from the functionality provided by this package. However, as it's intended to be cross platform and compatible with Pythonista on iOS (which includes Pillow and Numpy as built-in features, but can't use other packages that aren't pure Python or have binary package as dependencies), I can't use it. I have been looking on the source code to check for the dependencies and it seems that there are just a few places where
scipy
is required.Would it be possible to make
scipy
an optional requirement and add the necessary workaround pure Python or Numpy based? I am sure this alternative code wouldn't be as fast as thescipy
based one, but on the other hand it would be great for those cases where for some reasonscipy
is out or reach.