Skip to content

0.2.0

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

💥 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
func detect( _ filePath: String, onSuccess: @escaping (DetectResponse) -> Void, onError: @escaping (String, String) -> Void) func detect( _ filePath: String, onSuccess: @escaping (PerseAPIResponse.Face.Detect) -> Void, onError: @escaping (String, String) -> Void)
func detect( _ data: Data, onSuccess: @escaping (DetectResponse) -> Void, onError: @escaping (String, String) -> Void) func detect( _ data: Data, onSuccess: @escaping (PerseAPIResponse.Face.Detect) -> Void, onError: @escaping (String, String) -> Void)
func compare( _ firstFilePath: String, _ secondFilePath: String, onSuccess: @escaping (CompareResponse) -> Void, onError: @escaping (String, String) -> Void) func compare( _ firstFilePath: String, _ secondFilePath: String, onSuccess: @escaping (PerseAPIResponse.Face.Compare) -> Void, onError: @escaping (String, String) -> Void)
func compare( _ firstData: Data, _ secondData: Data, onSuccess: @escaping (CompareResponse) -> Void, onError: @escaping (String, String) -> Void) func compare( _ firstData: Data, _ secondData: Data, onSuccess: @escaping (PerseAPIResponse.Face.Compare) -> Void, onError: @escaping (String, String) -> Void)

✨ 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 Data;
  • The onSuccess type is PerseAPIResponse.Face.Enrollment.Create struct;
func create(
    _ filePath: String,
    onSuccess: @escaping (PerseAPIResponse.Face.Enrollment.Create) -> Void,
    onError: @escaping (String, String) -> Void
)
func create(
    _ data: Data,
    onSuccess: @escaping (PerseAPIResponse.Face.Enrollment.Create) -> Void,
    onError: @escaping (String, String) -> Void
)

face.enrollment.update

  • Responsible for update a face enrollment with a new face image and user token;
  • 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 Data;
  • The onSuccess type is PerseAPIResponse.Face.Enrollment.Update struct;
func update(
    _ filePath: String,
    _ userToken: String,
    onSuccess: @escaping (PerseAPIResponse.Face.Enrollment.Update) -> Void,
    onError: @escaping (String, String) -> Void
)
func update(
    _ data: Data,
    _ userToken: String,
    onSuccess: @escaping (PerseAPIResponse.Face.Enrollment.Update) -> Void,
    onError: @escaping (String, String) -> Void
)

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;
func delete(
    onSuccess: @escaping (PerseAPIResponse.Face.Enrollment.Delete) -> Void,
    onError: @escaping (String, String) -> Void
)

face.enrollment.read

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

🐛 Bug Fix

Fix terms "underexpose" to "underexposure" in the Demo project.

⚡️ Improvements

Change the tests names to the camel case pattern for better reading. This changes has no impact in tests usage.