Deep Image Search - AI-Based Image Search Engine

Overview

Deep Image Search - AI-Based Image Search Engine

Brain+Machine

Deep Image Search is an AI-based image search engine that includes deep transfer learning features Extraction and tree-based vectorized search technique.

Generic badge Generic badge Generic badge Generic badge Generic badge Downloads

Brain+Machine Creators

Nilesh Verma

Features

  • Faster Search O(logN) Complexity.
  • High Accurate Output Result.
  • Best for Implementing on python based web application or APIs.
  • Best implementation for College students and freshers for project creation.
  • Applications are Images based E-commerce recommendation, Social media and other image-based platforms that want to implement image recommendation and search.

Installation

This library is compatible with both windows and Linux system you can just use PIP command to install this library on your system:

pip install DeepImageSearch

If you are facing any VS C++ 14 related issue in windows during installation, kindly refer to following solution: Pip error: Microsoft Visual C++ 14.0 is required

How To Use?

We have provided the Demo folder under the GitHub repository, you can find the example in both .py and .ipynb file. Following are the ideal flow of the code:

1. Importing the Important Classes

There are three important classes you need to load LoadData - for data loading, Index - for indexing the images to database/folder, SearchImage - For searching and Plotting the images

# Importing the proper classes
from DeepImageSearch import Index,LoadData,SearchImage

2. Loading the Images Data

For loading the images data we need to use the LoadData object, from there we can import images from the CSV file and Single/Multiple Folders.

