Coder Social home page Coder Social logo

nilportugues / visual_search Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tuan3w/visual_search

0.0 2.0 1.0 759 KB

A visual search engine based on Elasticsearch and Tensorflow

License: MIT License

Java 0.87% Protocol Buffer 0.02% Python 17.60% Makefile 0.01% MATLAB 0.18% C++ 0.01% Cuda 0.49% CSS 0.41% HTML 0.64% JavaScript 79.77%

visual_search's Introduction

A visual search engine based on Elasticsearch and Tensorflow

Visual search enging

Requirements

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 visual_search/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 visual_search/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=..
cd visual_search
python 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 visual_search/server.py to the location of folder where images are stored.

cd visual_search
python server.py

and access the link http://localhost:5000/static/index.html to test the search engine.

Have fun =))

visual_search's People

Watchers

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