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.
- Google Cloud Platform
- GPU (Nvidia Tesla T4)
- Python 3.8
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.
- For collecting the ground truth, we use Flickr-Faces-HQ Dataset (FFHQ).
- For creating the masked images, we use MaskTheFace to masking the ground truth.
In this work, I used around 4k paired images for training map module model, and around 20k images for training editing module model.
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
git clone https://github.com/daviddirethucus/Face-Mask_Inpainting.git
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
The provided requirements.txt file consists the essential packages to install. Use the following command
cd Face-Mask_Inpainting
pip install -r requirements.txt
cd Face-Mask_Inpainting
streamlit run main.py
Copy the Local URL / Network URL and view it in your browser.
- A novel GAN-based network for unmasking of masked face
- Generation of Realistic Facemasked Faces With GANs
- U-Net: Convolutional Networks for Biomedical Image Segmentation
- Squeeze-and-Excitation Networks
- Rethinking Atrous Convolution for Semantic Image Segmentation
- Language Modeling with Gated Convolutional Networks
- Image Quality Assessment: From Error Visibility to Structural Similarity
- Perceptual Losses for Real-Time Style Transfer and Super-Resolution