GithubHelp home page GithubHelp logo

sandrobarna / image_search_demo Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 37.05 MB

Demo project showing semantic text2image search using vector database

Dockerfile 0.01% Python 0.09% Jupyter Notebook 99.89% HTML 0.02%

image_search_demo's Introduction

Image Search using Text

Description

This is demo project showcasing image similarity search using text queries. Project uses CLIP model for text/image embeddings Qdrant vector database for KNN search.

Architecture

The app contains following components:

  • Qdrant service (runs locally)
  • Similarity search backend (see backend folder in repo) that computes embeddings and communicates with qdrant service
  • FastAPI based REST API and HTML frontend
    • For demo purposes, functionality is limited to K-NN search only (adding/editing existing images isn't supported from web)

How to Use

  1. Clone the Repository:
    git clone https://github.com/sandrobarna/image_search_demo.git
    
  2. Download Data:

Embedding model weights, test images as well as Qdrant's collection pre-populated with those image vectors need to be downloaded and mapped to respective docker volumes. Download it from HERE.

  1. Spin-up services:

    There is a docker-compose file in repo which spins up Qdrant service (default port 6333), jupyter notebook (default port 1235) for playing with exploratory data analysis (backend/notebooks/exploratory_analysis.ipynb) and FastAPI server (default port 2222) for using HTML frontend.

    You need to map embedding_model and images subfolders (from the data downloaded in step 2) to /searchapp_data docker volume as shown below (in docker-compose.yaml).

     volumes:
       - ./data/embedding_model:/searchapp_data/embedding_model # embedding model weights
       - ./data/images:/searchapp_data/images # folder containing images
    

    Now map Qdrant's storage folder qdrant_storage (also from the data downloaded in step 2)

    volumes:
       - ./data/qdrant_storage:/qdrant/storage # qdrant storage (already contains demo collection pre-populated with images)
    

    Modify default ports for jupyter or webapp if you wish in docker-compose.yaml

    Once all set, run following to fire up:
    docker-compose up
  2. Access Web App:

    Open web browser and go to one of the following, as you wish:

    • localhost:2222 to try out demo webapp
    • localhost:1235 to go to Jupyter. You can play with backend/notebooks/exploratory_analysis.ipynb in order to see some good/bad query examples as well as some data stats. Jupyter secret token can be copied from docker-compose logs printing in terminal
    • localhost:6333/dashboard to go to Qdrant's dashboard

image_search_demo's People

Contributors

sandrobarna avatar

Watchers

 avatar

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.