Search for similar images using Vertex AI's multimodal embeddings and Faiss.
- It starts by getting all the images from the bucket specified in the
config.storage_bucket
variable. - It then loops through all of the files and generate embeddings for them using Vertex AI's multimodal embeddings.
- The embeddings are then saved in a file which can be modified through the
config.filepath
variable. - The UI is made using Streamlit, when you upload an image in the Streamlit app the script converts the image into embeddings.
- Then a Faiss index is created to perform similarity search over the previously saved embeddings and the embeddings created from the image
- The result is then displayed in the Streamlit app
Note: The config.index_dimensions
variable is set by default to 1408 because the Embeddings for Multimodal multimodalembedding
model generates 1408 dimensions vectors.
- Clone the repository:
git clone https://github.com/ItzCrazyKns/Image-Search.git
- Modify the
config.json
file. - Install required packages:
pip install -r requirements.txt
- Generate embeddings for the images saved in the bucket:
python generateEmbeddings.py
- Run the Streamlit app:
streamlit run main.py
Note: Make sure you're authenticated in the gcloud CLI.