A machine learning service for image-based auto parts product search. Upload a photo of a car part and get matching products from the catalog.
- Image Search by Upload: Send a product image and receive ranked matching results
- YOLOv8 Part Detection: Automatically detects auto part categories (brake pads, filters, etc.)
- OCR Text Extraction: Reads brand names and part numbers from images using PaddleOCR
- CLIP Image Embeddings: Semantic similarity search via vector embeddings
- FAISS Vector Index: Fast approximate nearest neighbor search for large catalogs
- Dynamic Result Merging: Combines catalog search + vector search with confidence-weighted scoring
- FastAPI - Web framework
- YOLOv8 (Ultralytics) - Object detection for part types
- PaddleOCR - Optical character recognition
- OpenAI CLIP - Image/text embeddings
- BGE-M3 - Text embeddings for semantic search
- FAISS - Vector similarity search
- PyTorch - ML backend
-
Clone and setup environment:
git clone https://github.com/services-management/image-search.git cd image-search python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate pip install -r requirements.txt
-
Configure environment:
cp .env.example .env # Edit .env with your settings -
Run the service:
uvicorn app.main:app --reload --port 8001
docker-compose up -dThe service will be available at http://localhost:8001.
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Service info |
/health |
GET | Health check |
/api/v1/search-by-image |
POST | Search products by image upload |
/api/v1/index-product |
POST | Add a product image to the search index |
/api/v1/rebuild-index |
POST | Rebuild the FAISS index from catalog |
/api/v1/index/stats |
GET | FAISS index statistics |
/api/v1/brands |
GET | List known auto part brands |
/api/v1/categories |
GET | List supported part categories |
curl -X POST http://localhost:8001/api/v1/search-by-image \
-F "file=@brake_pad.jpg" \
-F "top_k=10"pytestapp/ # FastAPI application
pipeline/ # ML pipelines (YOLO, OCR, CLIP, embeddings)
search/ # FAISS index, catalog client, result merger
tests/ # Test suite
scripts/ # Training and utility scripts
See .env.example for all available configuration options.
Private - services-management