{"id":13672495,"url":"https://github.com/svip-lab/impersonator","last_synced_at":"2025-05-15T20:07:34.064Z","repository":{"id":35323356,"uuid":"194529303","full_name":"svip-lab/impersonator","owner":"svip-lab","description":"PyTorch implementation of our ICCV 2019 paper:  Liquid Warping GAN: A Unified Framework for Human Motion Imitation, Appearance Transfer and Novel View Synthesis","archived":false,"fork":false,"pushed_at":"2022-06-21T22:56:20.000Z","size":102098,"stargazers_count":1730,"open_issues_count":37,"forks_count":313,"subscribers_count":63,"default_branch":"master","last_synced_at":"2025-04-08T02:41:43.149Z","etag":null,"topics":["gan","pose","pytorch"],"latest_commit_sha":null,"homepage":"https://svip-lab.github.io/project/impersonator","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/svip-lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-30T15:05:34.000Z","updated_at":"2025-04-06T22:04:16.000Z","dependencies_parsed_at":"2022-08-02T23:46:08.167Z","dependency_job_id":null,"html_url":"https://github.com/svip-lab/impersonator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svip-lab%2Fimpersonator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svip-lab%2Fimpersonator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svip-lab%2Fimpersonator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svip-lab%2Fimpersonator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/svip-lab","download_url":"https://codeload.github.com/svip-lab/impersonator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254414501,"owners_count":22067272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gan","pose","pytorch"],"created_at":"2024-08-02T09:01:37.264Z","updated_at":"2025-05-15T20:07:29.020Z","avatar_url":"https://github.com/svip-lab.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Impersonator\nPyTorch implementation of our ICCV 2019 paper:\n\nLiquid Warping GAN: A Unified Framework for Human Motion Imitation, Appearance Transfer and Novel View Synthesis\n\n**Please clone the newest codes.**\n\n[[paper]](https://arxiv.org/pdf/1909.12224.pdf) [[website]](https://svip-lab.github.io/project/impersonator) [[Supplemental Material]](https://svip-lab.github.io/project_img/impersonator/4701-supp.pdf) [[Dataset]](https://svip-lab.github.io/dataset/iPER_dataset.html)\n\n\u003cp float=\"center\"\u003e\n\t\u003cimg src='assets/visuals/motion/Sweaters-id_0000088807_4_full.jpg' width=\"135\"/\u003e\n  \t\u003cimg src='assets/visuals/motion/mixamo_0007_Sweaters-id_0000088807_4_full.gif' width=\"135\"/\u003e\n  \t\u003cimg src='assets/visuals/appearance/Sweaters-id_0000337302_4_full.jpg' width=\"135\"/\u003e\n\t\u003cimg src='assets/visuals/appearance/Sweaters-id_0000337302_4_full.gif' width=\"135\"/\u003e\n\t\u003cimg src='assets/visuals/novel/Jackets_Vests-id_0000071603_4_full.jpg' width=\"135\"/\u003e\n    \u003cimg src='assets/visuals/novel/Jackets_Vests-id_0000071603_4_full.gif' width=\"135\"/\u003e\n    \u003cimg src='assets/visuals/motion/009_5_1_000.jpg' width=\"135\"/\u003e    \n  \t\u003cimg src='assets/visuals/motion/mixamo_0031_000.gif' width=\"135\"/\u003e\n  \t\u003cimg src='assets/visuals/appearance/001_19_1_000.jpg' width=\"135\"/\u003e\n\t\u003cimg src='assets/visuals/appearance/001_19_1_000.gif' width=\"135\"/\u003e\n\t\u003cimg src='assets/visuals/novel/novel_3.jpg' width=\"135\"/\u003e\n    \u003cimg src='assets/visuals/novel/novel_3.gif' width=\"135\"/\u003e\n\u003c/p\u003e\n\n## Update News\n- [x] 10/05/2019, optimize the minimal requirements of GPU memory (at least `3.8GB` available).\n\n- [x] 10/24/2019, Imper-1.2.2, add the training document [train.md](./doc/train.md).\n\n- [x] 07/04/2020, Add the [evaluation metrics](./thirdparty/his_evaluators/README.md) on iPER dataset.\n\n## Getting Started\nPython 3.6+, Pytorch 1.2, torchvision 0.4, cuda10.0, at least `3.8GB` GPU memory and other requirements.\nAll codes are tested on Linux Distributions (Ubutun 16.04 is recommended), and other platforms have not been tested yet.\n\n### Requirements\n``` bash\npip install -r requirements.txt\napt-get install ffmpeg\n```\n\n### Installation\n```shell\ncd thirdparty/neural_renderer\npython setup.py install\n```\n\n### Download resources.\n1. Download `pretrains.zip` from [OneDrive](https://1drv.ms/u/s!AjjUqiJZsj8whLNw4QyntCMsDKQjSg?e=L77Elv) or\n[BaiduPan](https://pan.baidu.com/s/11S7Z6Jj3WAfVNxBWyBjW6w) and then move the pretrains.zip to \nthe `assets` directory and unzip this file.\n```\nwget -O assets/pretrains.zip https://1drv.ws/u/s!AjjUqiJZsj8whLNw4QyntCMsDKQjSg?e=L77Elv\n```\n\n2. Download `checkpoints.zip` from [OneDrive](https://1drv.ms/u/s!AjjUqiJZsj8whLNyoEh67Uu0LlxquA?e=dkOnhQ) or\n[BaiduPan](https://pan.baidu.com/s/1snolk6wphbuHtQ_DeSA06Q) and then \nunzip the `checkpoints.zip` and move them to `outputs` directory.\n```\nwget -O outputs/checkpoints.zip https://1drv.ws/u/s!AjjUqiJZsj8whLNyoEh67Uu0LlxquA?e=dkOnhQ\n```\n\n3. Download `samples.zip` from [OneDrive](https://1drv.ms/u/s!AjjUqiJZsj8whLNz4BqnSgqrVwAXoQ?e=bC86db) or\n[BaiduPan](https://pan.baidu.com/s/1xAI96709Gvqahq9uYAEXYA), and then\nunzip the `samples.zip` and move them to `assets` directory.\n```\nwget -O assets/samples.zip \"https://1drv.ws/u/s\\!AjjUqiJZsj8whLNz4BqnSgqrVwAXoQ?e=bC86db\"\n```\n\n### Running Demo\nIf you want to get the results of the demo shown on the webpage, you can run the following scripts.\nThe results are saved in `./outputs/results/demos`\n\n1. Demo of Motion Imitation\n    ```bash\n    python demo_imitator.py --gpu_ids 1\n    ```\n    \n2. Demo of Appearance Transfer\n    ```bash\n    python demo_swap.py --gpu_ids 1\n    ```\n\n3. Demo of Novel View Synthesis\n    ```bash\n    python demo_view.py --gpu_ids 1\n    ```\n    \nIf you get the errors like `RuntimeError: CUDA out of memory`, please add the flag `--batch_size 1`, the minimal \nGPU memory is 3.8 GB.\n\n\n### Running custom examples (Details)\nIf you want to test other inputs (source image and reference images **from yourself**), here are some examples.\nPlease replace the `--ip YOUR_IP` and `--port YOUR_PORT` for \n[Visdom](https://github.com/facebookresearch/visdom) visualization. \n\n1. Motion Imitation\n    * source image from iPER dataset\n    ```bash\n    python run_imitator.py --gpu_ids 0 --model imitator --output_dir ./outputs/results/  \\\n        --src_path      ./assets/src_imgs/imper_A_Pose/009_5_1_000.jpg    \\\n        --tgt_path      ./assets/samples/refs/iPER/024_8_2    \\\n        --bg_ks 13  --ft_ks 3 \\\n        --has_detector  --post_tune  \\\n        --save_res --ip YOUR_IP --port YOUR_PORT\n    ```\n        \n    * source image from DeepFashion dataset\n    ```bash\n    python run_imitator.py --gpu_ids 0 --model imitator --output_dir ./outputs/results/  \\\n    --src_path      ./assets/src_imgs/fashion_woman/Sweaters-id_0000088807_4_full.jpg    \\\n    --tgt_path      ./assets/samples/refs/iPER/024_8_2    \\\n    --bg_ks 25  --ft_ks 3 \\\n    --has_detector  --post_tune  \\\n    --save_res --ip YOUR_IP --port YOUR_PORT\n    ```\n        \n    * source image from Internet\n    ```bash\n    python run_imitator.py --gpu_ids 0 --model imitator --output_dir ./outputs/results/  \\\n        --src_path      ./assets/src_imgs/internet/men1_256.jpg    \\\n        --tgt_path      ./assets/samples/refs/iPER/024_8_2    \\\n        --bg_ks 7   --ft_ks 3 \\\n        --has_detector  --post_tune --front_warp \\\n        --save_res --ip YOUR_IP --port YOUR_PORT\n    ```\n2. Appearance Transfer\n\n    An example that source image from iPER and reference image from DeepFashion dataset.\n\n    ```bash\n    python run_swap.py --gpu_ids 0 --model imitator --output_dir ./outputs/results/  \\\n        --src_path      ./assets/src_imgs/imper_A_Pose/024_8_2_0000.jpg    \\\n        --tgt_path      ./assets/src_imgs/fashion_man/Sweatshirts_Hoodies-id_0000680701_4_full.jpg    \\\n        --bg_ks 13  --ft_ks 3 \\\n        --has_detector  --post_tune  --front_warp --swap_part body  \\\n        --save_res --ip http://10.10.10.100 --port 31102\n    ```\n3. Novel View Synthesis\n    ```bash\n    python run_view.py --gpu_ids 0 --model viewer --output_dir ./outputs/results/  \\\n    --src_path      ./assets/src_imgs/internet/men1_256.jpg    \\\n    --bg_ks 13  --ft_ks 3 \\\n    --has_detector  --post_tune --front_warp --bg_replace \\\n    --save_res --ip http://10.10.10.100 --port 31102\n    ```\n    \nIf you get the errors like `RuntimeError: CUDA out of memory`, please add the flag `--batch_size 1`, the minimal \nGPU memory is 3.8 GB.\n\nThe details of each running scripts are shown in [runDetails.md](doc/runDetails.md).\n### Training from Scratch\n\n* The details of training iPER dataset from scratch are shown in [train.md](./doc/train.md).\n\n### Evaluation\nRun ```./scripts/motion_imitation/evaluate.sh```.\nThe details of the evaluation on iPER dataset in [his_evaluators](./thirdparty/his_evaluators/README.md).\n\n\n## Announcement\nIn our paper, the results of LPIPS reported in Table 1, are calculated by **1 – distance score**; \nthereby, the larger is more similar between two images. The beginning intention of using **1 – distance score** is that it is more accurate to meet the definition of **Similarity** in LPIPS.\n\nHowever, most other papers use the original definition that LPIPS = distance score; \ntherefore, to eliminate the ambiguity and make it consistent with others, \nwe update the results in Table 1 with the original definition in the [latest paper](https://arxiv.org/pdf/1909.12224.pdf).\n\n## Citation\n![thunmbnail](assets/thumbnail.jpg)\n```\n@InProceedings{lwb2019,\n    title={Liquid Warping GAN: A Unified Framework for Human Motion Imitation, Appearance Transfer and Novel View Synthesis},\n    author={Wen Liu and Zhixin Piao, Min Jie, Wenhan Luo, Lin Ma and Shenghua Gao},\n    booktitle={The IEEE International Conference on Computer Vision (ICCV)},\n    year={2019}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvip-lab%2Fimpersonator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsvip-lab%2Fimpersonator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvip-lab%2Fimpersonator/lists"}