我們的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。