A method for adding a mask on a non-masked face image. Given a real masked face image (a) and a non-masked face image (d), we synthesize a photo-realistic masked face image with the mask from (a) and the facial area from (d).
- python >= 3.7.1
- pytorch >= 1.1.0
- Extract the landmarks. You can extract the 106 landmarks by our face sdk or any other methods.
- Add a mask on a face image. You can refer to add_mask_one.py as an example.
python add_mask_one.py
If you use a different version of Python, you should rebuild the mesh_core_cython.so as descriped in face3d,
cd utils/mesh/cython
python setup.py build_ext -i
This project is mainly inspired by PRNet, face3d and pytorch-prnet