-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactoring + autoresize + multiple comparison #7
Conversation
I like the enhancements, but why did you move everything out of init and main ? |
hi, init.py in python is mainly a marker that qualifies a directory as a package. Regarding main.py file, it is usually present if you want to run a program with 'python ', but the README file suggests to install the module. So, once it is correctly installed (in setup.py i've pointed to "pyssim = ssim.ssim:main'"), the main file is not needed anymore. |
init being empty is a commonly used convention, but you typically import anything you want to be globally accessible from your module into it. I can't merge this because you broke compatibility with anyone using the module like this:
The main file allows you to do this:
or from developemt:
|
you are right, I have made some small backward compatibility enhancements in order to support the 3 scenarios you have explained. |
index = numpy.average(ssim_map) | ||
|
||
return index | ||
def compute_ssim(image1, image2, gaussian_kernel_sigma=1.5, gaussian_kernel_width=11): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pelase copy the original docstring back into this function
added import of SSIM and SSIMImage in __init__.py
done |
refactoring + autoresize + multiple comparison
Thanks for your contribution! |
Hey, would you mind sending me a PR to add yourself to the AUTHORS file? |
I’ve done a small refactoring for myself.
I’ve also enabled the possibility to compare an image against a list (directory) of images.
if you pass 2 images as input the output is the same as the old code.
if you want to take my code is ok .