Enable Face Attribute Recognition
Subject to your needs, you can enable automatic recognition of such face attributes as gender, age, emotions, glasses, beard, and face mask. This functionality can be activated on both GPU- and CPU-accelerated video object detectors.
To enable automatic recognition of face attributes, do the following:
Open the
/etc/findface-extraction-api.iniconfiguration file.sudo vi /etc/findface-extraction-api.ini
Specify the relevant recognition models in the
extractorssection, as shown in the example below. Be sure to indicate the right acceleration type for each model, matching the acceleration type offindface-extraction-api: CPU or GPU. Be aware thatfindface-extraction-apion CPU can work only with CPU-models, whilefindface-extraction-apion GPU supports both CPU- and GPU-models.extractors: face_age: faceattr/age.v2.gpu.fnk face_beard: faceattr/beard.v0.gpu.fnk face_emotions: faceattr/emotions.v1.gpu.fnk face_gender: faceattr/gender.v2.gpu.fnk face_glasses3: faceattr/glasses3.v0.gpu.fnk face_medmask3: faceattr/medmask3.v2.gpu.fnk
The following models are available:
Face attribute
Acceleration
Configure as follows
age
CPU
face_age: faceattr/age.v2.cpu.fnkGPU
face_age: faceattr/age.v2.gpu.fnkgender
CPU
face_gender: faceattr/gender.v2.cpu.fnkGPU
face_gender: faceattr/gender.v2.gpu.fnkemotions
CPU
face_emotions: faceattr/emotions.v1.cpu.fnkGPU
face_emotions: faceattr/emotions.v1.gpu.fnkglasses
CPU
face_glasses3: faceattr/glasses3.v0.cpu.fnkGPU
face_glasses3: faceattr/glasses3.v0.gpu.fnkbeard
CPU
face_beard: faceattr/beard.v0.cpu.fnkGPU
face_beard: faceattr/beard.v0.gpu.fnkface mask
CPU
face_medmask3: faceattr/medmask3.v2.cpu.fnkGPU
face_medmask3: faceattr/medmask3.v2.gpu.fnkTip
To leave a recognition model disabled, pass the empty value
""to the relevant parameter. Do not remove the parameter itself. Otherwise, the system will be searching for the default model.extractors: face_age: "" face_beard: "" face_emotions: "" face_gender: "" face_glasses3: "" face_medmask3: ""
Note
You can find face attribute recognition models at
/usr/share/findface-data/models/faceattr/.ls /usr/share/findface-data/models/faceattr/ age.v2.cpu.fnk age.v2.gpu.fnk beard.v0.cpu.fnk beard.v0.gpu.fnk emotions.v1.cpu.fnk emotions.v1.gpu.fnk gender.v2.cpu.fnk gender.v2.gpu.fnk glasses3.v0.cpu.fnk glasses3.v0.gpu.fnk medmask3.v2.cpu.fnk medmask3.v2.gpu.fnk liveness.colombo.cpu.fnk liveness.colombo.gpu.fnk liveness.pacs.v0.cpu.fnk liveness.pacs.v0.gpu.fnk quality.v1.cpu.fnk quality.v1.gpu.fnk
Restart
findface-extraction-api.sudo systemctl restart findface-extraction-api
To display the face attribute recognition results in the event list, open the
/etc/findface-security/config.pyconfiguration file.sudo vi /etc/findface-security/config.py
Specify the required models in the following line of the
FFSECURITYsection, subject to the list of enabled models:FFSECURITY = { ... 'FACE_EVENTS_FEATURES': ['gender', 'age', 'emotions', 'beard', 'glasses', 'medmask'], ... }
Restart
findface-security.sudo systemctl restart findface-security