Skip to content

akshaybahadur21/VisualSearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

VisualSearch πŸ–ΌοΈ πŸ”

A Hierarchical-Learning based Reverse Image Search Engine for humans.

Hierarchical modules:

  • Classification
  • Transfer Learning based feature generator

Code Requirements πŸ¦„

You can install Conda for python which resolves all the dependencies for machine learning.

pip install -r requirements.txt

Description 🌈

Reverse image search (or as it is more technically known, instance retrieval) enables developers and researchers to build scenarios beyond simple keyword search. From discovering visually similar objects on Pinterest to recommending similar songs on Spotify to camera-based product search on Amazon, a similar class of technology under the hood is used. This is inspired by the following modules

Modules πŸ’«

  • Image Similarity
  • Feature Extraction
  • Similarity Search

Dataset πŸ—ƒοΈ

Currently, I have used the Caltech 101 Dataset. In this dataset, we have pictures of objects belonging to 101 categories. About 40 to 800 images per category and most categories have about 50 images. However, the learnings from this can be extrapolated for domain specific datasets.

Search Engine πŸ•ŠοΈ

Elasticsearch has been used as a search engine. Elasticsearch is a search engine based on the Lucene library. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents. Specifically, this pipeline uses dense_vactor field in elasticsearch. A dense_vector field stores dense vectors of float values.

File Organization πŸ—„οΈ

β”œβ”€β”€ VisualSearch (Current Directory)
    β”œβ”€β”€ data : Data folder
        β”œβ”€β”€ a
            β”œβ”€β”€ 1.png
            β”œβ”€β”€ 2.png
            .
            .
        β”œβ”€β”€ b
            .
            .
        └── z
    β”œβ”€β”€ models : Trained classifier model
        └── classifier.h5 : classifier model
    β”œβ”€β”€ resources : resources folder
    β”œβ”€β”€ src : Source code
        β”œβ”€β”€ classifier
            └── Classifier.py
        β”œβ”€β”€ elasticsearch
            └── ElasticSearch.py
        β”œβ”€β”€ pretrained
            β”œβ”€β”€ PretrainedFactory.py
            └── ResNet50.py
        └── utils
            └── utils.py
    β”œβ”€β”€ VisualSearch.py : Driving class
    β”œβ”€β”€ application.yaml : yaml properties
    β”œβ”€β”€ LICENSE
    β”œβ”€β”€ requirements.txt
    └── readme.md
        

Python Implementation πŸ‘¨β€πŸ”¬

  1. Classifier : Training on pretrained - ResNet50 for classifying
  2. Feature Extractor : Pretrained ResNet50 for feature extraction
  3. Search Engine : Elasticsearch as a search engine

If you face any problem, kindly raise an issue

Setup πŸ–₯️

  1. The pipeline is setup to be a one-click program.
  2. Configure the application.yaml file
  3. Run VisualSearch.py to run the application.

Execution πŸ‰

python3 VisualSearch.py -yml application.yaml

Results πŸ“Š

References: πŸ”±

Releases

No releases published

Packages

No packages published

Languages