深度学习系列66:试穿模型IDM-VTON上手

1. 模型概述

在这里插入图片描述
如图,总体流程为:

  1. 输入为:衣服的编码xg;人物+noise的编码xt;人物身上衣物的mask和人体pose分割(densepose);
  2. 衣服部分经过两部分网络:1)高级语义网络IP-Adapter:是一个图像编码器,比如CLIP模型;2)低级语义网络:称为GarmentNet,是一个UNet,用来提取图像低级细节特征,例如纹理,图案等等。
  3. 人体部分经过TryonNet,也是一个UNet。其输入和GarmentNet同层进行拼接后,输入自注意力层,然后取左半部分,与IPAdaper的结果,以及文本编码结果进行交叉注意力计算。

官网为:https://idm-vton.github.io/
不同模型的效果对比图如下:
在这里插入图片描述

2. 快速上手

可以在huggingface的demo上进行尝试:https://hf-mirror.com/spaces/yisol/IDM-VTON
参考https://github.com/camenduru/IDM-VTON-jupyter/blob/main/IDM_VTON_jupyter.ipynb,执行代码:

git clone  https://hub.nuaa.cf/camenduru/IDM-VTON-hf
cd IDM-VTON-hf
apt -y install -qq aria2
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://hf-mirror.com/camenduru/IDM-VTON/resolve/main/densepose/model_final_162be9.pkl -d /content/IDM-VTON-hf/ckpt/densepose -o model_final_162be9.pkl
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://hf-mirror.com/camenduru/IDM-VTON/resolve/main/humanparsing/parsing_atr.onnx -d /content/IDM-VTON-hf/ckpt/humanparsing -o parsing_atr.onnx
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://hf-mirror.com/camenduru/IDM-VTON/resolve/main/humanparsing/parsing_lip.onnx -d /content/IDM-VTON-hf/ckpt/humanparsing -o parsing_lip.onnx
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://hf-mirror.com/camenduru/IDM-VTON/resolve/main/openpose/ckpts/body_pose_model.pth -d /content/IDM-VTON-hf/ckpt/openpose/ckpts -o body_pose_model.pth
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://hf-mirror.com/camenduru/IDM-VTON/resolve/main/IDM-VTON-DC/unet/diffusion_pytorch_model.bin -d /content/IDM-VTON-hf/ckpt/openpose/ckpts/unet -o diffusion_pytorch_model.bin
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://hf-mirror.com/camenduru/IDM-VTON/resolve/main/IDM-VTON-DC/unet/config.json -d /content/IDM-VTON-hf/ckpt/openpose/ckpts/unet -o config.json

pip install -q diffusers==0.25.0 accelerate==0.26.1 einops==0.7.0 onnxruntime==1.16.2 cloudpickle omegaconf gradio==4.24.0 fvcore av config spaces -i https://pypi.tuna.tsinghua.edu.cn/simple

然后执行python app.py启动应用即可
另外下载的模型也可以替换为F16的版本,参考:https://hf-mirror.com/camenduru/IDM-VTON-F16/tree/main

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-28 06:30:02       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-28 06:30:02       100 阅读
  3. 在Django里面运行非项目文件

    2024-04-28 06:30:02       82 阅读
  4. Python语言-面向对象

    2024-04-28 06:30:02       91 阅读

热门阅读

  1. Django——Auth模块以及admin站点

    2024-04-28 06:30:02       32 阅读
  2. UDP服务器的并发方案

    2024-04-28 06:30:02       27 阅读
  3. Phpstorm环境配置与应用

    2024-04-28 06:30:02       30 阅读
  4. 如何在 Mac 上配置一个本地 Web 服务器

    2024-04-28 06:30:02       28 阅读
  5. 安卓开发中服务(Service)的简单使用

    2024-04-28 06:30:02       31 阅读