ffsecurity

The ffsecurity component serves as a gateway to the FindFace core. It provides interaction between the FindFace Core and the web interface, and the system functioning as a whole. The ffsecurity component includes the following services:

  • findface-security-proto: provides HTTP and web socket (along with Django).
  • findface-security-worker: provides interaction with the other system components.
  • findface-security-monitoring-updater: updates the ffsec_monitoring gallery in the biometric database (see :galleries).
  • findface-security-webhook-updater: pulls webshooks (see Webhooks).

The ffsecurity component also performs the functions of findface-facerouter (part of the FindFace Core), setting processing directives for detected faces. It accepts a face bbox and normalized image along with the original image and other data (for example, the detection date and time) from the findface-video-worker service and redirect them to findface-sf-api for further processing.

The ffsecurity configuration is done through the /etc/ffsecurity/config.py configuration file.

sudo vi /etc/ffsecurity/config.py

MEDIA_ROOT="/var/lib/ffsecurity/uploads"
STATIC_ROOT="/var/lib/ffsecurity/static"

EXTERNAL_ADDRESS="http://172.20.77.78"

DEBUG = False

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'ffsecurity',
    }
}

# use pwgen -sncy 50 1|tr "'" "." to generate your own unique key
SECRET_KEY = '96d515eeb7f5fab1a168b4052ec458ad'

FFSECURITY = {
    'VIDEO_DETECTOR_TOKEN': '7ce2679adfc4d74edcf508bea4d67208',
    'CONFIDENCE_THRESHOLD': 0.75,
    'MINIMUM_DOSSIER_QUALITY': -2,
    'IGNORE_UNMATCHED': False,
    'EXTRACTION_API': 'http://127.0.0.1:18666/',
    'VIDEO_MANAGER_ADDRESS': 'http://127.0.0.1:18810',
    'EVENTS_MAX_AGE': 30,
    'NTLS_HTTP_URL': 'http://127.0.0.1:3185',
    'ROUTER_URL': 'http://172.20.77.78',
    'MONITORING_UPDATE_INTERVAL': 60,
    'SF_API_ADDRESS': 'http://127.0.0.1:18411',
    'EVENTS_FEATURES': ['gender', 'age', 'emotions', 'beard', 'glasses'],
    'LIVENESS_THRESHOLD': 0.945,
    'BEARD_THRESHOLD': 0.7,
}

FFSECURITY_UI_CONFIG = {
    "event": {
        "features": {
            "f_gender_class": ["male", "female"],
            "age": {
                "f_age_gte": "",
                "f_age_lte": ""
            },
            "f_emotions_class": ["angry", "disgust", "fear", "happy", "sad", "surprise"],
            "f_glasses_class": ["none", "eye", "sun"],
            "f_beard_class": ["none", "beard"],
            "f_liveness_class": ["real", "fake"],
        }
    }
}

# integration plugins
INSTALLED_APPS.append('ffsecurity_genetec') # remove or comment out this line to disable genetec integration

When configuring ffsecurity, refer to the following parameters:

Parameter Description
EXTERNAL_ADDRESS External IP address or URL that will be used to access the FindFace Security web interface.
VIDEO_DETECTOR_TOKEN To authorize the video face detection module, come up with a token and specify it here.
VIDEO_MANAGER_ADDRESS IP address of the findface-video-manager host.
NTLS_HTTP_URL IP address of the findface-ntls host.
ROUTER_URL IP address of the ffsecurity host that will receive detected faces from the findface-video-worker instance(s). Specify either external or internal IP address, subject to the network through which findface-video-worker interacts with ffsecurity.
SF_API_ADDRESS IP address of the findface-sf-api host.
IGNORE_UNMATCHED Disable logging events for faces which have no match in the dossiers (negative verification result). Set true if the system has to process a large number of faces.
CONFIDENCE_THRESHOLD Face similarity threshold for verification
MINIMUM_DOSSIER_QUALITY Minimum quality of a face in a dossier photo. Photos containing faces of worse quality will be rejected when uploading to a dossier. Upright faces in frontal position are considered the best quality. They result in values around 0, mostly negative (such as -0.00067401276, for example). Inverted faces and large face angles are estimated with negative values some -5 and less. By default, ’MINIMUM_DOSSIER_QUALITY’: -2 which is the average quality.
EVENTS_FEATURES If you enabled recognition models in the findface-extraction-api configuration file, list them here.
LIVENESS_THRESHOLD 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.