We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
ImportError Traceback (most recent call last) in 1 import hashlib ----> 2 from scipy.misc import imread, imresize, imshow 3 import matplotlib.pyplot as plt 4 import matplotlib.gridspec as gridspec 5 get_ipython().run_line_magic('matplotlib', 'inline')
ImportError: cannot import name 'imread' from 'scipy.misc' (C:\Users\User\anaconda3\lib\site-packages\scipy\misc_init_.py)
The text was updated successfully, but these errors were encountered:
I changed the code into this
import hashlib from imageio import imread import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec %matplotlib inline import time from tqdm import tqdm import numpy as np from glob import glob def file_hash(filepath): with open(filepath, 'rb') as f: return md5(f.read()).hexdigest() file_list = glob("directory_of_the_images") import hashlib, os duplicates = [] hash_keys = dict() for index, filename in tqdm(enumerate(file_list)): #listdir('.') = current directory if os.path.isfile(filename): with open(filename, 'rb') as f: filehash = hashlib.md5(f.read()).hexdigest() if filehash not in hash_keys: hash_keys[filehash] = index else: duplicates.append((index,hash_keys[filehash]))
The main problem is just resize and imshow is not needed, and imread have been deprecated from scipy and moved to imageio
imageio
Sorry, something went wrong.
No branches or pull requests
ImportError Traceback (most recent call last)
in
1 import hashlib
----> 2 from scipy.misc import imread, imresize, imshow
3 import matplotlib.pyplot as plt
4 import matplotlib.gridspec as gridspec
5 get_ipython().run_line_magic('matplotlib', 'inline')
ImportError: cannot import name 'imread' from 'scipy.misc' (C:\Users\User\anaconda3\lib\site-packages\scipy\misc_init_.py)
The text was updated successfully, but these errors were encountered: