k-byzid / Face-Reconstructor

Face Reconstructor: Mediapipe Holistic + OpenCV for accurate facial landmark detection and mesh-based skin patching

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Face Reconstructor πŸ‘€πŸ”πŸ’»

Description

Welcome to the Face Reconstructor project! 🌟 This advanced application utilizes the cutting-edge capabilities of the Mediapipe library Holistic tool to accurately identify and analyze a comprehensive set of 468 facial landmarks. Leveraging the power of OpenCV (cv2), this system employs sophisticated algorithms to generate a meticulously crafted triangulation mesh, wherein each polygon is expertly filled with a seamless patch of skin derived from the original frame. πŸ“ΈπŸ’‘

Features

πŸ”βœ¨ Facial Landmark Detection: Utilizing Mediapipe Holistic, this system accurately detects key facial landmarks, revealing detailed structural insights. πŸŽ―πŸ’‘

πŸ”³βœ¨ Triangulated Mesh Generation: With OpenCV (cv2), this application creates a precise triangulation mesh, enabling advanced analysis and visualizations of facial geometry. πŸ“πŸ”²

🎨✨ Patch-based Skin Reconstruction: This system achieves lifelike face reconstruction by filling triangulation mesh polygons with carefully selected skin patches, maintaining a natural appearance. πŸ–ŒοΈπŸ§‘β€πŸŽ¨

Installation and Usage

  1. 🍴 Fork the repository to your GitHub account.
  2. ⬇️ Clone the forked repository to your local machine.
  3. πŸ’Ώ Navigate to the local repository using the command line.
  4. πŸ’» Run the script using the following command:
    python reconstructor.py --input_image assets/example_video.mp4 --output_path results/processed_example_video.mp4,
    where assets/example_video.mp4is the path to the input video you want to extract the face from.
  5. βœ‰οΈ The generated mesh will be saved in the "results" folder for further usage.

Usage Preview

Input Video - - Output Video:


Example 1Processed Example 1

Example 2Processed Example 2

Example TestProcessed Example Test

Requirements

The following dependencies are required to run the Face Reconstructor:

  1. Python 3.x
  2. Mediapipe
  3. OpenCV Python
  4. Numpy

You can install these dependencies manually using the package manager of your choice.

About

Face Reconstructor: Mediapipe Holistic + OpenCV for accurate facial landmark detection and mesh-based skin patching


Languages

Language:Python 79.3%Language:Jupyter Notebook 20.7%