AI一键换衣神器终于把老黄的黑皮夹克给换了

文浩Free 2024-05-03 22:38:55

要求

```plain text git clone https://github.com/yisol/IDM-VTON.git cd IDM-VTON

conda env create -f environment.yaml conda activate idm

## 数据准备

<!-- truncate -->

### VITON-HD

您可以从 VITON-HD 下载 VITON - HD 数据集。

下载 VITON-HD 数据集后,将 vitonhd_test_tagged.json 移动到测试文件夹中。

数据集目录的结构应如下所示。

```plain text

train

|-- ...

test

|-- image

|-- image-densepose

|-- agnostic-mask

|-- cloth

|-- vitonhd_test_tagged.json

着装要求

您可以从 DressCode 下载 DressCode 数据集。

我们在这里 提供预先计算的密集姿势图像和服装标题。

我们使用 detectorron2 来获取密集姿态图像,请参阅 此处 了解更多详细信息。

下载 DressCode 数据集后,放置图像密集目录和标题文本文件,如下所示。

plain text DressCode |-- dresses |-- images |-- image-densepose |-- dc_caption.txt |-- ... |-- lower_body |-- images |-- image-densepose |-- dc_caption.txt |-- ... |-- upper_body |-- images |-- image-densepose |-- dc_caption.txt |-- ... ## 推理

VITON-HD

使用带参数的 python 文件进行推理,

plain text 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 或者,您可以简单地使用脚本文件运行。

plain text sh inference.sh ### 着装要求

对于 DressCode 数据集,通过类别参数输入要生成图像的类别,

plain text accelerate launch inference_dc.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 --category "upper_body" 或者,您可以简单地使用脚本文件运行。

plain text sh inference.sh ## 启动本地渐变演示

在此处 下载用于人工解析的检查点。

将检查点放置在 ckpt 文件夹下。

```plain text ckpt |– densepose |– model_final_162be9.pkl |– humanparsing |– parsing_atr.onnx |– parsing_lip.onnx

|– openpose |– ckpts |– body_pose_model.pth

运行以下命令:

```plain text

python gradio_demo/app.py

详情介绍 : https://wenhaofree.com/IDM-VTON

0 阅读:30

文浩Free

简介:互联网AI自由分享家