Skip to content

daviddirethucus/Face-Mask_Inpainting

Repository files navigation

😷 Face-Mask Inpainting 😗

screen screen
screen screen

This project attempted to achieve the paper A novel GAN-based network for unmasking of masked face. The model is designed to remove the face-mask from facial image and inpaint the left-behind region based on a novel GAN-network approach.

Training Environment

  • Google Cloud Platform
  • GPU (Nvidia Tesla T4)
  • Python 3.8

Models Architecture

screen

Rather than using the traditional pix2pix U-Net method, in this work the model consists of two main modules, map module and editing module.In the first module, we detect the face-mask object and generate a binary segmentation map for data augmentation. In the second module, we train the modified U-Net with two discriminators using masked image and binary segmentation map.

Data preparation

In this work, I used around 4k paired images for training map module model, and around 20k images for training editing module model.

Get Started

It is recommended to make a new virtual environment with Python 3.8 and install the dependencies. Following steps can be taken to download and run the Face-mask inpainting streamlit webapp on local host

Clone the repository

git clone https://github.com/daviddirethucus/Face-Mask_Inpainting.git

Download the trained models

Since it is not permissable to push the model which is larger than 100MB on Github, so we provide a link to download our trained Facemask Inpainting models: Here

The path of the trained models should be located at:

/Face-Mask_Inpainting/models

Install required packages

The provided requirements.txt file consists the essential packages to install. Use the following command

cd Face-Mask_Inpainting
pip install -r requirements.txt

Run the stremalit webapp

cd Face-Mask_Inpainting
streamlit run main.py

Copy the Local URL / Network URL and view it in your browser. screen

Demo

|screen | screen |

Related Project

Paper References

Code References

Releases

No releases published

Packages

No packages published

Languages