BWS 3 Face Recognition is in preview now!
Performs a biometric enrollment (or training) of a single class with one or more images containing the face of the person to enroll. With this method a new biometric face template is created and stored. It can be used to create a completely new biometric template, to update an existing template or even to upgrade an existing template to a newer encoder version.
The created template is persisted to a storage, addressed by its Biometric Class ID (BCID). Beside of a compact version of the biometric template (used for face matching purposes), an enhanced version of the template is stored. The enhanced version contains at least all calculated face features (standard template) and optionally also the thumbnails of the enrolled faces (full version), which are needed for upgrades to newer encoder versions. The enhanced template versions are always encrypted, the compact version is encrypted if required by the configuration of the client (slows down search requests).
The Enroll
API is defined as a unary RPC:
rpc Enroll (FaceEnrollmentRequest) returns (FaceEnrollmentResponse);
message FaceEnrollmentRequest {
int64 classId = 1;
repeated ImageData images = 2;
}
message FaceEnrollmentResponse {
JobStatus status = 1;
repeated JobError errors = 2;
repeated ImageProperties image_properties = 3;
EnrollmentAction performed_action = 4;
int32 enrolled_images = 5;
FaceTemplateStatus template_status = 6;
enum EnrollmentAction {
NONE = 0;
NEW_TEMPLATE_CREATED = 1;
TEMPLATE_UPDATED = 2;
TEMPLATE_UPGRADED = 3;
ENROLLMENT_FAILED = -1;
}
}
The FaceEnrollmentRequest
message has the fields as follows:
classId
The unique class ID of the enrolled person. The class ID is a 64-bit positive number, managed by the client.
This ID, together with a storage name and a partition ID will make up the Biometric Class ID (BCID), which is used to address the created biometric template.
images
The maximum API request size is 50 MB
.
This API requires a valid JWT in the Authorization request header and accepts an optional reference number.
Authorization | Required Bearer authentication. Please refer to BWS API Authentication for a description of how to provide a valid JWT here. |
Reference-Number | Optional, client specific reference number, which will be added to the BWS bookkeeping as well as to the response header. You typically use this reference to link the resulting BWS bookkeeping entries with your logs. |
On success the API returns a FaceEnrollmentResponse
message:
status
errors
may have occurred, even if the job was completed successfully.
errors
performed_action
field will typically be set to ENROLLMENT_FAILED
.
image_properties
performed_action
The actual action performed. This is a value out of the EnrollmentAction
enumeration:
NONE
NEW_TEMPLATE_CREATED
TEMPLATE_UPDATED
TEMPLATE_UPGRADED
ENROLLMENT_FAILED
errors
field) and no action was performed.
enrolled_images
template_status
Please note, that even if a biometric face template has been enrolled successfully,
not all images and found faces may have considered, as no face or multiple faces may have been
found on an image, or feature extraction failed.
Refer to the image_properties
(especially the quality_assessments
field) to find out more.
In case that the performed_action
field is set to ENROLLMENT_FAILED
, at least one of the following errors is reported in the errors
field:
Beside of the success return status code OK (0), this call might also return one of the following gRPC error status codes to indicate an error:
All successful BWS gRPC calls return a response header and a response trailer containing additional information about the request:
Response Header | |
jobid | The Job-ID (a GUID) that has been assigned to this BWS call. |
bws-version | The version of the BWS gRPC service. |
reference-number | An optional reference number as provided in the request header. |
date | The timestamp when the request has been received at the server. |
... | Other headers that might have been added by the server (NGINX, Kestrel, ...) that was handling the request. |
Response Trailer | |
response-time-ms | The timespan in milliseconds the request spent at the BWS service. |
... | Other trailers, like exception trailers, which are added by the gRPC framework in case an RPC exception occurred. |