Code Monkey home page Code Monkey logo

visual_search's Introduction

A visual search engine based on Elasticsearch and Tensorflow

Visual search enging

Install requirements

$ cd visual_search
$ pip install -r requirements.txt

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 visual_search/elasticsearch
docker-compose up -d
  • Install elasticsearch plugin

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

$ cd visual_search/es-plugin
$ mvn install

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

//install plugin
//go back to elasticsearch folder
$ cd ../../..
$ 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/im_data -d @schema_es.json
  • Setup faster r-cnn

I used earlier faster r-cnn version implemented by @Endernewton for object detection. To get pretrained model, please visit release section, download and extract file model.tar.gz to visual_search/models folder.

You also need to build faster r-cnn library by running following commands:

$ cd visual_search/lib
$ make

Indexing images to elasticsearch

To index data, just run command:

$ python index_es.py --input [image dir]

For full comamnd options, please run:

$ python index_es.py --help

Start server

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

cd visual_search
python server.py

Now, you can access the link http://localhost:5000/static/index.html to test the search engine.

LICENSE

MIT

visual_search's People

Contributors

yangboz 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.