git://www.github.com/tuan3w/visual_search.git
git clone http://www.github.com/tuan3w/visual_search
$ svn co --depth empty http://www.github.com/tuan3w/visual_search
Checked out revision 1.
$ cd repo
$ svn up trunk
基于Elasticsearch和Tensorflow的可视化搜索引擎
你必须在构建搜索引擎之前安装一些 python 库。
elasticsearch==5.2.0
Tensorflow==0.12.1
Flask
opencv-python
easydict
安装的简单方法是使用 Docker,并使用 Docker 组成。 使用 docker-compose
,你所做的一切都是如此简单:
cd visual_search/elasticsearch
docker-compose up -d
我们需要构建Elasticsearch插件来计算特征向量之间的距离。 确保你已经安装了 Maven 插件。
cd visual_search/es-plugin mvn installcd target/release //create simple server to serve plugin python -m 'SimpleHTTPServer'&//install plugincd.. /elasticsearch docker exec -it elasticsearch_elasticsearch_1 elasticsearch-plugin install http://localhost:8000/esplugin-0.0.1.zip docker-compose restart
curl -XPUT http://localhost:9200/img_data -d @schema_es.json
我使用了 @Endernewton 实现的早期 faster r-cnn
版本,用于对象检测。 你可以在这里获取pre模型 。
export WEIGHT_PATH=...export MODEL_PATH=...export INPUT=..cd visual_search python index_es.py --weight $WEIGHT_PATH --model_path $MODEL_PATH --input $INPUT
python index_es.py --weight./models/vgg16.weights --model_path./models/faster_rcnn_models/vgg16_faster_rcnn_iter_490000.ckpt --input./KGSoutput/2002-01-01-9.png
启动服务器之前,必须在 visual_search/server.py
中将 IMGS_PATH
变量更新到存储图像的文件夹的位置。
cd visual_search
python server.py
并访问该链接 http://localhost:5000/static/index.html
测试搜索引擎。
) = )