Update README.md
Browse files
README.md
CHANGED
|
@@ -1,12 +1,81 @@
|
|
| 1 |
---
|
| 2 |
title: Visual Product Matcher
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
colorTo: pink
|
| 6 |
sdk: docker
|
| 7 |
-
|
| 8 |
-
license: mit
|
| 9 |
-
short_description: Backend to call
|
| 10 |
---
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: Visual Product Matcher
|
| 3 |
+
emoji: ποΈ
|
| 4 |
+
colorFrom: blue
|
| 5 |
colorTo: pink
|
| 6 |
sdk: docker
|
| 7 |
+
app_port: 7860
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
+
# ποΈ Visual Product Matcher β StyleSense
|
| 11 |
+
|
| 12 |
+
π **Visual Product Matcher** is a FastAPI-based backend deployed on Hugging Face Spaces.
|
| 13 |
+
It uses **CLIP (ViT-B/32)** embeddings + **FAISS** to find visually similar products from a catalog.
|
| 14 |
+
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
## π Endpoints
|
| 18 |
+
|
| 19 |
+
### `GET /`
|
| 20 |
+
Health check β returns a status message.
|
| 21 |
+
|
| 22 |
+
**Example Response:**
|
| 23 |
+
```json
|
| 24 |
+
{
|
| 25 |
+
"message": "π Visual Product Matcher API is running!"
|
| 26 |
+
}
|
| 27 |
+
POST /search_text
|
| 28 |
+
Search products by text query.
|
| 29 |
+
|
| 30 |
+
Form Data Params:
|
| 31 |
+
|
| 32 |
+
query (str, required) β Your search text
|
| 33 |
+
|
| 34 |
+
top_k (int, default=5) β Number of results
|
| 35 |
+
|
| 36 |
+
min_score (float, default=0.0) β Similarity threshold
|
| 37 |
+
|
| 38 |
+
Example:
|
| 39 |
+
|
| 40 |
+
bash
|
| 41 |
+
Copy code
|
| 42 |
+
curl -X POST https://Yashashvibhardwaj-Visual_product_matcher.hf.space/search_text \
|
| 43 |
+
-F "query=red sneakers" \
|
| 44 |
+
-F "top_k=5"
|
| 45 |
+
POST /match
|
| 46 |
+
Search products by image (upload or URL).
|
| 47 |
+
|
| 48 |
+
Form Data Params:
|
| 49 |
+
|
| 50 |
+
file (UploadFile, optional) β Image file
|
| 51 |
+
|
| 52 |
+
image_url (str, optional) β Image URL
|
| 53 |
+
|
| 54 |
+
top_k (int, default=5) β Number of results
|
| 55 |
+
|
| 56 |
+
min_score (float, default=0.0) β Similarity threshold
|
| 57 |
+
|
| 58 |
+
Example with URL:
|
| 59 |
+
|
| 60 |
+
bash
|
| 61 |
+
Copy code
|
| 62 |
+
curl -X POST https://Yashashvibhardwaj-Visual_product_matcher.hf.space/match \
|
| 63 |
+
-F "image_url=https://images.unsplash.com/photo-1542291026-7eec264c27ff" \
|
| 64 |
+
-F "top_k=5"
|
| 65 |
+
Example with file:
|
| 66 |
+
|
| 67 |
+
bash
|
| 68 |
+
Copy code
|
| 69 |
+
curl -X POST https://Yashashvibhardwaj-Visual_product_matcher.hf.space/match \
|
| 70 |
+
-F "file=@example.jpg" \
|
| 71 |
+
-F "top_k=5"
|
| 72 |
+
βοΈ Tech Stack
|
| 73 |
+
FastAPI β API framework
|
| 74 |
+
|
| 75 |
+
Sentence-Transformers (CLIP ViT-B/32) β for embeddings
|
| 76 |
+
|
| 77 |
+
FAISS β similarity search
|
| 78 |
+
|
| 79 |
+
Docker β containerized deployment
|
| 80 |
+
|
| 81 |
+
Hugging Face Spaces β hosting
|