The Trueface Developer Hub

Welcome to the Trueface developer hub. You'll find comprehensive guides and documentation to help you start working with Trueface as quickly as possible, as well as support if you get stuck. Let's jump right in!

Trueface Android SDK

Getting started with Trueface Android's SDK

version 2.3 (SDK 0.3) Beta - supports arm64-v8a and x86 — also supports Xamarin amd64 / x86, android minSdkVersion is 24
This Android binding of Trueface SDK is in beta status, subject for further improvement, enhancement and additional of features.

License

To obtain a License key, please contact our sales team and provide your applicationId

Configuration

To setup Trueface mobile SDK in Android Studio, please import trueface-*.aar as new module (FIle -> New -> New Module), then add it as dependency via module settings.

Quick Example

Initialize the SDK, set and check validity of license

SDK sdk = new SDK();
sdk.setLicense(“…”);
if (sdk.isLicensed()) {
	
}

Set Image from Bitmap

ErrorCode errorCode = sdk.setImage(bitmap);

Detect objects in image

BoundingBox[] boundingBoxs = sdk.detectObjects();
for (BoundingBox boundingBox: boundingBoxs) {
	
}

Test liveness by detecting blinking

BlinkDetection blinkDetection = sdk.detectBlink();
if (blinkDetection.isBlinking) {
	
}

Detect largest face

FaceBoxAndLandmarks faceBoxAndLandmarks = sdk.detectLargestFace();

Face recognition

ConfigurationOptions options = new ConfigurationOptions();
options.smallestFaceWidth = 40;

SDK sdk = new SDK(options);
sdk.setLicense(“…”);

Bitmap bitmap = getBitmapFromAsset("mr_bean.jpg");
ErrorCode errorCode = sdk.setImage(bitmap);
float[] vector1 = sdk.getLargestFaceFeatureVector();

bitmap = getBitmapFromAsset(appContext, "mr_bean_2.jpg");
errorCode = sdk.setImage(bitmap);
float[] vector2 = sdk.getLargestFaceFeatureVector();

Similarity similarity = sdk.getSimilarity(vector1, vector2);
If (similarity.similarityMeasure > 0.6) {
	
}

Post estimation

FaceBoxAndLandmarks faceBoxAndLandmarks = sdk.detectLargestFace();
EstimateHeadOrientation estimateHeadOrientation = sdk.estimateHeadOrientation(faceBoxAndLandmarks);

API

// parent SDK version
String getVersion()
// mobile SDK version
String getMobileVersion()

// Validates the given license token. Need to call this method before being able to use the SDK.
boolean setLicense(String token)
boolean isLicensed()

// Set the image that is processed by the other methods.
ErrorCode setImage(Bitmap bitmap, ColorCode color)

// Detect people and objects in the image.
BoundingBox[] detectObjects()
// Estimate score for eyes blink
BlinkDetection detectBlink()

// Detect the largest face in the image.
FaceBoxAndLandmarks detectLargestFace()
// Detect the largest face in the image and return its feature vector.
float[] getLargestFaceFeatureVector()
// Compute the similarity between two feature vectors, or how similar two faces are.
Similarity getSimilarity(float[] featureVector1, float[] featureVector2)
// Estimate the head pose.
EstimateHeadOrientation estimateHeadOrientation(FaceBoxAndLandmarks faceBoxAndLandmarks)

Updated about a month ago

Trueface Android SDK


Getting started with Trueface Android's SDK

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.