Convert face dataset to masked-face dataset

GitHub Repo

Managed By Aqeel Anwar
ICSRL Lab Georgia Tech
Governed by Creative Commons license

slider image

What is MaskTheFace?

MaskTheFace is computer vision-based script to mask faces in images. It uses a dlib based face landmarks detector to identify the face tilt and six key features of the face necessary for applying mask. Based on the face tilt, corresponding mask template is selected from the library of mask. The template mask is then transformed based on the six key features to fit perfectly on the face. The complete block diagram can be seen below. MaskTheFace provides a number of masks to select from. It is difficult to collect mask dataset under various conditions. MaskTheFace can be used to convert any existing face dataset to masked-face dataset. MaskTheFace identifies all the faces within an image, and applies the user selected masks to them taking into account various limitations such as face angle, mask fit, lighting conditions etc. A single image, or entire directory of images can be used as input to code.


Support for multiple mask types

MaskTheFace supports various mask-types such as surgical, N95, cloth etc. Moreover, user can easily configure MaskTheFace for any new/custom mask type by following simple guidelines. More mask types are constantly being added to the tool.

More info

Support for various mask variations

Various existing patterns and/or color overlays can be applied to existing mask types to create more variations of the masks. Moreover, users can easily add custom patterns following the guidelines provided

More info

Support for both single and multi-face images:

MaskTheFace applies user-selected masks to all the faces present in the image.

More info

Wide face angle coverage

A wide range of fave tilt and angle is considered to apply proper mask to the faces. Based on the face angle, one of three templates is selected and applied.

Bulk masking on datasets

Any face dataset can be converted to masked faced dataset with a simple script. This is particularly useful when dealing wuth bulk images.

More info

MFR2 Dataset

A small dataset of real-world masked faces of 53 identities and 269 images aligned and preprocessed. This dataset can be used to evaluate how well the simulated mask domain is transferred to real masks

More info



MaskTheFace is maintained as a GitHub repository. A complete detail on how to download and install it can be found here .

MFR2 Dataset

Complete MFR2 dataset along with the .txt detail and pairs file can be downloaded from here .


If you find this repository useful for your research please use the following bibtex citations

title={Masked Face Recognition for Secure Authentication},
author={Aqeel Anwar and Arijit Raychowdhury},


This work was supported in part by C-BRIC, one of six centers in JUMP, a Semiconductor Research Corporation(SRC) program sponsored by DARPA