metadata
title: Visual Product Matcher
emoji: ποΈ
colorFrom: blue
colorTo: pink
sdk: docker
app_port: 7860
ποΈ Visual Product Matcher β StyleSense
π Visual Product Matcher is a FastAPI-based backend deployed on Hugging Face Spaces.
It uses CLIP (ViT-B/32) embeddings + FAISS to find visually similar products from a catalog.
π Endpoints
GET /
Health check β returns a status message.
Example Response:
{
"message": "π Visual Product Matcher API is running!"
}
POST /search_text
Search products by text query.
Form Data Params:
query (str, required) β Your search text
top_k (int, default=5) β Number of results
min_score (float, default=0.0) β Similarity threshold
Example:
bash
Copy code
curl -X POST https://Yashashvibhardwaj-Visual_product_matcher.hf.space/search_text \
-F "query=red sneakers" \
-F "top_k=5"
POST /match
Search products by image (upload or URL).
Form Data Params:
file (UploadFile, optional) β Image file
image_url (str, optional) β Image URL
top_k (int, default=5) β Number of results
min_score (float, default=0.0) β Similarity threshold
Example with URL:
bash
Copy code
curl -X POST https://Yashashvibhardwaj-Visual_product_matcher.hf.space/match \
-F "image_url=https://images.unsplash.com/photo-1542291026-7eec264c27ff" \
-F "top_k=5"
Example with file:
bash
Copy code
curl -X POST https://Yashashvibhardwaj-Visual_product_matcher.hf.space/match \
-F "file=@example.jpg" \
-F "top_k=5"
βοΈ Tech Stack
FastAPI β API framework
Sentence-Transformers (CLIP ViT-B/32) β embeddings
FAISS β similarity search
Docker β containerized deployment
Hugging Face Spaces β hosting