安装库:

pip install imagededup

安装可能遇到的问题参考:

Cannot uninstall 'wrapt'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

https://www.cnblogs.com/xiaodai0/p/11646512.html

ipython 6.5.0 has requirement prompt-toolkit<2.0.0,>=1.0.15, but you'll have prompt-toolkit 2.0.15 which is incompatible.

https://www.cnblogs.com/xiaodai0/p/11646462.html

代码如下:

from imagededup.methods import PHash
phasher = PHash() if __name__ == '__main__':
# 生成图像目录中所有图像的二值hash编码
encodings = phasher.encode_images(image_dir=r'F:\temp\temp_1010\JPEGImages') # 对已编码图像寻找重复图像
duplicates = phasher.find_duplicates(encoding_map=encodings)
print('='*20)
print(duplicates)
print(type(duplicates))
print('='*20) # 给定一幅图像,显示与其重复的图像
from imagededup.utils import plot_duplicates
plot_duplicates(image_dir=r'F:\temp\temp_1010\JPEGImages',
duplicate_map=duplicates,
filename='0000128.jpg')

显示结果如下:

运行可能遇到的问题参考:

An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:

https://www.cnblogs.com/xiaodai0/p/11646573.html

原文参考:https://mp.weixin.qq.com/s/GajGHkkG-f4xthXWJbkKbg

最新文章

  1. 51Nod-1279 扔盘子
  2. 算法与数据结构之顺序查找(C语言)
  3. NameNode &amp; DataNode
  4. 百度编辑器修改,不让它自动替换html标签
  5. poj 3734 Blocks 快速幂+费马小定理+组合数学
  6. 设计模式:抽象工厂模式(Abstract Factory)
  7. ASP.NET页面传值之Server.Transfer 和Response.Direct
  8. NeHe OpenGL教程 第十一课:飘动的旗帜
  9. win8升级win10后的windows.old怎么删除
  10. Exchange之三合一部署
  11. 【C++自我精讲】基础系列二 const
  12. HTML5 Mobile 适应移动端的屏幕&lt;meta name=&#39;viewport&#39; content=&#39;xxxx&#39;&gt;
  13. spoj BRCKTS - Brackets 线段树
  14. 发掘ListBox的潜力(一):自动调整横向滚动条宽度
  15. 织梦不仅是链接到其他调用next
  16. beforeunload
  17. [BZOJ2503][HAOI2006]均分数据
  18. PAT (Basic Level) Practice (中文)1008 数组元素循环右移问题 (20 分)
  19. 剑指offer(19)顺时针打印矩阵
  20. MySQL修改root密码教程

热门文章

  1. CentOS7 配置sendmial + PHP mail函数发送邮件
  2. C# 邮件发送遇到的错误
  3. windows下 pip下载包到指定目录
  4. 【计算机视觉】车牌识别开源框架EasyPR介绍
  5. 【GStreamer开发】GStreamer基础教程06——媒体格式和pad的Capabilities
  6. WCF之Windows宿主(可安装成服务自动并启动)
  7. Django 插件之 Xadmin实现富文本编辑器
  8. Jenkins在Mac上的安装与维护
  9. git下载仓库的部分目录
  10. centos 6.10 oracle 19c安装