This demo app demonstrates how to integrate Microsoft Azure Face REST API on iOS. It utilizes in particularly the Face - Detect and Face - Find Similar endpoints. It showcases how to search/filter photos based on a selected face.
In order to use Microsoft Azure Face API, we need to obtain a Face API subscription key.
- Go to the Cognitive Services signup page.
- Select “Get API Key” for the Face service.
- Signup for a “Free Azure account” (not the “Guest”, as that one has very low limits). Is really free, and you’ll get $200 in credits (which is a LOT).
- Follow all the steps to create a new account (or sign in with your existing Microsoft account).
- Go to the Azure portal.
- Search for “Cognitive Services” in the search bar at top.
- Select “Create cognitive Services”.
- Search for “Face” in the filtering bar that shows up.
- Select “Face” and hit “Create”.
- Set a name, location, pricing tier and select “Create new” resource group.
- Go to All resources > FaceService > Keys and copy and save “KEY 1” (we’ll use it later).
- Go to All resources > FaceService > Pricing tier and make sure the “Standard” tier is selected.
- Clone this repo
$ git clone https://github.com/acotilla91/Microsoft-Azure-iOS-Facial-Recognition-Demo.git
- Open project in Xcode.
- Go to the
AzureFaceRecognition
class and replace<API-KEY>
with the actual API key that was obtained from the account setup steps above. - Run the app.
- Select any of the avatars.
- The collection view should reload its content and display only photos of that person.