A newer version of the Streamlit SDK is available:
1.52.2
title: Image
emoji: π
colorFrom: red
colorTo: red
sdk: streamlit
sdk_version: 1.42.2
app_file: app.py
pinned: false
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
This documentation provides a detailed overview of the CLIP-based Image & Text Search App using Streamlit as the frontend and Pinecone for vector-based image retrieval.
This project enables text-to-image and image-to-image search using OpenAIβs CLIP model. It retrieves similar images from a Pinecone vector database.
Text-to-Image Search β Find images using text descriptions. Image-to-Image Search β Upload an image to find visually similar images. CLIP Model Integration β Uses OpenAI's CLIP (Contrastive Language-Image Pretraining). Pinecone for Vector Search β Stores and retrieves image embeddings efficiently. Streamlit Interface β Provides an interactive UI.
Ensure you have installed python installed pip install -r requirements.txt
start run the streamlit streamlit run app.py
- Load CLIP Model & Processor β Initializes the CLIP model for text and image embeddings.
- Generate Embeddings β Converts input text/images into 768-dimensional feature vectors.
- Query Pinecone Database β Searches the Pinecone index for similar image embeddings.
- Display Results β Shows matching images with similarity scores.
This file contains:
UI Setup β Configures Streamlit layout & sidebar controls. CLIP Model Initialization β Loads the pre-trained CLIP model. Embedding Generation β Converts text and images into numerical vectors. Pinecone Search Queries β Finds similar images based on embeddings. Display Results β Shows search results in a grid layout.
- Set Up Streamlit UI
- Initialize Pinecone
- Load CLIP Model & Processor
- Sidebar for Input Controls
- Text Search Processing
- Image Search Processing
- Function to Generate Text Embeddings
- Function to Generate Image Embeddings
- Pinecone Query to Find Similar Images
- Displaying Search Results
- Deployment on Hugging Face
After deploying in hugging face the file runs and give the streamlit page of the CLIP-based Image & Text Search App.