Skip to content

EsraaMadi/similarity-search-weaviate

Repository files navigation

Search for similar products

Vector based image similarity search for product recommendations





This is an application spins up a Weaviate instance to search for similar products across the market. This could help stores to know if their products was also in their competitor’s offering. The app use 62k images of products combined with their text description to build vectors for the data we intend to search.




How to run with your own custom images


Prerequisites to run it yourself



Then follow steps below:


  1. Clone the repository in your local machine

Your local repository would contain sub folder data with the following structure:

data/
|__images/
|    |__(Should contains images files)
|
|__text/
|    |__(Should contains CSV file for description text)
|
|__repo pics/
|    | (ignore this folder)
  • Hint: create data/images, data/text folders if they are not exist (git repository does not keep empty folders)


  1. Add your images to the data/images folder with any format (png, jpg, jpeg)



  1. Add your sheet that has description text of all image to the data/text folder
    • Hint:
      • The current script accepts only csv file (you can change it to accept excel files from script import-data.py)
      • The csv file should has at least 2 columns:
        • id: image name.
        • title: text description for image.

Note: if you would like to use the same images used here in this demo --> use the terminal to navigate in local repository folder then run following command in the terminal:

make download

This command will download around 62k images (~10 GB) as zip file, unzip the downloaded file and paste images as we did in step 3 & 4



  1. Start up Weaviate and import images to the vector database using following command:
make setup



  1. To run the streamlit app, open for your browser at http://localhost:8084