Playground biometrics demo BioID home page

Face Recognition Method Verify

Performs a one-to-one comparison of the uploaded face image with a stored biometric template in order to verify whether the individual is the person he or she claims to be.

Service method definition

The Verify API is defined as a unary RPC:

rpc Verify (FaceVerificationRequest) returns (FaceVerificationResponse);

message FaceVerificationRequest {
    int64 classId = 1;
    ImageData image = 2;
}

message FaceVerificationResponse {
    JobStatus status = 1;
    repeated JobError errors = 2;
    ImageProperties image_properties = 3;
    bool verified = 4;
    double score = 5;
}

Request

The FaceVerificationRequest message has the fields as follows:

classId
The unique class ID of the person to verify. The class ID is a 64-bit positive number, managed by the client. This ID, together with the configured storage name and a partition ID will make up the Biometric Class ID (BCID), which is used to load the biometric face template to compare the given image with.
image
An ImageData messages containing the facial image to verify.

The maximum API request size is 50 MB.

Request Headers

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.

Response

On success the API returns a FaceVerificationResponse message:

status
The status of the BWS job that processed the request. Please note that errors may have occurred, even if the job was completed successfully.
errors
A list of errors that might have occurred while the request has been processed.
image_properties
The calculated image properties for the provided image.
verified
Verification decision made by BWS. Set to true, when the person specified by the given class ID could have been verified successfully with the given sample; false otherwise, or when errors occurred (see errors for details).
score

The calculated verification score (a value between 0.0 and 1.0) that led to the verified decision. The higher the score, the more likely the face in the image and the template referenced by the class ID belong to the same person.

Although we use a normed score here, this score is based on the model used to create the referenced biometric template. Therefore we advise against using it for decision-making.

BWS Errors

In case that the verified field is set to false, some errors might have been reported:

FaceNotFound
No suitable face was found in the provided image.
MultipleFacesFound
More than one face has been found in the provided image.
ThumbnailExtractionFailed
The found face could not be extracted, typically because it is too close to the edge.
DifferentFeatureVersions
Internal: A mixup of different face feature vector versions was encountered.

gRPC Errors

Besides 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:

Cancelled (1)
Client application cancelled the request.
Unknown (2)
Server experienced some unexpected behaviour.
InvalidArgument (3)
Client specified an invalid argument:
  • The service cannot decode the provided input image, e.g. because the format cannot be detected or the image is too big.
  • A positive number is required for the class ID.
DeadlineExceeded (4)
Deadline expired before operation could complete.
NotFound (5)
A biometric face template for specified class ID does not exist.
Internal (13)
Internal errors indicate that critical system invariants have been violated. If you encounter one of these errors, it means something is severely wrong. These errors can occur due to an invalid service configuration, a misconfigured client, or an unexpected exception.
Unavailable (14)
The service is currently unavailable. This is a most likely a transient condition and may be corrected by retrying with a backoff.
Unauthenticated (16)
The request does not have valid authentication credentials for the operation.

Response Headers/Trailers

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 is 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.