# load the Images from the Folder (You can also import data from multiple folders in python list type)
image_list = LoadData().from_folder(['images','wiki-images'])
# Load data from CSV file
image_list = LoadData().from_csv(csv_file_path='your_csv_file.csv',images_column_name='column_name)

3. Indexing and Saving The File in Local Folder

For faster retrieval we are using tree-based indexing techniques for Images features, So for that, we need to store meta-information on the local path [meta-data-files/] folder.

# For Faster Serching we need to index Data first, After Indexing all the meta data stored on the local path
Index(image_list).Start()

3. Searching

Searching operation is performed by the following method:

# for searching, you need to give the image path and the number of the similar image you want
SearchImage().get_similar_images(image_path=image_list[0],number_of_images=5)

you can also plot some similar images for viewing purpose by following the code method:

# If you want to plot similar images you can use this method, It will plot 16 most similar images from the data index
SearchImage().plot_similar_images(image_path = image_list[0])

Complete Code

# Importing the proper classes
from DeepImageSearch import Index,LoadData,SearchImage
# load the Images from the Folder (You can also import data from multiple folder in python list type)
image_list = LoadData().from_folder(['images','wiki-images'])
# For Faster Serching we need to index Data first, After Indexing all the meta data stored on the local path
Index(image_list).Start()
# for searching you need to give the image path and the number of similar image you want
SearchImage().get_similar_images(image_path=image_list[0],number_of_images=5)
# If you want to plot similar images the you can use this method, It will plot 16 most similar images from the data index
SearchImage().plot_similar_images(image_path = image_list[0])

License

MIT License

Copyright (c) 2021 Nilesh Verma

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Please do STAR the repository, if it helped you in anyway.

More cool features will be added in future. Feel free to give suggestions, report bugs and contribute.

You might also like...
An image inline search telegram bot.

Image-Search-Bot An image inline search telegram bot. Note: Use Telegram picture bot. That is better. Not recommending to deploy this bot. Made with P

Modular search for Django

Haystack Author: Daniel Lindsley Date: 2013/07/28 Haystack provides modular search for Django. It features a unified, familiar API that allows you to

Full text search for flask.

flask-msearch Installation To install flask-msearch: pip install flask-msearch # when MSEARCH_BACKEND = "whoosh" pip install whoosh blinker # when MSE

document organizer with tags and full-text-search, in a simple and clean sqlite3 schema
document organizer with tags and full-text-search, in a simple and clean sqlite3 schema

document organizer with tags and full-text-search, in a simple and clean sqlite3 schema

A web search server for ParlAI, including Blenderbot2.
A web search server for ParlAI, including Blenderbot2.

Description A web search server for ParlAI, including Blenderbot2. Querying the server: The server reacting correctly: Uses html2text to strip the mar

This project is a sample demo of Arxiv search related to AI/ML Papers built using Streamlit, sentence-transformers and Faiss.
This project is a sample demo of Arxiv search related to AI/ML Papers built using Streamlit, sentence-transformers and Faiss.

This project is a sample demo of Arxiv search related to AI/ML Papers built using Streamlit, sentence-transformers and Faiss.

Google Project: Search and auto-complete sentences within given input text files, manipulating data with complex data-structures.
Google Project: Search and auto-complete sentences within given input text files, manipulating data with complex data-structures.

Auto-Complete Google Project In this project there is an implementation for one feature of Google's search engines - AutoComplete. Autocomplete, or wo

Full-text multi-table search application for Django. Easy to install and use, with good performance.

django-watson django-watson is a fast multi-model full-text search plugin for Django. It is easy to install and use, and provides high quality search

 rclip - AI-Powered Command-Line Photo Search Tool
rclip - AI-Powered Command-Line Photo Search Tool

rclip is a command-line photo search tool based on the awesome OpenAI's CLIP neural network.

Comments
  • Similar images

    Similar images

    The function to plot similar images plot 16 images, how do we know which image is related to or similar to the which image according to the algorithm?

    I mean like it should say these two are similar and the other two are similar to each other, no?

    opened by amrrs 3
  • TypeError: show() takes 1 positional argument but 2 were given

    TypeError: show() takes 1 positional argument but 2 were given

    Classification.py:

    from DeepImageSearch import Index, LoadData, SearchImage

    folders = [] folders.append("monos_segmented") image_list = LoadData().from_folder(folders)

    print (image_list)

    Index(image_list).Start()

    SearchImage().get_similar_images(image_path=image_list[0],number_of_images=5)

    SearchImage().plot_similar_images(image_path = image_list[0])

    Running...

    Traceback (most recent call last): File "Classification.py", line 13, in SearchImage().plot_similar_images(image_path = image_list[0]) File "/home/mike/.local/lib/python3.8/site-packages/DeepImageSearch/DeepImageSearch.py", line 132, in plot_similar_images plt.show(fig) File "/home/mike/.local/lib/python3.8/site-packages/matplotlib/pyplot.py", line 378, in show return _backend_mod.show(*args, **kwargs) TypeError: show() takes 1 positional argument but 2 were given

    opened by mikedorin 1
  • Single thread.

    Single thread.

    Hello,

    What i want to ask is, cant we make extracting features parallel? I'm using 3060 Ti and it seems a little bit slow for this GPU.

    Or am i wrong?

    1/1 [==============================] - 0s 14ms/step
    1/1 [==============================] - 0s 14ms/step                                                                                                                    | 3070/242451 [02:25<3:08:09, 21.20it/s]
    1/1 [==============================] - 0s 14ms/step
    1/1 [==============================] - 0s 14ms/step
    1/1 [==============================] - 0s 13ms/step                                                                                                                    | 3073/242451 [02:25<3:07:27, 21.28it/s]
    1/1 [==============================] - 0s 15ms/step
    1/1 [==============================] - 0s 13ms/step
    1/1 [==============================] - 0s 14ms/step                                                                                                                    | 3076/242451 [02:25<3:07:21, 21.29it/s]
    1/1 [==============================] - 0s 14ms/step
    1/1 [==============================] - 0s 13ms/step
    1/1 [==============================] - 0s 14ms/step                                                                                                                    | 3079/242451 [02:25<3:06:30, 21.39it/s]
    1/1 [==============================] - 0s 14ms/step
    1/1 [==============================] - 0s 14ms/step
    1/1 [==============================] - 0s 14ms/step                                                                                                                    | 3082/242451 [02:26<3:07:04, 21.33it/s]
    1/1 [==============================] - 0s 14ms/step
    1/1 [==============================] - 0s 13ms/step
    1/1 [==============================] - 0s 14ms/step                                                                                                                    | 3085/242451 [02:26<3:08:38, 21.15it/s]
    1/1 [==============================] - 0s 14ms/step
    1/1 [==============================] - 0s 14ms/step
    1/1 [==============================] - 0s 14ms/step                                                                                                                    | 3088/242451 [02:26<3:09:21, 21.07it/s]
    1/1 [==============================] - 0s 14ms/step
    1/1 [==============================] - 0s 14ms/step
    1/1 [==============================] - 0s 15ms/step                                                                                                                    | 3091/242451 [02:26<3:09:04, 21.10it/s]
    1/1 [==============================] - 0s 13ms/step
    1/1 [==============================] - 0s 14ms/step
    1/1 [==============================] - 0s 13ms/step                                                                                                                    | 3094/242451 [02:26<3:11:12, 20.86it/s]
    1/1 [==============================] - 0s 13ms/step
    1/1 [==============================] - 0s 14ms/step
    

    Best regards.

    opened by ucyildirim 0
  • Problems with TensorFlow

    Problems with TensorFlow

    Hello,

    when trying to install DeepImageSearch on a Windows machine I got this:

    ERROR: Cannot install deepimagesearch==1.0, deepimagesearch==1.1, deepimagesearch==1.2, deepimagesearch==1.3 and deepimagesearch==1.4 because these package versions have conflicting dependencies.
    
    The conflict is caused by:
        deepimagesearch 1.4 depends on tensorflow
        deepimagesearch 1.3 depends on tensorflow
        deepimagesearch 1.2 depends on tensorflow
        deepimagesearch 1.1 depends on tensorflow
        deepimagesearch 1.0 depends on tensorflow`
    

    I tried to install it like stated here: https://stackoverflow.com/questions/69751318/i-had-trouble-installing-python-deepimagesearch-library but also same error as mentioned there by using this.

    ERROR: Could not find a version that satisfies the requirement tensorflow==2.3.2 (from versions: none)
    ERROR: No matching distribution found for tensorflow==2.3.
    

    Digging into TensorFlow itself, it seems that it is not running on windows properly anymore beginning from version 2.11 - that would not matter, if the version required by your library would still be available

    Using Windows 10 with Python 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)] on win32

    Installing https://pypi.org/project/tensorflow-intel/ and changing requirements in your library did not help either.

    So, what else I can do ?

    Thanks in advance for any help !

    opened by Creat1veM1nd 6
Owner
Data Science Enthusiast & Digital Influencer
Google Search Engine Results Pages (SERP) in locally, no API key, no signup required

Local SERP Google Search Engine Results Pages (SERP) in locally, no API key, no signup required Make sure the chromedriver and required package are in

theblackcat102 4 Jun 29, 2021
PwnWiki 数据库搜索命令行工具;该工具有点像 searchsploit 命令,只是搜索的不是 Exploit Database 而是 PwnWiki 条目

PWSearch PwnWiki 数据库搜索命令行工具。该工具有点像 searchsploit 命令,只是搜索的不是 Exploit Database 而是 PwnWiki 条目。

K4YT3X 72 Dec 20, 2022
This project is a sample demo of Arxiv search related to AI/ML Papers built using Streamlit, sentence-transformers and Faiss.

This project is a sample demo of Arxiv search related to AI/ML Papers built using Streamlit, sentence-transformers and Faiss.

Karn Deb 49 Oct 30, 2022
Searches for MAC addresses in a text file of a Cisco "show IP arp" in any address format

show-ip-arp-mac-lookup Searches for MAC addresses in a text file of a Cisco "show IP arp" in any address format What it does: Takes a text file with t

Stew Alexander 0 Dec 24, 2022
Google Drive file searcher

Google Drive file searcher

Hafitz Setya 25 Dec 09, 2022
Deep Image Search - AI-Based Image Search Engine

Deep Image Search is an AI-based image search engine that includes deep transfer learning features Extraction and tree-based vectorized search technique.

144 Jan 05, 2023
A sphinx extension for designing beautiful, screen-size responsive web components.

sphinx-design A sphinx extension for designing beautiful, view size responsive web components. Created with inspiration from Bootstrap (v5), Material

Executable Books 109 Jan 01, 2023
Es-schema - Common Data Schemas for Elasticsearch

Common Data Schemas for Elasticsearch The Common Data Schema for Elasticsearch i

Tim Schnell 2 Jan 25, 2022
a Telegram bot writen in Python for searching files in Drive. Based on SearchX-bot

Drive Search Bot This is a Telegram bot writen in Python for searching files in Drive. Based on SearchX-bot How to deploy? Clone this repo: git clone

Hafitz Setya 25 Dec 09, 2022
High level Python client for Elasticsearch

Elasticsearch DSL Elasticsearch DSL is a high-level library whose aim is to help with writing and running queries against Elasticsearch. It is built o

elastic 3.6k Dec 30, 2022
Modular search for Django

Haystack Author: Daniel Lindsley Date: 2013/07/28 Haystack provides modular search for Django. It features a unified, familiar API that allows you to

Haystack Search 3.4k Jan 04, 2023
Simple algorithm search engine like google in python using function

Mini-Search-Engine-Like-Google I have created the simple algorithm search engine like google in python using function. I am matching every word with w

Sachin Vinayak Dabhade 5 Sep 24, 2021
Python Elasticsearch handler for the standard python logging framework

Python Elasticsearch Log handler This library provides an Elasticsearch logging appender compatible with the python standard logging library. This lib

Mohammed Mousa 0 Dec 08, 2021
txtai executes machine-learning workflows to transform data and build AI-powered semantic search applications.

txtai executes machine-learning workflows to transform data and build AI-powered semantic search applications.

NeuML 3.1k Dec 31, 2022
cve-search - a tool to perform local searches for known vulnerabilities

cve-search cve-search is a tool to import CVE (Common Vulnerabilities and Exposures) and CPE (Common Platform Enumeration) into a MongoDB to facilitat

cve-search 2k Jan 01, 2023
An image inline search telegram bot.

Image-Search-Bot An image inline search telegram bot. Note: Use Telegram picture bot. That is better. Not recommending to deploy this bot. Made with P

Fayas Noushad 24 Oct 21, 2022
Reverse-ikea-image-search - A simple image of ikea search using jina.ai

IKEA Reverse Image Search This is a demo project to fetch ikea product images(IK

SOUVIK GHOSH 4 Mar 08, 2022
Pythonic Lucene - A simplified python impelementaiton of Apache Lucene

A simplified python impelementaiton of Apache Lucene, mabye helps to understand how an enterprise search engine really works.

Mahdi Sadeghzadeh Ghamsary 2 Sep 12, 2022
A simple search engine that allow searching for chess games

A simple search engine that allow searching for chess games based on queries about opening names & opening moves. Built with Python 3.10 and python-chess.

Tyler Hoang 1 Jun 17, 2022
PwnWiki Telegram database searching bot

pwtgbot PwnWiki Telegram database searching bot. Screenshots How it looks like in the terminal when running How it looks like in Telegram Run Directly

K4YT3X 3 Jan 25, 2022