Skip to content
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

Found a bug in "imresize" #12

Closed
ricaiu opened this issue Dec 3, 2022 · 2 comments
Closed

Found a bug in "imresize" #12

ricaiu opened this issue Dec 3, 2022 · 2 comments

Comments

@ricaiu
Copy link

ricaiu commented Dec 3, 2022

When giving to fit_transform() a path as a string, it is not able to take the images due to a try-except control in import_data.
This is due to the fact that, if the image has already the same shape of the variable dim, the cv2.resize raise an error...
By changing the function imresize it works!

def imresize(img, dim=(128, 128)):
"""Resize image."""
if dim is not None and img.shape != dim:
img = cv2.resize(img, dim, interpolation=cv2.INTER_AREA)
return img

@erdogant
Copy link
Owner

erdogant commented Dec 3, 2022

Thank you for pointing this out and providing the solution!
I added your solution in the code and created a new release.
Update to the latest release with: pip install -U clustimage

@erdogant
Copy link
Owner

erdogant commented Feb 1, 2023

I am closing this issue. Let me know if the issue was not resolved.

@erdogant erdogant closed this as completed Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants