Skip to content

0.2.0

Latest
Compare
Choose a tag to compare
@TeruyaHaroldo TeruyaHaroldo released this 01 Sep 16:09
fbe4b2f

💥 Breaking Changes

Complete breaking changes in the Responses, Methods and your usages. Motivations:

  • Improve cohesion;
  • Patterning with the methods;
  • Prepare for future features, like the "vox"s;

API Responses

Deprecated New Usage
CompareResponse PerseAPIResponse.Face.Compare
DetectResponse PerseAPIResponse.Face.Detect
FaceResponse PerseAPIResponse.Face.Face
MetricsResponse PerseAPIResponse.Face.Metrics
LandmarksResponse PerseAPIResponse.Face.Landmarks

Methods

Deprecated New
fun detect(filePath: String, onSuccess: (DetectResponse) -> Unit, onError: (String) -> Unit) fun detect(filePath: String, onSuccess: (PerseAPIResponse.Face.Detect) -> Unit, onError: (String) -> Unit)
fun detect(byteArray: ByteArray, onSuccess: (DetectResponse) -> Unit, onError: (String) -> Unit) fun detect(byteArray: ByteArray, onSuccess: (PerseAPIResponse.Face.Detect) -> Unit, onError: (String) -> Unit)
fun compare(firstFilePath: String, secondFilePath: String, onSuccess: (CompareResponse) -> Unit, onError: (String) -> Unit) fun compare(firstFilePath: String, secondFilePath: String, onSuccess: (PerseAPIResponse.Face.Compare) -> Unit, onError: (String) -> Unit)
fun compare(firstByteArray: ByteArray, secondByteArray: ByteArray, onSuccess: (CompareResponse) -> Unit, onError: (String) -> Unit) fun compare( firstByteArray: ByteArray, secondByteArray: ByteArray, onSuccess: (PerseAPIResponse.Face.Compare) -> Unit, onError: (String) -> Unit)

✨ New Feature

Face Enrollment

Enrolled faces are persisted and can be used for saving biometric facial features for future use. The enrollment's methods allow you to create, update, delete and get enrolled faces.

face.enrollment.create

  • Responsible for creating new enrollment;
  • Extract the facial features of the largest face;
  • Faces that are not completely inside the image will not be considered;
  • The input can be the image file path or his ByteArray;
  • The onSuccess type is PerseAPIResponse.Face.Enrollment.Create struct;
fun create(
    filePath: String,
    onSuccess: (PerseAPIResponse.Enrollment.Face.Create) -> Unit,
    onError: (String) -> Unit
)
fun create(
    byteArray: ByteArray,
    onSuccess: (PerseAPIResponse.Enrollment.Face.Create) -> Unit,
    onError: (String) -> Unit
)

face.enrollment.update

  • Responsible for update a face enrollment with a new face image;
  • Extract the facial features of the largest face;
  • Faces that are not completely inside the image will not be considered;
  • The input can be the image file path or his ByteArray;
  • The onSuccess type is PerseAPIResponse.Face.Enrollment.Update struct;
fun update(
    filePath: String,
    onSuccess: (PerseAPIResponse.Face.Enrollment.Update) -> Unit,
    onError: (String) -> Unit
)
fun update(
    byteArray: ByteArray,
    onSuccess: (PerseAPIResponse.Face.Enrollment.Update) -> Unit,
    onError: (String) -> Unit
)

face.enrollment.delete

  • Responsible for delete an enrollment;
  • This endpoint expects a "user token" in the url;
  • The onSuccess type is PerseAPIResponse.Face.Enrollment.Delete struct;
fun delete(
    userToken: String,
    onSuccess: (PerseAPIResponse.Face.Enrollment.Delete) -> Unit,
    onError: (String) -> Unit
)

face.enrollment.read

  • Responsible the complete list of the created "user tokens";
  • The onSuccess type is PerseAPIResponse.Face.Enrollment.Read struct;
fun read(
    onSuccess: (PerseAPIResponse.Face.Enrollment.Read) -> Unit,
    onError: (String) -> Unit
)