项目作者: yrlu

项目描述 :
Implemented a pipeline for automatic face replacement in videos (without deep learning). Image morphing, triangulation, TPS, Poisson blending, etc.
高级语言: Matlab
项目地址: git://github.com/yrlu/seamless_face_replacement.git
创建时间: 2016-12-29T20:17:12Z
项目社区:https://github.com/yrlu/seamless_face_replacement

开源协议:

下载


Automatic Seamless Face Replacement in Videos

-Yiren Lu (luyiren [at] seas [dot] upenn [dot] edu)
-Dongni Wang (wdongni [at] seas [dot] upenn [dot] edu)

Automatic Seamless Face Replacement (without deep learning).

Project Description

PDF

Run Code

Python third party libs required:

  • dlib
  • cv2
  • skimage
  • scipy.io

To run face replacement:

  • Download face landmark estimation model and uncompress
    1. $ wget http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2
    2. $ tar xvfj shape_predictor_68_face_landmarks.dat.bz2
  • Face detection (for both source video and destination video)

    1. $ Python face_detect_wrapper.py shape_predictor_68_face_landmarks.dat [video_name_no_suffix]

    e.g.:

    1. $ Python face_detect_wrapper.py shape_predictor_68_face_landmarks.dat clips/clip1

    Example outputs in Proj4_Test/ and clips/

  • Face replacement: see demo.m

    • load face detection results output by 1.
    • run replace_all_faces([src video path], [replacement video path], [src video detection results], [source video detection results], [destination video detection results], [source face index], [resize x])
    • save video to .avi file

Example output videos in output_videos/

Video Demo

Face replacement

License

The contents of this repository are licensed under the MIT License.