https://github.com/yangboz/visual_search_go
visual search microservices for go game sgf files .
https://github.com/yangboz/visual_search_go
cnn-for-visual-recognition docker docker-compose elasticsearch faster-rcnn go-game microservices sgf-files tensorflow
Last synced: 6 months ago
JSON representation
visual search microservices for go game sgf files .
- Host: GitHub
- URL: https://github.com/yangboz/visual_search_go
- Owner: yangboz
- License: mit
- Created: 2017-11-28T01:49:55.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-19T03:53:22.000Z (almost 8 years ago)
- Last Synced: 2025-02-08T05:17:37.491Z (8 months ago)
- Topics: cnn-for-visual-recognition, docker, docker-compose, elasticsearch, faster-rcnn, go-game, microservices, sgf-files, tensorflow
- Language: JavaScript
- Size: 8.93 MB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

A visual search engine(for go) based on Elasticsearch, and A Tensorflow implementation of faster RCNN detection.

## Requirements
There are serveral python2.7 libraries you must to install before building the search engine.
* `elasticsearch==5.2.0`
* `Tensorflow==0.12.1`
* `Flask`
* `opencv-python`
* `easydict`
* `cython`
* `numpy`
* Or
```
pip install -r requirements.txt
```* Then
```
cd visual_search/lib & make
```## Setup
* Setup Elasticsearch5The easiest way to setup is using [Docker](https://www.docker.com/) with [Docker Compose](https://docs.docker.com/compose/). With `docker-compose` everything you have to do is so simple:
```bash
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](https://maven.apache.org/) installed.```bash
cd visual_search/es-plugin
mvn installcd 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
```bash
curl -XPUT http://localhost:9200/im_data -d @schema_es.json
```
* Setup faster r-cnnI used earlier `faster r-cnn` version implemented by [@Endernewton](https://github.com/endernewton) for object detection. You can fetch pre-trained model [here](https://drive.google.com/drive/folders/0BzY0S4QyX701OE1BLW5MTldkRVk?usp=sharing).
## Indexing images to elasticsearch```bash
export WEIGHT_PATH=...
export MODEL_PATH=...
export INPUT=..
cd visual_search
python index_es.py --weight $WEIGHT_PATH --model_path $MODEL_PATH --input $INPUT
```
### Example```
sudo python index_es.py --weight ./models/imagenet_weights/vgg16.weights --model_path ./models/faster_rcnn_models/coco_2014_train+coco_2014_valminusminival/default/vgg16_faster_rcnn_iter_490000.ckpt --input ../KGSoutput/2002-01-01-9.png
```## 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.
```bash
cd visual_search
python server.py
```and access the link `http://localhost:5000/static/index.html` to test the search engine.
Have fun =))
## Issue
```
export CFLAGS="-I /usr/local/lib/python3.5/dist-packages/numpy/core/include $CFLAGS"
```https://github.com/tensorflow/tensorflow/issues/251
## References
https://blog.algorithmia.com/deep-dive-into-object-detection-with-open-images-using-tensorflow/