Skip to content

🔥 [PR 2023] Multi-scale Attention Guided Pose Transfer (official code).

License

Notifications You must be signed in to change notification settings

prasunroy/pose-transfer

Repository files navigation

Official code for Multi-scale Attention Guided Pose Transfer.

Accepted in Pattern Recognition (PR) 2023.

badge_torch badge_arxiv


network_architecture


results


⚡ Getting Started

mkdir pose2pose
cd pose2pose
mkdir -p datasets/DeepFashion
mkdir -p output/DeepFashion/ckpt/pretrained
git clone https://github.com/prasunroy/pose-transfer.git
cd pose-transfer
pip install -r requirements.txt

🔥 Quick test using the inference API

from api import Pose2Pose
from PIL import Image

p2p = Pose2Pose(pretrained=True)

condition = Image.open('./api-test/condition.jpg')
reference = Image.open('./api-test/target_pose_reference.jpg')
generated = p2p.transfer_as(condition, reference)
generated.show()

Code organization for training, testing and evaluation

  • Download dataset files from Google Drive and extract into datasets/DeepFashion directory.
  • Download pretrained checkpoints from Google Drive into output/DeepFashion/ckpt/pretrained directory.
pose2pose
│
├───datasets
│   └───DeepFashion
│       ├───img
│       ├───test_pose_maps
│       ├───train_pose_maps
│       ├───test_img_keypoints.csv
│       ├───test_img_list.csv
│       ├───test_img_pairs.csv
│       ├───train_img_keypoints.csv
│       ├───train_img_list.csv
│       └───train_img_pairs.csv
├───output
│   └───DeepFashion
│       └───ckpt
│           └───pretrained
│               ├───netD_257500.pth
│               ├───netD_260500.pth
│               ├───netG_257500.pth
│               └───netG_260500.pth
└───pose-transfer

The precomputed keypoints and posemaps are estimated using the provided utility scripts in pose-transfer/utils.

In the paper, all qualitative results are generated using the pretrained checkpoint at iteration 260500 and all quantitative evaluations are performed using the pretrained checkpoint at iteration 257500.


External Links

arXiv  •   Dataset  •   Pretrained Models  •   Images for User Study


Citation

@article{roy2022multi,
  title   = {Multi-scale Attention Guided Pose Transfer},
  author  = {Roy, Prasun and Bhattacharya, Saumik and Ghosh, Subhankar and Pal, Umapada},
  journal = {Pattern Recognition},
  volume  = {137},
  pages   = {109315},
  year    = {2023},
  issn    = {0031-3203},
  doi     = {https://doi.org/10.1016/j.patcog.2023.109315}
}

License

Copyright 2023 by the authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

The pretrained models are released under Creative Commons Attribution 4.0 International (CC BY 4.0) license.


Made with ❤️ and 🍕 on Earth.