A revolutionary fashion recommendation system that leverages knowledge graphs, computer vision, and social media intelligence to provide personalized "Complete the Look" suggestions. This system goes beyond traditional collaborative filtering by incorporating real-world fashion trends from social media, creating a dynamic knowledge graph that captures complex relationships between fashion items.
Want to understand how this system works under the hood?
๐ Read our comprehensive technical blog post that explains:
๐ Quick Implementation Overview - High-level technical summary
The blog post provides detailed technical explanations, while this README focuses on practical usage and setup.
The system consists of several interconnected components:
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Social Media โ โ Catalog Data โ โ User Input โ
โ Images โ โ โ โ โ
โโโโโโโโโโโฌโโโโโโโโ โโโโโโโโโโโฌโโโโโโโโ โโโโโโโโโโโฌโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Image Processing Pipeline โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โ Segmentationโ โ Attribute โ โ Embedding โ โ
โ โ Model โ โ Extraction โ โ Model โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Knowledge Graph (Neo4j) โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โ Product โ โ Relations โ โ Attributes โ โ
โ โ Nodes โ โ Edges โ โ โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Vector Database (Pinecone) โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โ Image โ โ Style โ โ Semantic โ โ
โ โ Embeddings โ โ Embeddings โ โ Search โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Recommendation Engine โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โ Graph Query โ โ Vector โ โ Hybrid โ โ
โ โ Traversal โ โ Similarity โ โ Ranking โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Streamlit Interface โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โ Complete โ โ Style โ โ Attribute โ โ
โ โ the Look โ โ Matching โ โ Extraction โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Clone the Repository
git clone https://github.com/ashleyashok/fashion-knowledge-graph.git
cd fashion-knowledge-graph
Install Dependencies
poetry install
Set Up Environment Variables
cp .env.template .env
# Edit .env with your API keys and database credentials
Prepare Your Data
output/data/catalog_combined.csvproduct_id, image_path, categoryInitialize Databases
# Create Pinecone indexes
python scripts/setup_pinecone.py
# Process catalog data
python src/engine/process_catalog.py
Launch the Application
poetry run streamlit run app/main.py
Clone the Repository
git clone https://github.com/ashleyashok/fashion-knowledge-graph.git
cd fashion-knowledge-graph
Install Dependencies
pip install -r requirements.txt
Set Up Environment Variables
cp .env.template .env
# Edit .env with your API keys and database credentials
Launch the Application
streamlit run app/main.py
Create a .env file with the following variables:
# Neo4j Database
NEO4J_URI=bolt://localhost:7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=your_password
# Pinecone Vector Database
PINECONE_API_KEY=your_pinecone_api_key
PINECONE_HOST_IMAGE=your_image_index_host
PINECONE_HOST_STYLE=your_style_index_host
# Azure OpenAI
AZURE_OPENAI_API_KEY=your_azure_openai_key
AZURE_OPENAI_ENDPOINT=your_azure_openai_endpoint
AZURE_OPENAI_API_VERSION=2024-02-15-preview
# Model Configuration (optional - defaults provided)
SEGMENTATION_MODEL=sayeed99/segformer_b3_clothes
EMBEDDING_MODEL=Marqo/marqo-fashionCLIP
TEXT_EMBEDDING_MODEL=all-MiniLM-L6-v2
The system uses several pre-trained models:
sayeed99/segformer_b3_clothes for clothing item detectionMarqo/marqo-fashionCLIP for visual similarityall-MiniLM-L6-v2 for textual similarityBefore using the system, you need to process your product catalog:
python src/engine/process_catalog.py
This will:
To enrich the knowledge graph with real-world fashion combinations:
python src/engine/process_social_media_images.py
This will:
The application provides three main features:
Product Attribute Extraction
Complete the Look
Style Matching
complete-the-look/
โโโ app/
โ โโโ main.py # Streamlit application
โโโ src/
โ โโโ config/
โ โ โโโ settings.py # Centralized configuration management
โ โโโ models/
โ โ โโโ base_model.py # Abstract base classes for models
โ โ โโโ segmentation_model.py # Image segmentation
โ โ โโโ embedding_model.py # Embedding generation
โ โ โโโ model_manager.py # Model lifecycle management
โ โ โโโ attribute_extraction_model.py
โ โโโ database/
โ โ โโโ graph_database.py # Neo4j handler
โ โ โโโ vector_database.py # Pinecone handler
โ โโโ inference/
โ โ โโโ recommender.py # Recommendation engine
โ โ โโโ product_attributes.py
โ โโโ engine/
โ โ โโโ image_processor.py # Core image processing orchestration
โ โ โโโ process_catalog.py # Catalog data processing
โ โ โโโ process_social_media_images.py # Social media analysis
โ โโโ utils/
โ โโโ models.py # Data models and schemas
โ โโโ prompts.py # LLM prompts
โ โโโ tools.py # Utility functions
โโโ assets/
โ โโโ images/ # Project images and diagrams
โโโ output/
โ โโโ data/
โ โโโ catalog_combined.csv # Catalog data file
โโโ temp_images/ # Temporary image storage
โโโ scripts/ # Setup and utility scripts
โโโ docs/ # Documentation
โโโ tests/ # Test files
โโโ README.md # This file
โโโ BLOG_POST.md # Technical blog post
โโโ pyproject.toml # Poetry configuration
โโโ .env # Environment variables
# Install test dependencies
poetry install --with dev
# Run tests
poetry run pytest
# Run with coverage
poetry run pytest --cov=src
# Run specific test file
poetry run pytest tests/test_recommender.py
# Format code
poetry run black src/ app/
# Lint code
poetry run flake8 src/ app/
# Type checking
poetry run mypy src/ app/
The fashion dataset contains 10,000+ images and is managed with Git LFS for efficient storage and retrieval.
# Clone with LFS files (recommended)
git lfs clone https://github.com/ashleyashok/fashion-knowledge-graph.git
# Or clone normally and pull LFS files
git clone https://github.com/ashleyashok/fashion-knowledge-graph.git
cd fashion-knowledge-graph
git lfs pull
dataset/
โโโ catalog_images/ # Product catalog images
โโโ social_media_images/ # Social media fashion images
โโโ test_images/ # Test and validation images
โโโ metadata/ # Image metadata and annotations
We welcome contributions! Please follow these guidelines:
git checkout -b feature/amazing-featuregit commit -m 'Add amazing feature'git push origin feature/amazing-feature# Clone and setup
git clone https://github.com/ashleyashok/fashion-knowledge-graph.git
cd fashion-knowledge-graph
# Install development dependencies
poetry install --with dev
# Setup pre-commit hooks
poetry run pre-commit install
# Run tests
poetry run pytest
This project is licensed under the MIT License - see the LICENSE file for details.
โญ Star this repository if you find it useful!
Questions?
36 commits
Python
100.0%
A revolutionary fashion recommendation system that leverages knowledge graphs, computer vision, and social media intelligence to provide personalized "Complete the Look" suggestions. This system goes beyond traditional collaborative filtering by incorporating real-world fashion trends from social media, creating a dynamic knowledge graph that captures complex relationships between fashion items.
Want to understand how this system works under the hood?
๐ Read our comprehensive technical blog post that explains:
๐ Quick Implementation Overview - High-level technical summary
The blog post provides detailed technical explanations, while this README focuses on practical usage and setup.
The system consists of several interconnected components:
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Social Media โ โ Catalog Data โ โ User Input โ
โ Images โ โ โ โ โ
โโโโโโโโโโโฌโโโโโโโโ โโโโโโโโโโโฌโโโโโโโโ โโโโโโโโโโโฌโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Image Processing Pipeline โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โ Segmentationโ โ Attribute โ โ Embedding โ โ
โ โ Model โ โ Extraction โ โ Model โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Knowledge Graph (Neo4j) โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โ Product โ โ Relations โ โ Attributes โ โ
โ โ Nodes โ โ Edges โ โ โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Vector Database (Pinecone) โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โ Image โ โ Style โ โ Semantic โ โ
โ โ Embeddings โ โ Embeddings โ โ Search โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Recommendation Engine โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โ Graph Query โ โ Vector โ โ Hybrid โ โ
โ โ Traversal โ โ Similarity โ โ Ranking โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Streamlit Interface โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โ Complete โ โ Style โ โ Attribute โ โ
โ โ the Look โ โ Matching โ โ Extraction โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Clone the Repository
git clone https://github.com/ashleyashok/fashion-knowledge-graph.git
cd fashion-knowledge-graph
Install Dependencies
poetry install
Set Up Environment Variables
cp .env.template .env
# Edit .env with your API keys and database credentials
Prepare Your Data
output/data/catalog_combined.csvproduct_id, image_path, categoryInitialize Databases
# Create Pinecone indexes
python scripts/setup_pinecone.py
# Process catalog data
python src/engine/process_catalog.py
Launch the Application
poetry run streamlit run app/main.py
Clone the Repository
git clone https://github.com/ashleyashok/fashion-knowledge-graph.git
cd fashion-knowledge-graph
Install Dependencies
pip install -r requirements.txt
Set Up Environment Variables
cp .env.template .env
# Edit .env with your API keys and database credentials
Launch the Application
streamlit run app/main.py
Create a .env file with the following variables:
# Neo4j Database
NEO4J_URI=bolt://localhost:7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=your_password
# Pinecone Vector Database
PINECONE_API_KEY=your_pinecone_api_key
PINECONE_HOST_IMAGE=your_image_index_host
PINECONE_HOST_STYLE=your_style_index_host
# Azure OpenAI
AZURE_OPENAI_API_KEY=your_azure_openai_key
AZURE_OPENAI_ENDPOINT=your_azure_openai_endpoint
AZURE_OPENAI_API_VERSION=2024-02-15-preview
# Model Configuration (optional - defaults provided)
SEGMENTATION_MODEL=sayeed99/segformer_b3_clothes
EMBEDDING_MODEL=Marqo/marqo-fashionCLIP
TEXT_EMBEDDING_MODEL=all-MiniLM-L6-v2
The system uses several pre-trained models:
sayeed99/segformer_b3_clothes for clothing item detectionMarqo/marqo-fashionCLIP for visual similarityall-MiniLM-L6-v2 for textual similarityBefore using the system, you need to process your product catalog:
python src/engine/process_catalog.py
This will:
To enrich the knowledge graph with real-world fashion combinations:
python src/engine/process_social_media_images.py
This will:
The application provides three main features:
Product Attribute Extraction
Complete the Look
Style Matching
complete-the-look/
โโโ app/
โ โโโ main.py # Streamlit application
โโโ src/
โ โโโ config/
โ โ โโโ settings.py # Centralized configuration management
โ โโโ models/
โ โ โโโ base_model.py # Abstract base classes for models
โ โ โโโ segmentation_model.py # Image segmentation
โ โ โโโ embedding_model.py # Embedding generation
โ โ โโโ model_manager.py # Model lifecycle management
โ โ โโโ attribute_extraction_model.py
โ โโโ database/
โ โ โโโ graph_database.py # Neo4j handler
โ โ โโโ vector_database.py # Pinecone handler
โ โโโ inference/
โ โ โโโ recommender.py # Recommendation engine
โ โ โโโ product_attributes.py
โ โโโ engine/
โ โ โโโ image_processor.py # Core image processing orchestration
โ โ โโโ process_catalog.py # Catalog data processing
โ โ โโโ process_social_media_images.py # Social media analysis
โ โโโ utils/
โ โโโ models.py # Data models and schemas
โ โโโ prompts.py # LLM prompts
โ โโโ tools.py # Utility functions
โโโ assets/
โ โโโ images/ # Project images and diagrams
โโโ output/
โ โโโ data/
โ โโโ catalog_combined.csv # Catalog data file
โโโ temp_images/ # Temporary image storage
โโโ scripts/ # Setup and utility scripts
โโโ docs/ # Documentation
โโโ tests/ # Test files
โโโ README.md # This file
โโโ BLOG_POST.md # Technical blog post
โโโ pyproject.toml # Poetry configuration
โโโ .env # Environment variables
# Install test dependencies
poetry install --with dev
# Run tests
poetry run pytest
# Run with coverage
poetry run pytest --cov=src
# Run specific test file
poetry run pytest tests/test_recommender.py
# Format code
poetry run black src/ app/
# Lint code
poetry run flake8 src/ app/
# Type checking
poetry run mypy src/ app/
The fashion dataset contains 10,000+ images and is managed with Git LFS for efficient storage and retrieval.
# Clone with LFS files (recommended)
git lfs clone https://github.com/ashleyashok/fashion-knowledge-graph.git
# Or clone normally and pull LFS files
git clone https://github.com/ashleyashok/fashion-knowledge-graph.git
cd fashion-knowledge-graph
git lfs pull
dataset/
โโโ catalog_images/ # Product catalog images
โโโ social_media_images/ # Social media fashion images
โโโ test_images/ # Test and validation images
โโโ metadata/ # Image metadata and annotations
We welcome contributions! Please follow these guidelines:
git checkout -b feature/amazing-featuregit commit -m 'Add amazing feature'git push origin feature/amazing-feature# Clone and setup
git clone https://github.com/ashleyashok/fashion-knowledge-graph.git
cd fashion-knowledge-graph
# Install development dependencies
poetry install --with dev
# Setup pre-commit hooks
poetry run pre-commit install
# Run tests
poetry run pytest
This project is licensed under the MIT License - see the LICENSE file for details.
โญ Star this repository if you find it useful!
Questions?
36 commits
Python
100.0%