This is a PyTorch implementation by referreing LipForensics paper.
This is an Unofficially implemented codes with some Official code. I made this repo to use more conveniently.
If you want to see the Original code, You can cite this link
You should try the preprocessing, which steps are firstly getting landmarks and then cropping mouth.
pip install -r requirements.txt
Note: we used Python version 3.8 to test this code.
- Follow the links below to download the datasets (you will be asked to fill out some forms before downloading):
- FaceForensics++ (FF++) / FaceShifter (c23)
- DeeperForensics
- CelebDF-v2
- DFDC (the test set of the full version, not the Preview)
- Extract the frames (e.g. using code in the FaceForensics++ repo.) The filenames of the frames should be as follows: 0000.png, 0001.png, ....
- Detect the faces and compute 68 face landmarks. From this step, see 4.1 section.
For extraction the landmark of faces, I referred RetinaFace and FAN for good results. The results are .json files
You can use easy_start_lip_extract.ipynb
This will write the mouth images into the corresponding cropped_mouths
directory.
python preprocessing/crop_mouths.py --dataset all