Skip to content

LeslieZhoa/HeadSwap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HeadSwap

This is a HeadSwap project, mainly inspired by HeSer.Pytorch
It includes two stages

  1. One stage deeply copy from PIRender
  2. The other stage is from HeSer.Pytorch

!!!!! NEW !!!!

Colab notebooks:

  • single image infer: single image infer

Some examples

the pictures is from 小红书 and baidu

Reference

super resolution -> CF-Net
face parsing -> face-parsing.PyTorch
3dmm -> Deep3DFaceRecon_pytorch

How to Run

  1. envrionment
    follow PIRender and Heser
    LVT in this project is follow here
  2. download model
    a. follow Deep3DFaceRecon_pytorch(https://github.com/sicxu/Deep3DFaceRecon_pytorch#prepare-prerequisite-models), download BFM files and epoch_20.pth in pretrained_models
    b. follow PIRender, put epoch_00190_iteration_000400000_checkpoint.pt to pretrained_models
    c.
    cd process
    bash download_weight.sh
    
  3. run
    # set your own image path in inference.py
    python inference.py

Credits

HeSer.Pytorch model and implementation: https://github.com/LeslieZhoa/HeSer.Pytorch Copyright © 2022,LeslieZhoa License https://github.com/LeslieZhoa/HeSer.Pytorch/blob/main/LICENSE

PIRender model and implementation: https://github.com/RenYurui/PIRender Copyright © 2021,RenYurui. License https://github.com/RenYurui/PIRender/blob/main/LICENSE.md

CF-Net model and implementation: https://github.com/ytZhang99/CF-Net Copyright © 2021,ytZhang99.

Deep3DFaceRecon_pytorch model and implementation: https://github.com/sicxu/Deep3DFaceRecon_pytorch Copyright © 2021,sicxu. License https://github.com/sicxu/Deep3DFaceRecon_pytorch/blob/master/LICENSE

arcface pytorch model pytorch model and implementation: https://github.com/ronghuaiyang/arcface-pytorch Copyright © 2018, ronghuaiyang.

LVT model and implementation: https://github.com/LeslieZhoa/LVT Copyright © 2022, LeslieZhoa.

face-parsing model and implementation: https://github.com/zllrunning/face-parsing.PyTorch Copyright © 2019, zllrunning. License https://github.com/zllrunning/face-parsing.PyTorch/blob/master/LICENSE