Closed ricaiu closed 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
I am closing this issue. Let me know if the issue was not resolved.
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