SDK integration

Install Cocoapods

You need Cocoapods to install the SDK. Follow the installation instructions.

Add dependencies to Podfile

In the Podfile, add the following to any target using the age estimation SDK.

pod 'OwasImage', '~> 0.1.0';

Perform an image analysis

Make sure you have a set of API key and secret

If you haven't created an account yet, visit Privately's developer website to register for a free trial.

Authenticate the core SDK

if !PrivatelyCore.sharedInstance().isAuthenticated() {
    PrivatelyCore.sharedInstance().authenticate(apiKey: apiKey, apiSecret: apiSecret, callback: { result in
        // Handle success/failure
    })
}

Analyze an image for nudity

Nudity analysis is done through the ImageClassifier class. To simply get the result as a boolean, use the following.

let result = ImageClassifier.sharedInstance().containsNudity(image: image)

If you are interested to have a more detailed result, you can get a score associated with each classes (clean, sexy selfie, bikini and NSFW) by requesting

let result = ImageClassifier.sharedInstance().analyseImage(image: image)