Media Server can automatically enroll unrecognized faces (add them to the training database).
A configuration to enroll unrecognized faces is included with Media Server (faceenroll.cfg
, in the configurations
folder). It contains the following steps:
RecognitionThreshold
parameter to specify the minimum confidence required to successfully recognize a face.identity
element in their metadata.GetFaceImage
after enrollment is complete.The following procedure describes how to configure an enroll task, and the example configuration that includes all of these tasks is included below.
To automatically enroll faces
Open the configuration that you want to modify.
In the [Analysis]
section, add a new task by setting the AnalysisEngineN
parameter.
Create a new configuration section that matches the name of the task and configure Media Server to enroll the images. Use the following configuration parameters:
Type
|
The engine to use. Set this parameter to Enroll . |
Module
|
Set this parameter to Face . |
Input
|
The track that contains the images to enroll. |
Database
|
The name of the database to add the faces to. HPE recommends that you add faces to a new database, not the database you use for recognition. An operator can then check the enrolled faces. For example, you should make sure that all of the images added to a face represent the same person. After verifying the enrolled faces, you can move them to the correct recognition database. |
PostAction
|
Specifies what Media Server should do after enrolling an image in the database. The default value, build , trains Media Server to recognize the face. |
PostSyncDatabase
|
Specifies whether Media Server should synchronize with the training database after enrolling an image. You might want to use this parameter if you are adding faces to the same database that is used for recognition. If an unrecognized face appears again but you have not trained Media Server and synchronized with the database, the face remains unrecognized. This means that Media Server adds another entry to the database for the same face. If you are enrolling faces in a different database to the one that is used for recognition, there is no need to set this parameter. |
Identifier
|
The identifier to use when adding a new face to the database. HPE recommends using the macro %record.id% , because this identifier is set by the face detection task and is unique for each detected face. |
For example:
[EnrollFaces] Type=Enroll Module=Face Input=CropFaces.Output Database=EnrolledFaces PostAction=Build PostSyncDatabase=TRUE Identifier=%record.id%
Save and close the configuration file. HPE recommends that you save your configuration files in the location specified by the ConfigDirectory
parameter.
[Ingest] IngestEngine=AV [AV] Type=libav [Analysis] AnalysisEngine0=FaceDetect AnalysisEngine1=FaceRecognize AnalysisEngine2=EnrollFace [FaceDetect] Type=FaceDetect NumParallel=6 [FaceRecognize] Type=FaceRecognize Input=FaceFilter.Output Database=People NumParallel=2 MaxRecognitionResults=1 // Faces that do not meet the recognition threshold are considered // to be unknown and are enrolled in the database. RecognitionThreshold=65 [EnrollFace] Type=Enroll Module=Face Input=CropToFace.Output Database=EnrolledFaces Identifier=%record.id% [EventProcessing] EventProcessingEngine0=FaceFilter EventProcessingEngine1=UnknownFaces [FaceFilter] // Filter out profile faces, and those partially outside image Type=Filter Input=FaceDetect.ResultWithSource LuaScript=configurations/frontalface.lua [UnknownFaces] // Discard recognized faces (those that have an identifier set). Type=Filter Input=FaceRecognize.ResultWithSource LuaScript=configurations/unknownface.lua [Transform] TransformEngine=CropToFace [CropToFace] Type=Crop Input=UnknownFaces.Output Border=50 [Output] OutputEngine=XML [XML] // Record new identities, and any training errors Type=XML Mode=SingleRecord Input=EnrollFace.Result XMLOutputPath=output/%session.token%/enrollment_%record.id%.xml
The script frontalface.lua
contains the following function, to discard faces that appear in profile or are partially outside the image:
function pred(x) return x.FaceResultAndImage.face.outofplaneanglex ~= 90 and x.FaceResultAndImage.face.outofplaneanglex ~= -90 and x.FaceResultAndImage.face.percentageinimage > 95 end
The script unknownface.lua
contains the following function, to discard faces that were successfully recognized:
function pred(x) return x.FaceRecognitionResultAndImage.identity.identifier == nil end
|