• Stars
    star
    398
  • Rank 108,325 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created over 1 year ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

[ACM Multimedia 2023] Taming the Power of Diffusion Models for High-Quality Virtual Try-On with Appearance Flow.

DCI-VTON-Virtual-Try-On

This is the official repository for the following paper:

Taming the Power of Diffusion Models for High-Quality Virtual Try-On with Appearance Flow [arxiv]

Junhong Gou, Siyu Sun, Jianfu Zhang, Jianlou Si, Chen Qian, Liqing Zhang
Accepted by ACM MM 2023.

Overview

Abstract:
Virtual try-on is a critical image synthesis task that aims to transfer clothes from one image to another while preserving the details of both humans and clothes. While many existing methods rely on Generative Adversarial Networks (GANs) to achieve this, flaws can still occur, particularly at high resolutions. Recently, the diffusion model has emerged as a promising alternative for generating high-quality images in various applications. However, simply using clothes as a condition for guiding the diffusion model to inpaint is insufficient to maintain the details of the clothes. To overcome this challenge, we propose an exemplar-based inpainting approach that leverages a warping module to guide the diffusion model's generation effectively. The warping module performs initial processing on the clothes, which helps to preserve the local details of the clothes. We then combine the warped clothes with clothes-agnostic person image and add noise as the input of diffusion model. Additionally, the warped clothes is used as local conditions for each denoising process to ensure that the resulting output retains as much detail as possible. Our approach effectively utilizes the power of the diffusion model, and the incorporation of the warping module helps to produce high-quality and realistic virtual try-on results. Experimental results on VITON-HD demonstrate the effectiveness and superiority of our method.

Getting Started

Installation

Diffusion Model

  1. Clone the repository
git clone https://github.com/bcmi/DCI-VTON-Virtual-Try-On.git
cd DCI-VTON-Virtual-Try-On
  1. Install Python dependencies
conda env create -f environment.yaml
conda activate dci-vton
  1. Download the pretrained vgg checkpoint and put it in models/vgg/

Warping Module

  1. Clone the PF-AFN repository
git clone https://github.com/geyuying/PF-AFN.git
  1. Move the code to the corresponding directory
