The main goal of this project is to check whether the given image is a real or fake face (liveness) and compare between 2 faces which is expected to have a high of accuracy and light weight. This repo is inspired by Silent Face Anti Spoofing and uses some of the file and code in it, but we use our own custom model.
conda env create -f environment.yml
Activate venv:
conda activate python-ekyc
Tested on python 3.8
pip install -r requirements.txt
Place your image in sample
folder.
Command to run:
python main.py --filename suzuka-nakamoto.jpg
Output:
Face detected
Image 'suzuka-nakamoto.jpg' is Real Face.
Score: 1.39.
Blur score: 345.25
Elapsed time 2.80 s
- Auto rotate image
- Align face
- Detect spoof image/face
- Compare between 2 faces
- The images provided must have a 3:4 (w:h) ratio.
- If the face is rotated, e.g 90 degrees, the depiction of facial landmarks is invalid.