Welcome to enXface AI for iOS documentation! This guide will walk you through the setup and usage of enXface AI library, providing step-by-step instructions and examples to help you integrate face recognition capabilities into your iOS applications.
Getting Started
Installation
To install enXface AI for iOS, follow these steps:
- Open your project in Xcode.
- Navigate to the directory containing your project’s Podfile.
- Add the following line to your Podfile:
pod 'enXfaceAIiOS'
- Save the Podfile and run the command
pod install
in the project directory. - Open your project’s workspace file in Xcode.
- Import the enXfaceAI module in your source files where you want to use face recognition functionalities.
Usage
Initialization
Before using enXface AI, you need to initialize it with your API credentials. Follow these steps to initialize enXface AI:
- Retrieve your API credentials from the enXface AI developer portal.
- In your application’s entry point, add the following code snippet:
enXFaceAI.initialize(apiKey: "your-api-key", secretKey: "your-secret-key")
Face Recognition
enXface AI provides powerful face recognition capabilities. To recognize faces in an image, follow these steps:
- Load an image containing faces into a UIImage object.
- Initialize a FaceRecognition instance with the loaded image.
- Call the
recognizeFaces()
method on the FaceRecognition instance. - Retrieve the recognized faces along with their confidence scores.
Here’s an example code snippet:
let image = UIImage(named: "your-image-name")
let faceRecognition = FaceRecognition(image: image)
let recognizedFaces = faceRecognition.recognizeFaces()
Reference
Class: enXFaceAI
The enXface AI class provides methods for initializing the library and managing API credentials.
Class: FaceRecognition
The FaceRecognition class provides methods for recognizing faces in images.
Troubleshooting
Conclusion
Congratulations! You are now equipped with the knowledge to integrate enXface AI for iOS into your applications. Enjoy the power of face recognition!