Skip to content
View nunawado's full-sized avatar
  • Indonesia

Block or report nunawado

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don't include any personal information such as legal names or email addresses. Markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
nunawado/README.md

A visual search engine based on Elasticsearch and Tensorflow

Visual search enging

nunawado

There are serveral python libraries you must to install before building the search engine.

  • elasticsearch==5.2.0
  • Tensorflow==1.12.1
  • Flask
  • opencv-python

Setup

  • Setup Elasticsearch

The easiest way to setup is using Docker with Docker Compose. With docker-compose everything you have to do is so simple:

cd ember/elasticsearch
docker-compose up -d
  • Building elasticsearch plugin

We need to build Elasticsearch plugin to compute distance between feature vectors. Make sure that you have Maven installed.

cd ember/es-plugin
mvn install

cd target/release
// create simple server to serve plugin
python -m 'SimpleHTTPServer' &

//install plugin
cd ../elasticsearch
docker exec -it elasticsearch_elasticsearch_1 elasticsearch-plugin install http://localhost:8000/esplugin-0.0.1.zip
docker-compose restart
  • Index preparation
curl -XPUT http://localhost:9200/img_data -d @schema_es.json
  • Setup faster r-cnn

I use faster r-cnn version implemented by @Endernewton for object detection. Follow the link for the guide how to setup faster r-cnn and download VGG16 model trained on COCO dataset.

Indexing images to elasticsearch

export WEIGHT_PATH=...
export MODEL_PATH=...
export INPUT=..
python tool/index_es.py --weight $WEIGHT_PATH --model_path $MODEL_PATH --input $INPUT

Start server

Before starting the server, you must to update IMGS_PATH variable in ember/server.py to the location of folder where images are stored.

python tool/server.py

and access to http://localhost:5000/static/index.html to test thesearch engine.

Have fun =))

Pinned Loading

  1. laughing laughing Public

    TypeScript

  2. nunawado nunawado Public

    JavaScript

  3. snifflee snifflee Public

    TeX

  4. waffle waffle Public

    JavaScript