Skip to content

Commit

Permalink
upload inference code
Browse files Browse the repository at this point in the history
  • Loading branch information
yisol committed Apr 5, 2024
1 parent 4fd1cc0 commit 18863ad
Show file tree
Hide file tree
Showing 20 changed files with 18,102 additions and 2 deletions.
62 changes: 60 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,68 @@ This is an official implementation of paper 'Improving Diffusion Models for Auth


- [x] demo model
- [ ] inference code
- [x] inference code
- [ ] training code



## Requirements

```
git clone https://github.com/yisol/IDM-VTON.git
cd IDM-VTON
conda env create -f environment.yaml
conda activate idm
```

## Data preparation
You can download VITON-HD dataset from [VITON-HD](https://github.com/shadow2496/VITON-HD).
After download VITON-HD dataset, move vitonhd_test_tagged.json into the test folder.
Structure of the Dataset directory should be as follows.

```
train
|-- ...
test
|-- image
|-- image-densepose
|-- agnostic-mask
|-- cloth
|-- vitonhd_test_tagged.json
```





## Inference

Inference with python file with argument.

```
accelerate launch inference.py \
--width 768 --height 1024 --num_inference_steps 30 \
--output_dir "result" \
--unpaired \
--data_dir "DATA_DIR" \
--seed 42 \
--test_batch_size 2 \
--guidance_scale 2.0
```

You can simply run with the script file.

```
sh inference.sh
```



## Acknowledgements

For the demo, GPUs are supported from [zerogpu](https://huggingface.co/zero-gpu-explorers), and auto masking generation codes are based on [OOTDiffusion](https://github.com/levihsu/OOTDiffusion)
For the demo, GPUs are supported from [zerogpu](https://huggingface.co/zero-gpu-explorers), and auto masking generation codes are based on [OOTDiffusion](https://github.com/levihsu/OOTDiffusion).
Parts of the code were based on [IP-Adapter](https://github.com/tencent-ailab/IP-Adapter).
23 changes: 23 additions & 0 deletions environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: idm
channels:
- pytorch
- nvidia
- defaults
dependencies:
- python=3.10.0=h12debd9_5
- pytorch=2.0.1=py3.10_cuda11.8_cudnn8.7.0_0
- pytorch-cuda=11.8=h7e8668a_5
- torchaudio=2.0.2=py310_cu118
- torchtriton=2.0.0=py310
- torchvision=0.15.2=py310_cu118
- pip=23.3.1=py310h06a4308_0

- pip:
- accelerate==0.25.0
- torchmetrics==1.2.1
- tqdm==4.66.1
- transformers==4.36.2
- diffusers==0.25.0
- einops==0.7.0
- bitsandbytes==0.39.0
- scipy==1.11.1
Loading

0 comments on commit 18863ad

Please sign in to comment.