cp -r DCI-VTON-Virtual-Try-On/warp/train/* PF-AFN/PF-AFN_train/
cp -r DCI-VTON-Virtual-Try-On/warp/test/* PF-AFN/PF-AFN_test/

Data Preparation

VITON-HD

  1. Download VITON-HD dataset
  2. Download pre-warped cloth image/mask from Google Drive or Baidu Cloud and put it under your VITON-HD dataset

After these, the folder structure should look like this (the unpaired-cloth* only included in test directory):

β”œβ”€β”€ VITON-HD
|   β”œβ”€β”€ test_pairs.txt
|   β”œβ”€β”€ train_pairs.txt
β”‚   β”œβ”€β”€ [train | test]
|   |   β”œβ”€β”€ image
β”‚   β”‚   β”‚   β”œβ”€β”€ [000006_00.jpg | 000008_00.jpg | ...]
β”‚   β”‚   β”œβ”€β”€ cloth
β”‚   β”‚   β”‚   β”œβ”€β”€ [000006_00.jpg | 000008_00.jpg | ...]
β”‚   β”‚   β”œβ”€β”€ cloth-mask
β”‚   β”‚   β”‚   β”œβ”€β”€ [000006_00.jpg | 000008_00.jpg | ...]
β”‚   β”‚   β”œβ”€β”€ cloth-warp
β”‚   β”‚   β”‚   β”œβ”€β”€ [000006_00.jpg | 000008_00.jpg | ...]
β”‚   β”‚   β”œβ”€β”€ cloth-warp-mask
β”‚   β”‚   β”‚   β”œβ”€β”€ [000006_00.jpg | 000008_00.jpg | ...]
β”‚   β”‚   β”œβ”€β”€ unpaired-cloth-warp
β”‚   β”‚   β”‚   β”œβ”€β”€ [000006_00.jpg | 000008_00.jpg | ...]
β”‚   β”‚   β”œβ”€β”€ unpaired-cloth-warp-mask
β”‚   β”‚   β”‚   β”œβ”€β”€ [000006_00.jpg | 000008_00.jpg | ...]

Inference

VITON-HD

Please download the pretrained model from Google Drive or Baidu Cloud.

Warping Module

To test the warping module, first move the warp_viton.pth to checkpoints directory:

mv warp_viton.pth PF-AFN/PF-AFN_test/checkpoints

Then run the following command:

cd PF-AFN/PF-AFN_test
sh test_VITON.sh

After inference, you can put the results in the VITON-HD for inference and training of the diffusion model.

Diffusion Model

To quickly test our diffusion model, run the following command:

python test.py --plms --gpu_id 0 \
--ddim_steps 100 \
--outdir results/viton \
--config configs/viton512.yaml \
--ckpt /CHECKPOINT_PATH/viton512.ckpt \
--dataroot /DATASET_PATH/ \
--n_samples 8 \
--seed 23 \
--scale 1 \
--H 512 \
--W 512 \
--unpaired

or just simply run:

sh test.sh

Training

Warping Module

To train the warping module, just run following commands:

cd PF-AFN/PF-AFN_train/
sh train_VITON.sh

Diffusion Model

We utilize the pretrained Paint-by-Example as initialization, please download the pretrained models from Google Drive and save the model to directory checkpoints.

To train a new model on VITON-HD, you should first modify the dataroot of VITON-HD dataset in configs/viton512.yaml and then use main.py for training. For example,

python -u main.py \
--logdir models/dci-vton \
--pretrained_model checkpoints/model.ckpt \
--base configs/viton512.yaml \
--scale_lr False

or simply run:

sh train.sh

Acknowledgements

Our code is heavily borrowed from Paint-by-Example. We also thank PF-AFN, our warping module depends on it.

Citation

@inproceedings{gou2023taming,
  title={Taming the Power of Diffusion Models for High-Quality Virtual Try-On with Appearance Flow},
  author={Gou, Junhong and Sun, Siyu and Zhang, Jianfu and Si, Jianlou and Qian, Chen and Zhang, Liqing},
  booktitle={Proceedings of the 31st ACM International Conference on Multimedia},
  year={2023}
}

More Repositories

1

Awesome-Image-Composition

A curated list of papers, code and resources pertaining to image composition/compositing or object insertion, which aims to generate realistic composite image.
1,171
star
2

Image-Harmonization-Dataset-iHarmony4

[CVPR 2020] The first large-scale public benchmark dataset for image harmonization. The code used in our paper "DoveNet: Deep Image Harmonization via Domain Verification", CVPR2020. Useful for image harmonization, image composition, etc.
MATLAB
764
star
3

libcom

Image composition toolbox: everything you want to know about image composition or object insertion
Python
499
star
4

Awesome-Image-Harmonization

A curated list of papers, code and resources pertaining to image harmonization.
425
star
5

Awesome-Few-Shot-Image-Generation

A curated list of papers, code and resources pertaining to few-shot image generation.
366
star
6

Awesome-Aesthetic-Evaluation-and-Cropping

276
star
7

CaGNet-Zero-Shot-Semantic-Segmentation

Code for our ACMMM2020 paper "Context-aware Feature Generation for Zero-shot Semantic Segmentation".
Python
233
star
8

SLBR-Visible-Watermark-Removal

[ACM MM 2021] Visible Watermark Removal via Self-calibrated Localization and Background Refinement
Python
214
star
9

Awesome-Weak-Shot-Learning

A curated list of papers, code and resources pertaining to weak-shot classification, detection, and segmentation.
183
star
10

Object-Shadow-Generation-Dataset-DESOBA

[AAAI 2022] The first dataset on foreground object shadow generation for image composition in real-world scenes. The code used in our paper "Shadow Generation for Composite Image in Real-world Scenes", AAAI2022. Useful for shadow generation, shadow removal, image composition, etc.
Python
165
star
11

ControlCom-Image-Composition

A controllable image composition model which could be used for image blending, image harmonization, view synthesis.
Python
141
star
12

CDTNet-High-Resolution-Image-Harmonization

[CVPR 2022] We unify pixel-to-pixel transformation and color-to-color transformation in a coherent framework for high-resolution image harmonization. We also release 100 high-resolution real composite images for evaluation.
Python
124
star
13

Image-Composition-Assessment-Dataset-CADB

[BMVC2021] The first image composition assessment dataset. Used in the paper "Image Composition Assessment with Saliency-augmented Multi-pattern Pooling". Useful for image composition assessment, image aesthetic assesment, etc.
Python
112
star
14

Awesome-Visible-Watermark-Removal

102
star
15

Object-Shadow-Generation-Dataset-DESOBAv2

[CVPR 2024] The dataset, code, and model for our paper "Shadow Generation for Composite Image Using Diffusion Model", CVPR, 2024.
Python
102
star
16

GracoNet-Object-Placement

[ECCV 2022] Official code for "Learning Object Placement via Dual-path Graph Completion"
Python
100
star
17

Awesome-Object-Shadow-Generation

A curated list of papers, code, and resources pertaining to object shadow generation.
89
star
18

Awesome-Generative-Image-Composition

A curated list of papers, code, and resources pertaining to generative image composition or object insertion.
Python
78
star
19

F2GAN-Few-Shot-Image-Generation

Fusing-and-Filling GAN (F2GAN) for few-shot image generation, ACM MM2020
Python
78
star
20

Awesome-Object-Placement

A curated list of papers, code, and resources pertaining to object placement.
75
star
21

Object-Placement-Assessment-Dataset-OPA

The first dataset of composite images with rationality score indicating whether the object placement in a composite image is reasonable.
Python
74
star
22

BargainNet-Image-Harmonization

BargainNet: Background-Guided Domain Translation for Image Harmonization. Useful for Image harmonization, image composition, etc.
Python
67
star
23

SimTrans-Weak-Shot-Classification

[NeurIPS 2021] The first weak-shot classification paper.
Python
63
star
24

SSP-AI-Generated-Image-Detection

The code for "A Single Simple Patch is All You Need for AI-generated Image Detection"
Python
62
star
25

Video-Harmonization-Dataset-HYouTube

[IJCAI 2022] The first public benchmark dataset for video harmonization. The code used in our paper "Deep Video Harmonization with Color Mapping Consistency", IJCAI 2022.
Python
59
star
26

ObjectStitch-Image-Composition

An unofficial implementation of the paper "ObjectStitch: Object Compositing with Diffusion Model", CVPR 2023.
Python
55
star
27

TraMaS-Weak-Shot-Object-Detection

[NeurIPS 2021] A weak-shot object detection approach by transferring semantic similarity and mask prior.
Python
52
star
28

PHDiffusion-Painterly-Image-Harmonization

[ACM MM 2023] The code used in our paper "Painterly Image Harmonization using Diffusion Model", ACM MM2023.
Python
51
star
29

DeltaGAN-Few-Shot-Image-Generation

[ECCV 2022] Generate sample-specific intra-category deltas for few-shot image generation.
Python
50
star
30

PHDNet-Painterly-Image-Harmonization

[AAAI 2023] Painterly image harmonization in both spatial domain and frequency domain.
Python
50
star
31

Causal-VidQA

[CVPR 2022] A large-scale public benchmark dataset for video question-answering, especially about evidence and commonsense reasoning. The code used in our paper "From Representation to Reasoning: Towards both Evidence and Commonsense Reasoning for Video Question-Answering", CVPR2022.
Python
50
star
32

SimFormer-Weak-Shot-Semantic-Segmentation

Python
44
star
33

DucoNet-Image-Harmonization

[ACM MM 23] Deep image harmonization in Dual Color Space
Python
38
star
34

Awesome-Image-Blending

A curated list of papers, code and resources pertaining to image blending.
38
star
35

CaGNetv2-Zero-Shot-Semantic-Segmentation

Code for "From Pixel to Patch: Synthesize Context-aware Features for Zero-shot Semantic Segmentation".
Python
36
star
36

SycoNet-Adaptive-Image-Harmonization

[ICCV 2023] The code used in our paper "Deep Image Harmonization with Learnable Augmentation", ICCV2023.
Python
35
star
37

FOPA-Fast-Object-Placement-Assessment

A discriminative object placement approach
Python
32
star
38

MatchingGAN-Few-Shot-Image-Generation

code for Matchinggan: Matching-Based Few-Shot Image Generation
Python
30
star
39

ProPIH-Painterly-Image-Harmonization

[AAAI2024] Progressive Painterly Image Harmonization from Low-level Styles to High-level Styles
Python
24
star
40

RETAB-Weak-Shot-Semantic-Segmentation

Official Implementation for Weak-shot Semantic Segmentation by Transferring Semantic Affinity and Boundary (BMVC 2022)
Python
24
star
41

ArtoPIH-Painterly-Image-Harmonization

[AAAI2024] Painterly Image Harmonization by Learning from Painterly Objects
Python
24
star
42

Human-Centric-Image-Cropping

Official implementation for ECCV2022 paper: Human-centric Image Cropping with Partition-aware and Content-preserving Features.
Python
24
star
43

DIRL-Inharmonious-Region-Localization

[ICME2021]The first work on Deep Inharmonious Region Localization, which can help image harmonization in an adversarial way.
Python
24
star
44

Accessory-Try-On-Dataset-STRAT

A virtual accessory try-on dataset which could be used for image composition
Python
21
star
45

TopNet-Object-Placement

An unofficial implementation of the paper "TopNet: Transformer-based Object Placement Network for Image Compositing", CVPR 2023.
Python
20
star
46

Foreground-Object-Search-Dataset-FOSD

[ICCV 2023] The datasets and code used in our paper "Foreground Object Search by Distilling Composite Image Feature", ICCV2023.
Python
19
star
47

Composite-Image-Evaluation

19
star
48

stock-price-prediction

Fall 18' Class Project for Artificial Intelligence
Jupyter Notebook
19
star
49

Rendered-Shadow-Generation-Dataset-RdSOBA

[AAAI 2024] The dataset used in our paper "Shadow Generation with Decomposed Mask Prediction and Attentive Shadow Filling", AAAI 2024.
19
star
50

DreamCom-Image-Composition

A simple baseline for image composition using text-guided inpainting model
Python
18
star
51

MadisNet-Inharmonious-Region-Localization

[AAAI 2022] MadisNet: Inharmonious Region Localization by Magnifying Domain Discrepancy
Python
16
star
52

Rendered-Image-Harmonization-Dataset-RdHarmony

The first rendered image harmonization dataset. Used in our paper "CharmNet: Deep Image Harmonization by Bridging the Reality Gap". Useful for Image harmonization, image composition, etc.
Python
16
star
53

Image-Harmonization-Dataset-ccHarmony

[ICCV 2023] The color checker based harmonization dataset contributed in our paper "Deep Image Harmonization with Globally Guided Feature Transformation and Relation Distillation", ICCV2023.
Python
16
star
54

Color-Transfer-for-Image-Harmonization

Summarize different color transfer strategies for image harmonization task.
MATLAB
15
star
55

Awesome-Foreground-Object-Search

A curated list of papers, code, and resources pertaining to foreground object search.
13
star
56

AustNet-Inharmonious-Region-Localization

[BMVC2022] Inharmonious Region Localization with Auxiliary Style Feature
Python
13
star
57

GPSDiffusion-Object-Shadow-Generation

4
star
58

toolbox

Python
4
star
59

MureObjectStitch-Image-Composition

Python
3
star
60

iConReg

Regulating contagion risk to curb the systemic crisis in loan networks though deep graph learning
2
star
61

Awesome-Video-Composition

2
star
62

ESL-chinese

Element of Statistical Learning δΈ­ζ–‡ηΏ»θ―‘η‰ˆ
1
star
63

anormal-detection

anormal detection of time series data.
1
star
64

financial-time-series

Learning Causal Relationships in Financial Time Series
1
star