Enable Face Liveness Detection

The FindFace face liveness detector tells apart live faces from face images. The face liveness binary result real/fake serves as one of the filters for detected face analysis during case investigation.

The face liveness detector can be automatically enabled and configured during the installation. If you skip this step, you can manually do so afterwards, following the instructions below.

Note

The face liveness detector functions on both GPU- and CPU-acceleration. However, it is much slower on CPU.

In this section:

Enable Face Liveness Detector

To enable the face liveness detector, do the following:

  1. Open the /etc/findface-video-worker-gpu.ini (/etc/findface-video-worker-cpu.ini) configuration file. In the liveness section, specify the path to the neural network model (fnk) used in the face liveness detector.

    sudo vi /etc/findface-video-worker-gpu.ini
    
    #------------------------------
    [liveness]
    #------------------------------
    ## path to liveness fnk
    ## type:string env:CFG_LIVENESS_FNK longopt:--liveness-fnk
    fnk = /usr/share/findface-data/models/faceattr/liveness.pacs.v0.gpu.fnk
    
    sudo vi /etc/findface-video-worker-cpu.ini
    
    #------------------------------
    [liveness]
    #------------------------------
    ## path to liveness fnk
    ## type:string env:CFG_LIVENESS_FNK longopt:--liveness-fnk
    fnk = /usr/share/findface-data/models/faceattr/liveness.pacs.v0.cpu.fnk
    
  2. Restart findface-video-worker.

    sudo systemctl restart findface-video-worker-gpu
    sudo systemctl restart findface-video-worker-cpu
    

Configure Liveness Threshold

If necessary, you can adjust the liveness threshold in the /etc/findface-security/config.py configuration file. The liveness detector will estimate a face liveness with a certain level of confidence. Depending on the threshold value, it will return a binary result real or fake.

Note

The default value is optimal. Before changing the threshold, we recommend you to seek advice from our experts by support@ntechlab.com.

sudo vi /etc/findface-security/config.py

LIVENESS_THRESHOLD: 0.85,