Skip to content

Final project of CSCI 1430 with a self-implemented face landmark detection model. Implemented a real-time face swap software which can change user’s face with different masks.

Notifications You must be signed in to change notification settings

HanCai98/Real-Time-Face-Swap

Repository files navigation

face_changing_v2

Final Project of CSCI 1430 with a self-implemented face landmark detection model

  1. Install requirements

    pip3 install -r requirements.txt
  2. Dataset

    (1) Wider Facial Landmarks in-the-wild (WFLW) is a new proposed face dataset. It contains 10000 faces (7500 for training and 2500 for testing) with 98 fully manual annotated landmarks.

    (2) Download WFLW Training and Testing images at [Google Drive]

    (3) Download WFLW Annotations at Face Annotations

    (4) Unzip above two packages and put them on ./data/WFLW/

    (5) Move Mirror98.txt to WFLW/WFLW_annotations

    (6) Preprocess the dataset

    $ cd data 
    $ python3 SetPreparation.py
  3. Train and Test

    (1) Train:

    $ python3 train.py

    (2) Use tensorbnoard to view the loss changing:

    $ tensorboard  --logdir=./checkpoint/tensorboard/

    (3) Test:

    $ python3 test.py
  4. Face Changing

    (1) Extract and save the video frames

    $ python3 main.py

    (2) Create the output video using saved frames

    $ python3 transfer_to_video.py
  5. Result

  6. Report and Poster

    Final report: https://drive.google.com/file/d/1hst6AY2cbunJz6_fLI4KINTOAoNz8cAf/view?usp=sharing

    Poster: https://drive.google.com/file/d/1fDGP9QRNnN8bLNO9HHJ1RIW31amfG5Jz/view?usp=sharing

  7. Reference

    PFLD: A Practical Facial Landmark Detector https://arxiv.org/pdf/1902.10859.pdf

About

Final project of CSCI 1430 with a self-implemented face landmark detection model. Implemented a real-time face swap software which can change user’s face with different masks.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages