Skip to content

End-to-end image search engine based on the Deep learning techniques.

Notifications You must be signed in to change notification settings

lucko515/image-search-engine

Repository files navigation

End-to-end Image Search engine

This is the end-to-end implementation of image search engine. The image search engines allow us to retrive similar images based on the query one.

Project Instructions

Getting Started

  1. Clone the repository, and navigate to the downloaded folder.
git clone https://github.com/lucko515/image-search-engine
  1. Install TensorFlow.

    • Option 1: To install TensorFlow with GPU support, follow the guide to install the necessary NVIDIA software on your system.
    pip install tensorflow-gpu==1.12.0
    
    • Option 2: To install TensorFlow with CPU support only,
    pip install tensorflow==1.12.0
    
  2. Install a few pip packages.

pip install -r requirements.txt
  1. Download CIFAR-10 dataset.

    1. Put downloaded data into dataset folder
    2. Put all images from `dataset/train` to `static/images`
    
    1. Preprocessed the dataset (not covered here)
    2. Save each image in the jpg/png format into train/test folders
    3. Rest of the project stays the same
    
  2. Run throuh image-search project.ipynb and generate all necessary files

  3. Start the app.py file and enjoy!

Steps to improve the engine!

(1) Use color features as an additional search filters

We could use color intesity to produce additional features and improve our image search engine. Good read for this: Pyimagesearch color histograms

(2) TensorFlow Serving pipeline version

The Flask approach works, but it is not scalable. If you want to create the system more scalable you will need to change the implementation to TensorFlow Serving.

The updated version of files are in the folder.

How to server the model using the TensorFlow serving: tutorial

	1. Put folder `models` inside the root dir
	2. replace all files in the root to make this project use TensorFlow Serving

NOTE:

If you have the following error:

Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.

The potential solution is to downgrade your TensorFlow version to 1.4.0.

(3) Use Hourglass attention mechanism

(4) Use pre-trained model