A production-grade multimodal visual search system for cross-border e-commerce products. Search a large product catalog by image, text, or image + text — powered by state-of-the-art multimodal embeddings and vector retrieval.
graph LR
A[Gradio UI<br/>Upload / Text] -->|query| B[Search Engine]
B -->|encode| C[Visualized_BGE<br/>Multimodal Embeddings]
C -->|vector| B
B -->|ANN search| D[Milvus Lite<br/>Vector Database]
D -->|top-K results| B
B -->|results| A
E[Amazon Products<br/>Dataset] -->|offline indexing| F[Batch Encoder]
F -->|embeddings + metadata| D
| Component | Technology | Why |
|---|---|---|
| Embedding Model | Visualized_BGE (BAAI/bge-base-en-v1.5 + visual weights) | Multimodal: image, text, and image+text encoding |
| Vector Database | Milvus Lite (pymilvus) | Enterprise-grade vector DB, pip-installable, COSINE similarity |
| Frontend | Gradio | Rapid prototyping, image upload, shareable link |
| Dataset | ckandemir/amazon-products | 33K Amazon products with images, titles, categories |
| ML Framework | PyTorch + Transformers | GPU-accelerated inference |
# Clone the repo
git clone <repo-url>
cd ecommerce-visual-search
# Using uv (recommended)
uv sync
# Or using pip
pip install -r requirements.txt
# Download Visualized_BGE model weights (~350MB)
uv run python models/download_model.py
# Download product dataset + images (default: 5000 products)
uv run python data/download_dataset.py --limit 1000
# Encode all products and build vector index
uv run python indexing/build_index.py
# Start Gradio web interface
uv run python app/gradio_app.py
# Open http://localhost:7860 in your browser
ecommerce-visual-search/
├── config.py # Centralized configuration (paths, model, Milvus, constants)
├── requirements.txt # Python dependencies
│
├── data/
│ ├── download_dataset.py # HuggingFace dataset download + batch image download
│ └── images/ # Downloaded product images (gitignored)
│
├── models/
│ ├── download_model.py # Download Visualized_BGE weights from HuggingFace
│ └── weights/ # Model weights (gitignored)
│
├── indexing/
│ ├── encoder.py # MultimodalEncoder: encode(image, text) → 768-dim vector
│ └── build_index.py # Batch encode + insert into Milvus with metadata
│
├── search/
│ └── search_engine.py # SearchEngine: image_search / text_search / multimodal_search
│
├── app/
│ └── gradio_app.py # Gradio demo: 3 tabs with gallery + similarity scores
│
├── scripts/
│ └── evaluate.py # Retrieval evaluation: Recall@1, @5, @10
│
└── .gitignore
Upload a product photo → The system encodes it using Visualized_BGE's image encoder → Finds the most visually similar products in the database via cosine similarity.
Enter a text description like "wireless bluetooth headphones" → Encoded into the same vector space as product images → Retrieves semantically matching products.
Combine an image with a text modifier. For example:
This works because Visualized_BGE fuses image and text features into a single embedding.
All configuration is centralized in config.py:
| Parameter | Default | Description |
|---|---|---|
DEFAULT_IMAGE_LIMIT | 5000 | Number of product images to download |
EMBEDDING_DIM | 768 | BGE-base embedding dimension |
MILVUS_BATCH_SIZE | 100 | Batch size for Milvus insertion |
DEFAULT_TOP_K | 10 | Default number of search results |
METRIC_TYPE | COSINE | Vector similarity metric |
IMAGE_DOWNLOAD_WORKERS | 8 | Concurrent image download threads |
MIT
Python
100.0%
A production-grade multimodal visual search system for cross-border e-commerce products. Search a large product catalog by image, text, or image + text — powered by state-of-the-art multimodal embeddings and vector retrieval.
graph LR
A[Gradio UI<br/>Upload / Text] -->|query| B[Search Engine]
B -->|encode| C[Visualized_BGE<br/>Multimodal Embeddings]
C -->|vector| B
B -->|ANN search| D[Milvus Lite<br/>Vector Database]
D -->|top-K results| B
B -->|results| A
E[Amazon Products<br/>Dataset] -->|offline indexing| F[Batch Encoder]
F -->|embeddings + metadata| D
| Component | Technology | Why |
|---|---|---|
| Embedding Model | Visualized_BGE (BAAI/bge-base-en-v1.5 + visual weights) | Multimodal: image, text, and image+text encoding |
| Vector Database | Milvus Lite (pymilvus) | Enterprise-grade vector DB, pip-installable, COSINE similarity |
| Frontend | Gradio | Rapid prototyping, image upload, shareable link |
| Dataset | ckandemir/amazon-products | 33K Amazon products with images, titles, categories |
| ML Framework | PyTorch + Transformers | GPU-accelerated inference |
# Clone the repo
git clone <repo-url>
cd ecommerce-visual-search
# Using uv (recommended)
uv sync
# Or using pip
pip install -r requirements.txt
# Download Visualized_BGE model weights (~350MB)
uv run python models/download_model.py
# Download product dataset + images (default: 5000 products)
uv run python data/download_dataset.py --limit 1000
# Encode all products and build vector index
uv run python indexing/build_index.py
# Start Gradio web interface
uv run python app/gradio_app.py
# Open http://localhost:7860 in your browser
ecommerce-visual-search/
├── config.py # Centralized configuration (paths, model, Milvus, constants)
├── requirements.txt # Python dependencies
│
├── data/
│ ├── download_dataset.py # HuggingFace dataset download + batch image download
│ └── images/ # Downloaded product images (gitignored)
│
├── models/
│ ├── download_model.py # Download Visualized_BGE weights from HuggingFace
│ └── weights/ # Model weights (gitignored)
│
├── indexing/
│ ├── encoder.py # MultimodalEncoder: encode(image, text) → 768-dim vector
│ └── build_index.py # Batch encode + insert into Milvus with metadata
│
├── search/
│ └── search_engine.py # SearchEngine: image_search / text_search / multimodal_search
│
├── app/
│ └── gradio_app.py # Gradio demo: 3 tabs with gallery + similarity scores
│
├── scripts/
│ └── evaluate.py # Retrieval evaluation: Recall@1, @5, @10
│
└── .gitignore
Upload a product photo → The system encodes it using Visualized_BGE's image encoder → Finds the most visually similar products in the database via cosine similarity.
Enter a text description like "wireless bluetooth headphones" → Encoded into the same vector space as product images → Retrieves semantically matching products.
Combine an image with a text modifier. For example:
This works because Visualized_BGE fuses image and text features into a single embedding.
All configuration is centralized in config.py:
| Parameter | Default | Description |
|---|---|---|
DEFAULT_IMAGE_LIMIT | 5000 | Number of product images to download |
EMBEDDING_DIM | 768 | BGE-base embedding dimension |
MILVUS_BATCH_SIZE | 100 | Batch size for Milvus insertion |
DEFAULT_TOP_K | 10 | Default number of search results |
METRIC_TYPE | COSINE | Vector similarity metric |
IMAGE_DOWNLOAD_WORKERS | 8 | Concurrent image download threads |
MIT
Python
100.0%