/Reverse-Image-Search-Engine

With the help of this repo you can build image search algorithm on your image dataset.

Primary LanguagePythonApache License 2.0Apache-2.0

IMG_20190818_174223_8__1_-removebg-preview (1)

Reverse Image Search ๐Ÿ‘“ Engine

Twitter URL APM Build with

A picture ๐Ÿ–ผ๏ธ is worth a thousand words

Introduction ๐Ÿ“Œ

Reverse Image Search also known as Content based Image retrevial, This is the application of computer vision techniques to the image retrieval problem, that is, the problem of searching for images in large databases.

Demo:

image.search.engine.mp4

Table of Content ๐Ÿ’น

  1. Motivation
  2. Dataset
  3. Model Weights
  4. How to use it
  5. Credit

1. ๐Ÿค” Motivation

Ever wondered how the Google reverse image search works, which take in an image and returns you the most similar images in a fraction of a second?

Having a large database of images with no available metadata is not an ideal starting point, searching through those images can be exhausting to solve that we can use Image search engine, which will iterate through all the images and find all the similar images.

2. Dataset ๐Ÿ“ˆ

To build search engine we need massive amount of data to seach on. For this image search engine I used Caltech101 dataset.

This dataset contains 101 classes and there are about 40 to 800 images per category.

3. Model Weights ๐Ÿ‹๏ธโ€โ™€๏ธ

Model Name Weight size Weight Link
Resnet Model Finetuned on Caltech101 dataset 96 MB Link
Feature list resnet finutuned on Caltech101 dataset 3 MB Link

4. How to use it ๐Ÿ”ฌ ๐Ÿงช

Step 1: Clone the repo

  • For new updates you can switch to dev branch.

Step 2: Create Virtual Environment

Step 3: Dataset download and extract filenames

  • Download the dataset and add a absolute path in dataset.py file.

  • Now Run dataset.py file

    python3 dataset.py
    
  • A pickle file will be generated in a specified folder.

  • We will use this pickel file in model.py

Step 4: Install Model weights

Step 5: Search for the image

  • Conform that you have added all necessary files.

  • It's time to run the sreamlit webapp

     streamlit run app.py
    
  • You will be redirected to new web page where you can search for any image in given dataset.

5. Credit

1. Deep learning based reverse image search for industrial applications

2. Building a Reverse Image Search Engine: Understanding Embeddings