I've been trying to use the AWSRekognition SDK in order to compare face. However, Amazon has no Documentation on how to integrate their SDK with iOS. They have links that show how to work with Recognition (Developer Guide) with examples only in Java and very limited.
I wanted to know if anyone knows how to integrate AWS Rekognition in Swift 3. How to Initialize it and make a request with an image, receiving a response with the labels.
I have AWS Signatures AccessKey, SecretKey, AWS Region, Service Name. also Body
{
"SourceImage": {
"S3Object": {
"Bucket": "bucketName",
"Name": "ios/sample.jpg"
}
},
"TargetImage": {
"S3Object": {
"Bucket": "buketName",
"Name": "ios/target.JPG"
}
}
}
how can I initialize Rekognition and build a Request.
Thanks you!
Instantiate the Rekognition Client, Here I'm using the client with the default configuration.
Otherwise, you can use the credentials as follows:
Now construct the request and set the image in it.
Now to compare faces, read about the CompareFacesRequest: https://github.com/aws/aws-sdk-ios/blob/master/AWSRekognition/AWSRekognitionService.m#L288
There is a sample test in the SDK that compares two faces in ObjC but you can translate that in Swift:
https://github.com/aws/aws-sdk-ios/blob/master/AWSRekognitionUnitTests/AWSGeneralRekognitionTests.m#L60