erdogant / clustimage

clustimage is a python package for unsupervised clustering of images.
https://erdogant.github.io/clustimage
Other
92 stars 8 forks source link

Found a bug in "imresize" #12

Closed ricaiu closed 1 year ago

ricaiu commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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