Skip to content

Client-Side Match

To compare faces for similarity without sending an image to the server, you need to enable the client-side match. For this, follow the described below steps.

1. Add the Core Match framework, see the Installation Guide step 2. By default, if you're using Core Match, the processing is performed on the client side.

2. The processing side (server or client) is regulated by the ProcessingMode parameter:

  • ProcessingModeOffline for client-side processing
  • ProcessingModeOnline for server-side processing

The ProcessingMode setting is located in the MatchFaceConfiguration class.

3. In the app/build.gradle file, include the following within the android block:

aaptOptions {
    noCompress "Regula/faceSdkResource.dat"
}

For example:

build.gradle
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
android {
    applicationId "com.regula.documentreader"
    minSdkVersion 21
    targetSdkVersion 32

    ....
    ....

    aaptOptions {
        noCompress "Regula/faceSdkResource.dat"
    }
}

4. Initialize the Face SDK with a proper license file, see the Initialization page.

5. After that, you can use Face Match as usual, and the processing will be performed on the client side.

To use Face Match via an online service, change the configuration the following way:

MatchFacesRequest request = generateFaceRequest();
MatchFacesConfiguration configuration = new MatchFacesConfiguration.Builder().setProcessingMode(ProcessingMode.ONLINE).build();
FaceSDK.Instance().matchFaces(request, configuration, (response) -> {

});
val request: MatchFacesRequest = generateFaceRequest()
val configuration =
    MatchFacesConfiguration.Builder().setProcessingMode(ProcessingMode.ONLINE).build()
FaceSDK.Instance().matchFaces(
    request, configuration
) { response: MatchFacesResponse? -> }

1. Add the Core Match framework, see Installation Guide. By default, if you're using Core Match, the processing is performed on the client side.

2. The processing side (server or client) is regulated by the ProcessingMode parameter:

  • ProcessingModeOffline for client-side processing
  • ProcessingModeOnline for server-side processing

The ProcessingMode setting is located in the MatchFaceConfiguration class.

3. Initialize the Face SDK with a proper license file, see the Initialization page.