我需要比较400000张图像并删除相似的图像。我将在一个文件中包含约100000个ID,其中包含多个具有不同大小的图像。我想创建两列ID和图像,并为每个ID删除相似的图像。如果一个id有10张图像,但只有两个不同,我希望该ID只有2张图像。我正在寻找在python中执行此操作的简单方法。
import PIL
from PIL import Image
import imagehash
hash1 = imagehash.phash(Image.open('image_a.jpg'))
print(hash1)
hash2 = imagehash.phash(Image.open('image_b.jpg'))
print(hash2)
hash1 == hash2
输出
e5969a1b256e8cc9
ebd49312f02e862f
假
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句