.. _liveness: 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 :ref:`case investigation `. The face liveness detector can be automatically enabled and configured during the :ref:`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. .. rubric:: In this section: .. contents:: :local: Enable Face Liveness Detector --------------------------------- To enable the face liveness detector, do the following: #. 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. .. code:: 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 .. code:: 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 #. Restart ``findface-video-worker``. .. code:: 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. .. code:: sudo vi /etc/findface-security/config.py LIVENESS_THRESHOLD: 0.85,