Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想借助 Python 中的 imagehash 函数获取图像的指纹,但为了应用
hash = imagehash.average_hash(Image.open(path))
图像需要在存储中。有没有什么方法可以通过提供图像 URL 来获取图像的指纹?
您可以使用requests:
requests
url = 'https://commons.wikimedia.org/wiki/File:Example.png' import requests response = requests.get(url, stream=True) ihash = imagehash.average_hash(Image.open(response.raw))