image / README.md
tharu22's picture
new
5ad91bd

A newer version of the Streamlit SDK is available: 1.52.2

Upgrade
metadata
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.

  1. Ensure you have installed python installed pip install -r requirements.txt

  2. start run the streamlit streamlit run app.py

  1. Load CLIP Model & Processor – Initializes the CLIP model for text and image embeddings.
  2. Generate Embeddings – Converts input text/images into 768-dimensional feature vectors.
  3. Query Pinecone Database – Searches the Pinecone index for similar image embeddings.
  4. 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.

  1. Set Up Streamlit UI
  2. Initialize Pinecone
  3. Load CLIP Model & Processor
  4. Sidebar for Input Controls
  5. Text Search Processing
  6. Image Search Processing
  7. Function to Generate Text Embeddings
  8. Function to Generate Image Embeddings
  9. Pinecone Query to Find Similar Images
  10. Displaying Search Results
  11. 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.