我们的CVPR纸的代码:Person Image Synthesis和Decled Gan,Project Page,Supp的编辑。
conda create -n pise python=3.6
conda install pytorch=1.2 cudatoolkit=10.0 torchvision
pip install scikit-image pillow pandas tqdm dominate natsort
图像和关键点的数据准备可以遵循姿势转移和GFLA。
下载Deep Fashion数据集。您将需要从数据集维护者那里询问密码。 unzip'img/img.zip',然后将名为“ img”的文件夹放入./fashion_data'目录中。
从Google Drive下载火车/测试关键点注释和数据集列表,包括Fashion-pairs-train.csv , Fashion-pairs-test.csv , Fashion-Annotation-train-train.csv , Fashion-annotation-train-train-train.csv, Train。 lst , test.lst 。将这些文件放在./fashion_data目录下。
运行以下代码以拆分火车/测试数据集。
python data/generate_fashion_datasets.py
下载解析数据,然后将这些文件放在./fashion_data目录下。可以从百度(Fectch Code:ABCD)或Google Drive找到用于测试的解析数据。可以从Baidu(Fectch Code:ABCD)或Google Drive中找到用于培训的数据。您可以使用PGN获取数据,并根据需要重新组织标签。
python train.py --name=fashion --model=painet --gpu_ids=0
请注意,如果您想训练姿势转移模型以及纹理转移和区域编辑,只需评论第177和178行,以及Uncomments Line 162-176。
对于使用Multi-GPU的培训,您可以参考GFLA中的问题
您可以直接从Baidu(Fetch Code:ABCD)或Google Drive下载我们的测试结果。
可以从Baidu(Fetch Code:ABCD)或Google Drive中找到人类姿势转移的预训练检查点,然后将其放入文件夹中( - >结果 - >时尚)。
可以从BAIDU(Fetch Code:ABCD)或Google Drive中找到纹理转移,区域编辑,样式插值的预训练检查点。请注意,需要更改模型。
自己测试
python test.py --name=fashion --model=painet --gpu_ids=0
如果您使用此代码,请引用我们的论文。
@InProceedings{Zhang_2021_CVPR,
author = {Zhang, Jinsong and Li, Kun and Lai, Yu-Kun and Yang, Jingyu},
title = {{PISE}: Person Image Synthesis and Editing With Decoupled GAN},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2021},
pages = {7982-7990}
}
我们的代码基于GFLA。