Biometrics Android
1.3
Search
K

FacialTrainingModel

import com.sybrin.facialrecognition.models.FacialTrainingModel

Summary

Uploading model

If for some reason the model failed to upload during the normal operations of the SDK you can upload it at a later time.

For example:

sfr.trainFace(identifier)
.addOnSuccessListener(new FacialTrainer.OnSuccessListener<FacialTrainingModel>() {
@Override
public void onSuccess(FacialTrainingModel result) {
result.addOnModelUploadSuccessListener(new FacialTrainingModel.OnModelUploadSuccessListener() {
@Override
public void onModelUploadSuccess(float timeTaken) {
//Handle upload success
}
}).addOnModelUploadFailureListener(new FacialTrainingModel.OnModelUploadFailureListener() {
@Override
public void onModelUploadFailure(FacialRecognitionException ie) {
//Handle upload failure
}
}).uploadModel();
}
});
Sybrin does not provide user management for the identifiers that are used to train and recognize on a specific license key. The proper management and storage of unique identifiers is the sole responsibility of the developer.

Public methods

addOnModelUploadFailureListener

public FacialTrainingModel addOnModelUploadSuccessListener (OnModelUploadFailureListener onModelUploadFailureListener)
Adds a on failure callback for the uploadModel method. Returns the current instance of FacialTrainingModel.
Parameters
Callback that gets called when uploadModel methods fails.
Returns
Value cannot be null.

addOnModelUploadSuccessListener

public FacialTrainingModel addOnModelUploadSuccessListener (OnModelUploadSuccessListener onModelUploadSuccessListener)
Adds a on success callback for the uploadModel method. Returns the current instance of FacialTrainingModel.
Parameters
Callback that gets called when uploadModel methods succeeds.
Returns
Value cannot be null.

getIdentifier

public Bitmap getIdentifier ()
Returns the identifier used to train the facial recognition model.
Returns
String
Value cannot be null.

getTrainedImages

public List<Bitmap> getTrainedImages ()
Returns a list of the images used for training the facial recognition model.
Returns
List<Bitmap>
Value cannot be null.

getTrainingTimeTakenMilliseconds

public String getTrainingTimeTakenMilliseconds ()
Returns the time it took to train the facial recognition model in milliseconds.
Returns
float

getUploadTimeTakenMilliseconds

public String getUploadTimeTakenMilliseconds ()
Returns the time it took to upload the trained facial recognition model in milliseconds.
Returns
float

isUploaded

public Bitmap isUploaded ()
Returns the a boolean indicating whether the trained facial recognition model was uploaded online.
Returns
boolean
true if model was uploaded, false if otherwise.

uploadModel

public void uploadModel ()
Uploads the current trained facial recognition model if it has not been uploaded yet. Result are posted to the onModelUploadSuccessListener and onModelUploadFailureListener respectively.