This is a tool that can be used to create masked versions of existing image datasets and study visual recognition problems, such as face identification/verification or emotion recognition in the presence of medical face masks.
It also has fast ML inference & processing accelerated even on common hardware and can be utilized in real-time applications.
Input | Output |
---|---|
Install the required packages below:
pip install mediapipe
pip install opencv-python
pip install tqdm
Apply mask on a single image:
python mask_on_img.py IMAGE_NAME
Apply mask on multiple videos, by creating a folder 'videos' in the same directory and running:
./mask.sh
Apply mask in real-time on multiple faces with webcam input:
python mask_webcam.py
Original | Face Mesh | Jawlines | Masked |
---|---|---|---|
-
Face Mesh tracking with Google's MediaPipe Face Mesh.
-
Jawline extraction in lines 43-69 in
mask.py
and face_mesh_model.png