Giter VIP home page Giter VIP logo

image-search-engine's Introduction

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

image-search-engine's People

Contributors

dependabot[bot] avatar lucko515 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

image-search-engine's Issues

No such file or directory: 'color_vectors.pickle'

Hi,
For some reason the 'color_vectors.pickle' file is not generated. I tried the code from the video and I try the github jupyter notebook.

All other pickle file are on the drive
Please advise,
Thanks

Error while minimizing loss

image
I am facing this issue please help. My tensorflow version is 2.3.0
Also, can you please tell me which two variables we are trying to minimize.

TypeError: simple_inference() got multiple values for argument 'distance'

result_ids = simple_inference(model, session, train_set_vectors, test_img, color_vectors, image_size , distance = "hamming" )


TypeError Traceback (most recent call last)
in
----> 1 result_ids = simple_inference(model, session, train_set_vectors, test_img, color_vectors, image_size , distance = "hamming" )

TypeError: simple_inference() got multiple values for argument 'distance'

cannot run simple_inference file it says got multiple value
what should i do please help
no code error because i copy the code from this github

ModuleNotFoundError: No module named 'utils.model'

I have this error when I run python app.py. I use TensorFlow V1 and I followed your tutorial on udemy. "utils" folder has model.py file but there is this error "ModuleNotFoundError: No module named 'utils.model' ".And I tried to cut all files from utils folder and paste it in image-search-engine, And I edited it to import model but it's the same error. How can I solve this error?

please help

can u please tell me what this errors are ๐Ÿ‘ 2021-06-27 23:00:09.416600: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2021-06-27 23:00:09.416646: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
File "/home/nomnom/image-search-engine/app.py", line 25, in
model = ImageSearchModel(learning_rate=cfg.LEARNING_RATE, image_size=cfg.IMAGE_SIZE, number_of_classes=cfg.NUMBER_OF_CLASSES)
File "/home/nomnom/image-search-engine/model.py", line 20, in init
tf.reset_default_graph()
AttributeError: module 'tensorflow' has no attribute 'reset_default_graph'

Tensorflow version problem

Some tensorflow functions does not work but the code below solves the issue

import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

please make a video

can u please make a video on how to download and setup the project and run please very eager to learn about this project!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.