Skip to content

Makeup application through DLIB and postprocessing and face enhancement through CodeFormer

Notifications You must be signed in to change notification settings

ZainabZaman/FaceEnhancementAndMakeup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AI Face Makeup Application & Enhancement Through Codeformer

This repository contains a Python script for face makeup application and enhancement using the CodeFormer model. The script leverages face recognition and CodeFormer, a deep learning model, to enhance facial features in images.

Prerequisites

Before running the script, make sure you have the following dependencies installed:

  • Python
  • OpenCV (pip install opencv-python)
  • PyTorch (pip install torch torchvision)
  • NumPy (pip install numpy)
  • basicsr library (Ensure that the required libraries are installed. You can find them in the requirements.txt file.)

Usage

  1. Install the required Python packages:

    pip install -r requirements.txt

    or through the provided CodeFormer.ipynb nootebook.

  2. Replace the ./CodeFormer/inference_codeformer.py with the inferece_codeformer.py file provided in this repository.

  3. Run the inference_codeformer.py script script:

    python face_restoration.py

Options

The script includes options for different makeup styles:

  • option_makeup = 1: Deep Gray Eyebrows, Red Lip, Gray Eyes, Black Eyeliner
  • option_makeup = 2: Brown Eyebrows, Hot Pink Lip, Gray Eyes, Brown Eyeliner
  • option_makeup = 3: Deep Gray Eyebrows, Dark Orange Brown Lip, Gray Eyes, Black Eyeliner
  • option_makeup = 4: Deep Gray Eyebrows, Light Pink Lip, Gray Eyes, Brown Eyeliner
  • option_makeup = 5: Deep Gray Eyebrows, Crimson Lip, Gray Eyes, Black Eyeliner

You can modify the option_makeup variable in the inferece_codeformer.py script to choose a specific makeup style.

Examples

The following were the results from the DLIB makeup application code dlib_results

Below are the results from the DLIB library refined through Codeformer dlib_results

Shown below are the final results with makeup application through DLIB and refinement through Codeformer dlib_results

Acknowledgments

  • The CodeFormer model is used for face restoration.
  • Face recognition is performed using the face_recognition library.

About

Makeup application through DLIB and postprocessing and face enhancement through CodeFormer

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published