Skip to main content

A generic framework to build your own reverse image search engine

Project description

imSearch: A generic framework to build your own reverse image search engine

imsearch helps to create your own custom, robust & scalable reverse image search engine. This project uses state of the art object detection algorithm (yolov3) at its core to extract the features from an image. It uses an efficient cross-platform similarity search library NMSLIB for similarity search. Redis is used as a messaging queue between feature extractor and core engine. MongoDB is used to store the meta-data of all the indexed images. HD5 file system is used to store the feature vectors extracted from indexed images.

Installation

For the setup, a simple install.sh script can be used or can be installed using pip. Follow these simple steps to install imsearch library.

  • Feature extraction is GPU intensive process. So, to make the search real-time, running this engine on GPU enabled machine is recommended.
  • Install CUDA & NVIDIA graphics drivers (here)
  • Install PyTorch (here)
  • Install MongoDB (here)
  • Install Redis (here)
  • Run following commands
pip install --no-binary :all: nmslib
pip install imsearch

Build from source using install.sh

git clone https://github.com/rikenmehta03/imsearch.git
chmod +x install.sh
./install.sh

Example usage

import glob
import imsearch

all_images = glob.glob('path/to/image/folder')

# Initialize the index
index = imsearch.init('test')

# Add single image to the index
index.addImage(all_images[0]) 

# Add multiple image to the index
index.addImageBatch(all_images[1:])

# Create index and make it ready for the search query
index.createIndex() 

# find k nearest similar images
# choose policy from 'object' or 'global'. Search results will change accordingly.
# object: Object level matching. The engine will look for similarity at object level for every object detected in the image.
# global: Overall similarity using single feature space on the whole image. 
similar = index.knnQuery('path/to/query/image', k=10, policy='object')

For detailed usage see examples/index.py

Credit

YOLOv3: An Incremental Improvement

Joseph Redmon, Ali Farhadi

Abstract
We present some updates to YOLO! We made a bunch of little design changes to make it better. We also trained this new network that’s pretty swell. It’s a little bigger than last time but more accurate. It’s still fast though, don’t worry. At 320 × 320 YOLOv3 runs in 22 ms at 28.2 mAP, as accurate as SSD but three times faster. When we look at the old .5 IOU mAP detection metric YOLOv3 is quite good. It achieves 57.9 AP50 in 51 ms on a Titan X, compared to 57.5 AP50 in 198 ms by RetinaNet, similar performance but 3.8× faster. As always, all the code is online at https://pjreddie.com/yolo/.

[Paper] [Project Webpage] [Authors' Implementation]

@article{yolov3,
  title={YOLOv3: An Incremental Improvement},
  author={Redmon, Joseph and Farhadi, Ali},
  journal = {arXiv},
  year={2018}
}

PyTorch-YOLOv3

Minimal PyTorch implementation of YOLOv3 [GitHub]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

imsearch-0.1.1.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

imsearch-0.1.1-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

Details for the file imsearch-0.1.1.tar.gz.

File metadata

  • Download URL: imsearch-0.1.1.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.7

File hashes

Hashes for imsearch-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8ba0506d95d185c1448d53e8d8c980b2c8c2f82b26011852f84e828a835063a2
MD5 2d911da398772330ad5943a7ba61c3b6
BLAKE2b-256 3bb9fef86b58bd31f923b0e27a2ee4590c927fb79442e0f87af4b9637d24aebb

See more details on using hashes here.

File details

Details for the file imsearch-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: imsearch-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 24.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.7

File hashes

Hashes for imsearch-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8119f349d8af1d9281ee87110c512249527deb21dca299f1dbf3586af2643b00
MD5 68f71833167b2ea34e1b9cc8c3b76fcb
BLAKE2b-256 abd3506a772b7bec7c0346db7fc862eefb97bc1bd031ec73c54df5d6579a9c28

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page