This repository provides the implementation of Outfit Transformer, a model designed for fashion recommendation, inspired by:
Rohan Sarkar et al. Outfit Transformer: Outfit Representations for Fashion Recommendation. CVPR 2023.
Our implementation faithfully reproduces the original paper’s method while introducing key improvements for enhanced performance and efficiency.
✅ Enhanced Performance: Upgraded the backbone architecture for better accuracy and generalization.
✅ Faster Training: Precomputes item features, significantly reducing computational overhead.
✅ Refined CIR Task: Eliminates data leakage from item descriptions/categories and replaces them with learnable embeddings, making the model more robust.
Model | CP (AUC) | FITB (Accuracy) |
---|---|---|
Type-Aware | 0.86 | 57.83 |
SCE-Net | 0.91 | 59.07 |
CSA-Net | 0.91 | 63.73 |
OutfitTransformer (Paper) | 0.93 | 67.10 |
OutfitTransformer (Our Impl.) | 0.93 | 67.02 |
OutfitTransformer (Our Impl. + CLIP) | 0.95 (SOTA, ↑0.02) |
69.24 (SOTA, ↑2.14) |
conda create -n outfit-transformer python=3.12.4
conda activate outfit-transformer
conda env update -f environment.yml
mkdir -p datasets
gdown --id 1ox8GFHG8iMs64iiwITQhJ47dkQ0Q7SBu -O polyvore.zip
unzip polyvore.zip -d ./datasets/polyvore
rm polyvore.zip
mkdir -p checkpoints
gdown --id 1mzNqGBmd8UjVJjKwVa5GdGYHKutZKSSi -O checkpoints.zip
unzip checkpoints.zip -d ./checkpoints
rm checkpoints.zip
Before proceeding with training, make sure to precompute the CLIP embeddings, as all subsequent steps rely on these precomputed features.
python -m src.run.1_generate_clip_embeddings
Train the model for the Compatibility Prediction (CP) task.
python -m src.run.2_train_compatibility \
--wandb_key $YOUR/WANDB/API/KEY
python -m src.run.2_test_compatibility \
--checkpoint $PATH/TO/LOAD/MODEL/.PT/FILE
After completing Step 1, use the best checkpoint from the Compatibility Prediction task to train for the Complementary Item Retrieval (CIR) task.
python -m src.run.3_train_complementary \
--wandb_key $YOUR/WANDB/API/KEY \
--checkpoint $PATH/TO/LOAD/MODEL/.PT/FILE
python -m src.run.3_test_complemenatry \
--checkpoint $PATH/TO/LOAD/MODEL/.PT/FILE
Follow the steps below to run the demo:
python -m src.demo.1_generate_rec_embeddings \
--checkpoint $PATH/OF/MODEL/.PT/FILE
python -m src.demo.2_build_index
python -m src.demo.3_run \
--checkpoint $PATH/OF/MODEL/.PT/FILE
This is a non-official implementation of the Outfit Transformer model. The official repository has not been released yet.
This project is licensed under the MIT License. See the LICENSE file for more details.
If you use this repository, please mention the original GitHub repository by linking to outfit-transformer. This helps support the project and acknowledges the contributors.