Skip to content

ArtmeScienceLab/AnyFashionAttributeEditing

Repository files navigation

Any Fashion Attribute Editing: Dataset and Pretrained Models (TPAMI 2025)

Shumin Zhu · Xingxing Zou · Wenhan Yang · Waikeung Wong

Why

Quick View

Why

Our main contributions are as follows:

$\bullet$ We present the Any Fashion Editing Dataset (AFED), which comprises 830,000 high-quality full-body fashion images from two distinct domains.

$\bullet$ We propose Twin-Net, a GAN-based framework for high-quality fashion image inversion and editing.

$\bullet$ We design PairsPCA, a method capable of consistently mining the clear mapping relationship between latent and semantic meanings.


This work focuses on `any' fashion attribute editing: 1) the ability to edit 78 fine-grained design attributes commonly observed in daily life; 2) the capability to modify desired attributes while keeping the rest of the components still; and 3) the flexibility to continuously edit the edited image. Comprehensive experiments, including comparisons with ten state-of-the-art image inversion methods and four editing algorithms, demonstrate the effectiveness of our Twin-Net and editing algorithm.

Logo

Get Started

The environment setting for GAN-based models is a relatively old version compared to the current diffusion model. We have compared our results with numerous baselines and written these codes under various environmental settings at different times, respectively. In the version uploaded, we have organised all the code within a single environment (CUDA Toolkit version is 11.7, the operating system is 22.04, and the driver version is 570.133.07) for ease usage. To ensure the code runs smoothly, we recommend following steps, which have been verified to work before uploading. If there are still some bugs, please refer to the original repositories of those baselines.

Quick start:

conda create -n twinnet python=3.8.20

conda activate twinnet

conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge

pip install matplotlib tensorboard opencv-python imageio

To train:

bash train.sh

To test:

python inference_pairpca_editing.py rate=0 reconstruction rate>0 editing

Evaluation:

bash recon_metrics.sh msssim  lpips mse

bash fid.sh

bash kid.sh

Resources

-【Obtain AFED】The AFED dataset consists of three sub-datasets, as illustrated in the Figure below. It includes 300,000 (a) solid-colour women's clothing sketches (AFED-S-Colour), 300,000 (b) printed men's clothing sketches (AFED-S-Print), and 230,000 (c) human fashion images (AFED-H-Product). For the AFED-S-Colour and AFED-S-Print, the data were generated using a mature pipeline AiDA, which was previously utilised to create full-body sketch images with fine-grained fashion attributes. Generating these sketches required approximately 250 hours on a single NVIDIA GeForce GTX 3090 GPU. Regarding the AFED-H-Product, we initially collected over 1,000,000 raw fashion images from the internet, encompassing various clothing styles and fine-grained attributes. The manual collection process is hindered by its slow pace and high costs. For reference, a team of four carried out this collection manually over a year, averaging 4,800 images per week.

Logo

-【Pretrained Models】A total of 14 baselines were compared, including seven GAN inversion methods, three diffusion-based editing methods, and four GAN-based attribute editing methods. We trained 27 models across three datasets, comprising StyleGAN models and models for eight GAN inversion methods (including Twin-Net).

Citation

@article{zhu2025any,
  title={Any Fashion Attribute Editing: Dataset and Pretrained Models},
  author={Zhu, Shumin and Zou, Xingxing and Yang, Wenhan and Wong, Wai Keung},
  journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
  year={2025},
  publisher={IEEE}
}

Acknowledgments

This implementation is built based on StyleGAN2, StyleGAN-Human, encoder4editing, HFGI.

This work is partially supported by the Laboratory for Artificial Intelligence in Design (AiDLab)(Project Code: RP3-1), Innovation and Technology Fund, Hong Kong, SAR. This work is also partially supported by a grant from the Research Grants Council of the Hong Kong, SAR(Project No. PolyU/RGC Project PolyU 25211424).


About

[TPAMI 2025] Any fashion attribute editing: Dataset and pretrained models

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors