An independent, completely self-hosted Visual Search Engine built with a messaging interface, powered by OpenAI's CLIP model. This project demonstrates how to build a high-performance image matching pipeline from scratch without relying on expensive, cloud-hosted enterprise APIs like Google Vision.
- Zero-Shot Image-to-Image Matching: Upload any image. The system computes 512-dimensional vector embeddings and calculates exact Cosine Similarities against the local inventory database instantly. No data-labeling or fine-tuning required.
- Multi-Reference Robustness: Overcome AI composition bias natively. Add multiple angles of an item (e.g.,
Nike Shirt Front.pngandNike Shirt Back.png), and the API will automatically vector them independently but map them back to the same root inventory count! - Pure Python Microservice: The heavy AI logic is decoupled into a blazing-fast FastAPI backend. It loads the PyTorch CLIP model exactly once directly into memory array for zero-latency image processing.
- 100% Privacy & Independence: Avoid pay-per-request API traps. All inferences run entirely locally on your own hardware using open-source PyTorch models.
- AI / ML Core: PyTorch, OpenAI CLIP (
ViT-B/32) - Backend API: Python, FastAPI, Uvicorn
- Frontend: React, Vite, Axios, pure CSS (Glassmorphism)
Because of the microservice architecture, you must run the Python Backend and the React Frontend simultaneously in two separate terminals.
Open your first terminal and navigate to the backend folder:
cd backend
# Create a fresh virtual environment
python -m venv venv
# Activate it (Windows)
.\venv\Scripts\activate
# Activate it (Mac/Linux)
# source venv/bin/activate
# Install requirements
pip install -r requirements.txt
# Boot up the FastAPI server
python main.pyWait until you see Uvicorn running on http://127.0.0.1:8000
Open your second terminal and navigate to the frontend folder:
cd frontend
# Install Node dependencies
npm install
# Start the Vite development server
npm run devClick the local link (usually http://localhost:5173) to launch the UI in your browser!
- Go to the
backend/inventory_images/folder. - Drop in any
.jpgor.pngimages of your products. The file name will act as the object's label. - Pro-Tip: You can add multiple angles of the same product for incredible accuracy! Just add suffixes like
Jordan Sport Front.pngandJordan Sport Back.png. The backend inherently maps them back to the"jordan sport"stock quantities ininventory.json. - Restart the Python server (
Ctrl+Cthenpython main.py). It will automatically convert everything inside that folder into vector datasets in RAM. - Go to the React frontend, click the
💬 Supportbutton, and upload a test image to see the math in action!