Code Monkey home page Code Monkey logo

psp's Introduction

1.项目功能

  • 本项目PSP(PicSearchPic)是带GUI的以图搜图工具。
  • 目前计划开发网络图片搜索与本地图片搜索两个功能。
  • 本项目中,一般用local代表本地图片,input代表输入图片。

示例: 本地图库有365张,106 MB。初始化图库数据: 15.57 秒

-------原图local--------------------原图input--------------------近似图片input-------

查原图:0.09秒,查近似:0.03秒(暂时不知道为什么查原图还是慢一些,可能需要更精确的匹配)

Quick Start:

请注意更换为你自己的图片路径,另外第一次运行时会初始化图库数据,需要一定时间,第二次运行就很快了。

path_origin = '../search/阿洛娜_原图.jpg'
path_similar = '../search/阿洛娜_水印_重复.jpg'
img_origin = read_image(path_origin, gray_pic=False, show_details=False)
img_similar = read_image(path_similar, gray_pic=False, show_details=False)

start_time = time.time()
sp = SP()
sp.init_pic_df(path_local='F:/图片存储 Picture/blue archive')
ans = sp.search_origin(img_origin)
print(ans)
ans = sp.search_similar(img_similar)
print(ans)
end_time = time.time()
elapsed_time = end_time - start_time
print("总时间: {:.2f} 秒".format(elapsed_time))

输出:

从../data/blue archive.pkl初始化dataframe完成  # 这是自带的初始化输出
['F:/图片存储 Picture/blue archive/官图/arona.jpg']  # 原图的搜索结果
['F:/图片存储 Picture/blue archive/官图/arona.jpg']  # 近似图的搜索结果
总时间: 0.11 秒  # 总时间

目前就是初始化图库数据比较慢,后续会优化。

对于我本地的一个15.3 GB(5443张图)的图库,初始化用时638.60秒,但是查询只需要0.25秒

另外中文路径的似乎一直比英文的慢,暂时不知道原因。

构建方法:pyinstaller -F --noconsole --icon=UI/data/arona.ico UI/ui.py或者pyinstaller -F --noconsole --icon=UI/data/arona.ico main.py

如果上面的报错,就改为pyinstaller -F --noconsole --icon=UI/data/arona.ico UI/ui.py -p E:/Py-Project/PSP

注:下面的先别看,没翻修。

2.项目结构

.
├─ input                 # 本地图片文件夹[测试用]
├─ search                # 测试图片文件夹[测试用]
├─ PSP                   # 本项目主要功能的代码
│  ├─ __init__.py        # 初始化文件
│  ├─ read_pic.py        # 读取图片功能
│  ├─ search_pic.py      # 图片搜索功能
│  ├─ util.py            # 工具
├─ __init__.py           # 初始化文件
├─ main.py               # 主程序入口(运行此文件以启动)

测试输入图片input的目录结构:

.
├─ input
│  ├─ 白子
│  │  ├─ Shiroko.jpeg
│  ├─ 阿洛娜
│  │  ├─ arona.jpg
│  ├─ BG_CS_Abydos_01.jpg
│  ├─ BG_CS_Abydos_10.jpg

测试搜索图片search_pic的目录结构:

.
├─ search_pic        # 用于测试搜索功能(内部图片此处不展示)

3.进度

3.1 本地图片搜索

  • 精确搜索
  • 模糊搜索
  • 局部搜索
  • 优化搜索算法、使用VGG16等深度学习模型

3.2 网络图片搜索

  • 网络图片搜索

3.3 GUI

  • 图形化界面

psp's People

Contributors

virtualxiaoman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.