owj0421 / OutfitTransformer

Implementation of "Outfit Transformer:Outfit Representations for Fashion Recommendation"
Apache License 2.0
31 stars 9 forks source link
fashion fashion-compatibility fashion-recommendation fashionai outfit-transformer polyvore recommendation

Outfit-Transformer

๐Ÿค— Introduction

Implementation of paper - Outfit Transformer: Outfit Representations for Fashion Recommendation

โš ๏ธ The original paper outlines the specifics of the target item for Compatitible Item Retrieval (CIR) and Fill-in-the-Blank (FITB). Nonetheless, for the sake of impartial evaluation alongside other models, this information was intentionally excluded. (Should a dataset emerge that necessitates the prediction of a matching item when presented with a description unrelated to the target item itself, the model will be retrained accordingly.)

๐ŸŽฏ Performance

The figures below are derived using the Polyvore test dataset.

|Model|CP(AUC)|FITB(Accuracy)|CIR(Recall@10)| |:-|-:|-:|-:| |Type-Aware|0.86|57.83|3.50| |SCE-Net|0.91|59.07|5.10| |CSA-Net|0.91|63.73|8.27| |OutfitTransformer(Paper)|0.93|67.10|9.58| |**Implemented
(w/o target desc.)**|**0.91**|**64.10**|Not Trained|

โš™ Install Dependencies

This code is tested with python 3.9.16, torch 1.12.1

python -m pip install -r requirements.txt

๐Ÿงฑ Train

Data Preparation

Download the polyvore dataset from here

Pretraining on CP(Compatibiliby Prediction) task

python train.py --task cp --train_batch 64 --valid_batch 96 --n_epochs 5 --learning_rate 1e-5 --scheduler_step_size 1000 --work_dir $WORK_DIR --data_dir $DATA_DIR --wandb_api_key $WANDB_API_KEY

Finetuning on CIR(Complementary Item Retrival) task

python train.py --task cir --train_batch 64 --valid_batch 96 --n_epochs 5 --learning_rate 1e-5 --scheduler_step_size 1000 --work_dir $WORK_DIR --data_dir $DATA_DIR --wandb_api_key $WANDB_API_KEY --checkpoint $CHECKPOINT

๐Ÿ” Test

python test.py --task $TASK --polyvore_split nondisjoint --test_batch 96 --data_dir $DATA_DIR --checkpoint $CHECKPOINT

๐Ÿงถ Checkpoints

Download the checkpoint from here

๐Ÿ”” Note