For customers who do not wish to store information on our server, we also provide the compare API.

Use cases for the compare API (especially when paired with liveness), include Know Your Customer verifications at financial institutions, Customer Onboarding, Id verification etc.

The API compares two sets of face images:

from import CompareRequest
from import SearchMode
from pathlib import Path

image_base_path = Path("sample_images")
image_path_1 = image_base_path / "varun.jpg"

image_path_2 = image_base_path / "varun-spoof.jpg"

compare_request = CompareRequest([image_path], [image_path_2], 

The response is a float number which is a similarity score between the two sets of images.

score =

The CompareRequest object has two properties gallery and probe each of which is a list of images that are to be compared.