Skip to content
An image search application demo.
Python Vue JavaScript HTML CSS
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data_preprocess backup code. Nov 17, 2019
index_construction updated rpc connection timeout. Nov 17, 2019
mm_images finished data_preprocess & web_demo style Nov 15, 2019
web_demo rebuild web_demo with vue_cli@4, fix security vulnerabilities. Nov 18, 2019
.gitignore
LICENSE Initial commit Mar 21, 2017
README.md add web_demo/dist Nov 17, 2019
demo_result.png updated rpc connection timeout. Nov 17, 2019
requirements.txt finished data_preprocess & web_demo style Nov 15, 2019
search_test_result.jpg finished web_demo and index_construction. Nov 17, 2019
test_img.jpeg finished web_demo and index_construction. Nov 17, 2019

README.md

MMFinder

一个美女图搜索应用的demo。

环境

python3.7 + mongodb + SPTAG

数据准备

1. 准备数据

爬取MM图片数据。

如果没有美女图片,可以用我的数据,Google Drive下载链接:https://drive.google.com/file/d/1shZ3gx9nHPHUgylsZIrvWliwCh9TucAo/view?usp=sharing。解压密码:nladuo。

2. 过滤图片

只选出带一个脸的美女图,然后放到mongo里面

cd data_prprocess
python3 filter_images.py

特征工程

通过VGG-net对人脸图片特征提取,转换成dense-vector。

1. 下载VGG预训练模型

Google Drive:https://drive.google.com/file/d/1CPSeum3HpopfomUEK1gybeuIVoeJT_Eo/view?usp=sharing]
百度云链接:https://pan.baidu.com/s/1Dk40tW2lx1ezTda9IyIO9g 密码:0vc7

2. 使用VGG提取特征并构建数据集

cd data_prprocess
python3 feature_extraction.py

建立索引

1. 安装SPTAG,并启动Rpc服务

见:Docker下SPTAG的安装与测试

2. 对图片建立索引

cd index_construction
python3 export_SPTAG_indexbuilder_input.py

拷贝mm_index_input.txt到docker容器中

docker cp mm_index_input.txt 25042d741f07:/app/Release/

进入SPTAG的docker容器中,建立索引

docker attach 25042d741f07
./indexbuilder -d 2622 -v Float  -i ./mm_index_input.txt -o data/mm_index -a BKT -t 2

启动SPTAG搜索服务

python3 SPTAG_rpc_search_service.py

3. 搜索测试

对于mac用户,可以先安装imgcat,然后运行index_construction/search_test.py.

效果如下:

运行demo

运行演示网站

cd web_demo
python3 main.py

测试效果

打开http://localhost:3889

上传一张图片测试,效果如下: demo_result

Reference

LICENSE

MIT

You can’t perform that action at this time.