findface-security

The findface-security component serves as a gateway to the FindFace core. It provides interaction between the FindFace Core and the web interface, the system functioning as a whole, HTTP and web socket (along with Django), database update, and webhooks.

The findface-security 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 findface-security 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.58"

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 = 'c8b533847bbf7142102de1349d33a1f6'

FFSECURITY = {
   'VIDEO_DETECTOR_TOKEN': '381b0f4a20495227d04185ab02f5085f',
   '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.58',
   '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,
}

ASGI_THREADS = 16

UVICORN_SETTINGS = {
   'workers': 4,
   'host': 'localhost',
   'port': 8002,
 }

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 findface-security, 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 findface-security 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 findface-security.
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 confidence threshold, it will return a binary result real or fake.
BEARD_THRESHOLD The presence of a beard on a face is determined with a certain level of confidence. Depending on the confidence threshold, the system returns a binary result none or beard.

Warning

The FFSECURITY section must end with the EVENTS_FEATURES/ LIVENESS_THRESHOLD/ BEARD_THRESHOLD parameters which have to be given in this very order.

...
'SF_API_ADDRESS': 'http://127.0.0.1:18411',
'EVENTS_FEATURES': ['gender', 'age', 'emotions', 'beard', 'glasses'],
'LIVENESS_THRESHOLD': 0.945,
'BEARD_THRESHOLD': 0.7,