Facelytics is an SDK allowing mobile apps to detect faces and then make gender predictions and age predictions on faces. For more information about Facelytics.
CocoaPods is the recommended way to add Facelytics to your project.
- Add a pod entry for Facelytics to your Podfile :
pod "Facelytics"
-
Install the pod(s) by running
pod install
. -
Include Facelytics wherever you need it with
#import <Facelytics_SDK/Facelytics_SDK.h>
from Objective-C orimport Facelytics_SDK
from Swift.
-
Download the latest code version or add the repository as a git submodule to your git-tracked project.
-
Include Facelytics wherever you need it with
#import <Facelytics_SDK/Facelytics_SDK.h>
from Objective-C orimport Facelytics_SDK
from Swift.
To run the example project just open it and run. The framework is already included. Make sure you also see Facelytics documentation. Attention : To use the SDK, you need a License Key you can on the Facelytics website
The sample code is commented and show usage exemples of the SDK.
###Basics
-
Add the following import to the top of the file or the bringing header for swift:
import Facelytics_SDK
-
Instantiate a Facelytics object
facelyticsInstance = Facelytics(licenceKey: "your license key", completion: nil)
- Load the prediction models in the Facelytics instance
facelyticsInstance?.loadModels(completion: { (error) in
if let error = error {
print("❌ Cannot initialize Facelytics \(error.localizedDescription)")
} else {
}
})
- Make face detections from picture
FacelyticsService.shared.facelyticsInstance?.detectFaces(image: sourceGroupImage, completion: { (faces, error) in
if let faces = faces,
!faces.isEmpty {
/// Handle detected faces
}
})
- You can now use prediction for gender and age
FacelyticsService.shared.facelyticsInstance?.facelyticsPredict(faceToPredict: face.image, completion: { predictionResult, error in
/// Handle result
})
- Xcode 11
- iOS 12
Facelytics is available under a commercial license. See the LICENSE file for more info.
Wassa, contact@wassa.fr