OWAS SDK integration
Add maven repository
In the settings.gradle
add the following to repositories
maven {
url "https://privately.jfrog.io/artifactory/margin-libs/"
}
maven {
url "https://privately.jfrog.io/artifactory/owas-libs/"
}
Add SDK dependencies
Add the following to any module using the SDK
implementation 'privately-sdk:core:1.0.2'
implementation 'owas-sdk:owas-image:1.0.2'
implementation 'owas-sdk:owas-csam:1.0.0'
implementation 'privately-sdk:age-estimation-image:1.4.0'
You're good to go!
Perform some image analyses
Make sure you have a set of API key and secret
If you haven't created an account yet, visit https://developer.privately.eu/contact-us to register for a free trial.
Authenticate the core SDK
PrivatelyCore.INSTANCE.init(this);
if (!PrivatelyCore.INSTANCE.isAuthenticated()) {
PrivatelyCore.INSTANCE.authenticate("API key", "secret key",
new PrivatelyCore.AuthenticationCallback() {
@Override
public void onSuccess() {
Log.e(TAG, "Authenticated successfully");
}
@Override
public void onError(String error) {
Log.e(TAG, "Error authenticating: " + error);
}
});
}
Analyze an image for CSAM
CSAM detection is done through the CsamAnalyzer
enum. First of all make sure the CsamAnalyzer
is initialised.
CsamAnalyzer.INSTANCE.init(context);
To find out if an image contains CSAM, use the following call:
boolean containsCsam = CsamAnalyzer.INSTANCE.containsCsam(image);