Using Facial Landmarks for Overlaying Faces with Medical Masks
This repository contains the code for Using Facial Landmarks for Overlaying Faces with Masks blog post.
Most of the code is based on the HRNet-Facial-Landmark-Detection repository, huge thanks to them.
Quick start
Environment
This code is developed using Python 3.6 and PyTorch 1.0.0 on Ubuntu 16.04 with NVIDIA GPU. Other platforms or GPUs are not fully tested.
Installation
Create virtual environment:
You'll need to install virtualenv package if you don't have it:
Install dependencies:
You will also need the pre-trained weights, which you can take from here HR18-300W.pth:
Run Demo
To run the demo, you need to execute the following command in your terminal:
Try out different masks from the masks
folder or use yours, but don't forget to annotate them first.
AI Courses by OpenCV
Want to become an expert in AI? AI Courses by OpenCV is a great place to start.