安装库:

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

python-----图像去重(imagededup)的更多相关文章

  1. 【Tool】Augmentor和imgaug——python图像数据增强库

    Augmentor和imgaug--python图像数据增强库 Tags: ComputerVision Python 介绍两个图像增强库:Augmentor和imgaug,Augmentor使用比较 ...

  2. python图像、视频转字符画

    python图像转字符画需要用到matplotlib.pyplot库,视频转字符画需要用到opencv库,这里的代码基于python 3.5 图像转字符画需要先将图像转为灰度图,转灰度图的公式是 gr ...

  3. python list去重的方法

    转载于:http://yxmhero1989.blog.163.com/blog/static/112157956201381443244790/ Python很简洁 我们喜欢简单有效的代码   一. ...

  4. [Python] 图像简单处理(PIL or Pillow)

    前几天弄了下django的图片上传,上传之后还需要做些简单的处理,python中PIL模块就是专门用来做这个事情的. 于是照葫芦画瓢做了几个常用图片操作,在这里记录下,以便备用. 这里有个字体文件,大 ...

  5. python字典去重脚本

    #!/usr/bin/env python # encoding: utf-8 #字典去重小代码 import sys import os import platform try: pass exce ...

  6. Python图像全屏显示

    需要在嵌入式设备上全屏显示图像,使用pil显示图像时,只能通过系统的图像浏览器显示.所以使用Python自带的tkinter import Tkinter as tk   这句在Python3中已经改 ...

  7. 【Python图像特征的音乐序列生成】使用Python生成简单的MIDI文件

    这个全新的Python音乐创作系列,将会不定期更新.写作这个系列的初衷,是为了做一个项目<基于图像特征的音乐序列生成模型>,实时地提取照片特征,进行神经网络处理,生成一段音乐. 千里之行, ...

  8. 【Hadoop/Hive/mapreduce】系列之使用union all 命令之后如何对hive表格使用python进行去重

    业务场景大概是这样的,这里由两个hive表格,tableA 和 tableB, 格式内容都是这样的: uid cate1 cate2 在hive QL中,我们知道union有着自动去重的功能,但是那是 ...

  9. 使用 python set 去重 速度到底是多快呢???

    这次去测试一下 python 的set去重,速度怎么样? 我们要做的是把文件一次性读取到内存中,然后去重,输出去重的长度. 第一步:对 121w 条数据去重,看去重话费的时间 上证据: 第二步:对 1 ...

  10. python 图像的离散傅立叶变换

    图像(MxN)的二维离散傅立叶变换可以将图像由空间域变换到频域中去,空间域中用x,y来表示空间坐标,频域由u,v来表示频率,二维离散傅立叶变换的公式如下: 在python中,numpy库的fft模块有 ...

随机推荐

  1. mysql.yaml

    [root@lab2 mysql]# cat mysql.yaml apiVersion: extensions/v1beta1 kind: Deployment metadata: name: my ...

  2. MVC4笔记 RedirectResult,RedirectToRoute

    RedirectResult:运行重新导向到其他网址,在RedirectResult的内部,基本上还是以Response.Redirect方法响应HTTP 302暂时导向. eg: public Ac ...

  3. npm 安装 -D 和-S的区别

    -D 是在开发环境中协助开发需要使用的-S是生产环境打包时需要的,在package.json中 -D在devDependencies对象中,-S在dependencies对象中

  4. 09点睛Spring MVC4.1-异步请求处理(包含兼容浏览器的服务器端推送)

    转发地址:https://www.iteye.com/blog/wiselyman-2215852 9.1 异步请求处理 Servlet 3开始支持异步请求处理 Spring MVC 3.2开始支持S ...

  5. web端自动化——webdriver驱动

    1.1Edge浏览器(不过,Edge浏览器只能运行于 Windows 10) Edge驱动的下载地址,复制链接http://go.microsoft.com/fwlink/?LinkId=619687 ...

  6. filebeat输出到kafka

    # cat filebeat.yml filebeat.inputs: - type: log enabled: true tail_files: true paths: - /data/www.ex ...

  7. SPSS数据分析基础考题

    选择题 1. SPSS发行版本的说法,正确的是: B A. 两年发行一个新版本 B.一年发行一个新版本 C.没有任何规律 D.三年发行三个新版本 2.哪些是SPSS统计分析软件的基本窗口: A A.结 ...

  8. 有关_meta内容(持续更新)

    假设在models里创建了一个类:UserInfo model.UserInfo._meta.app_label #获取该类所在app的app名称 model.UserInfo._meta.model ...

  9. [bzoj3420]Poi2013 Triumphal arch_树形dp_二分

    Triumphal arch 题目链接:https://lydsy.com/JudgeOnline/problem.php?id=3420 数据范围:略. 题解: 首先,发现$ k $具有单调性,我们 ...

  10. [SQL] - 报表查询效率优化

    背景 系统将数据对象JSON序列化后存放到数据库字段中.Report 模块需要获取实时数据对象数值,当前在SQL中进行数值判断的耗时长,效率低. 分析 当前执行效率低主要是程序结构设计的不合理. SQ ...