Skip to main content

How to use only specific packages

Since v1.4.0, Banuba SDK provides platform-specific packages. Only iOS and Android platforms are supported for now.

The SDK is packaged as CocoaPods' pods for iOS and .aar packages published to GitHub Packages for Android.

For simplicity, SDK provides a metamodule banuba_sdk which depends on all available modules. It can be used for "quick start" and guarantee that any effect will work correctly. All Face AR SDK examples on Github use it.

Sometimes you also may need the sdk_api module, for example when you want to use BanubaSdkManager class. This module is lightweight, so you can add it every time.

module nameiOS packageAndroid package
sdk_apiBNBSdkApicom.banuba.sdk.sdk_api

Use only the modules with the same version, modules with different versions (even minor) may conflict or just work incorrectly with each other.

There are a few small examples below, demonstrating the usage in background segmentation feature only.

iOS example with CocoaPods

Podfile
source 'https://github.com/sdk-banuba/banuba-sdk-podspecs.git'

target '<target name>' do
# optional packages
pod 'BNBSdkApi', '=1.4.0'
# feature-specific packages
pod 'BNBBackground', '=1.4.0'
# ...
end

See platform-specific article to find more details about CocoaPods usage.

iOS example with SPM (Swift Package Manager)

  1. Go to your project settings in XCode, select Swift Packages tab.
  2. Click on + icon and enter the next GitHub’s link: https://github.com/sdk-banuba/BNBSdkApi .
  3. Click on Add Package button. After verifying the package, press button Add Package again.
  4. Click on + icon and enter the next GitHub’s link: https://github.com/sdk-banuba/BNBBackground .
  5. Click on Add Package button. After verifying the package, press button Add Package again.

You can also choose which rule to download packages by. By default, Branch is selected.

Branch — This rule will download current source that is available on branch.

Commit — This rule will download source from commit specified by given hash.

Exact Version - This rule will download source from version of release specified by given GitHub’s release.

See platform-specific article to find more details about SPM usage.

Android example

build.gradle
allprojects {
repositories {
google()
mavenCentral()

maven {
name "GitHubPackages"
url "https://maven.pkg.github.com/sdk-banuba/banuba-sdk-android"
credentials {
username = "sdk-banuba"
password = "\u0067\u0068\u0070\u005f\u0033\u0057\u006a\u0059\u004a\u0067\u0071\u0054\u0058\u0058\u0068\u0074\u0051\u0033\u0075\u0038\u0051\u0046\u0036\u005a\u0067\u004f\u0041\u0053\u0064\u0046\u0032\u0045\u0046\u006a\u0030\u0036\u006d\u006e\u004a\u004a"
}
}
}
}
build.gradle
dependencies {
// optional packages
implementation "com.banuba.sdk:sdk_api:1.4.0"
// feature-specific packages
implementation "com.banuba.sdk:background:1.4.0"
// ...
}

See platform-specific article to find more details about packages usage.

List of all available packages

module nameiOS packageAndroid package
sdk_coreBNBSdkCorecom.banuba.sdk.sdk_core
effect_playerBNBEffectPlayercom.banuba.sdk.effect_player
scriptingBNBScriptingcom.banuba.sdk.scripting
face_trackerBNBFaceTrackercom.banuba.sdk.face_tracker
lipsBNBLipscom.banuba.sdk.lips
hairBNBHaircom.banuba.sdk.hair
handsBNBHandscom.banuba.sdk.hands
occlusionBNBOcclusioncom.banuba.sdk.occlusion
eyesBNBEyescom.banuba.sdk.eyes
skinBNBSkincom.banuba.sdk.skin
backgroundBNBBackgroundcom.banuba.sdk.background
bodyBNBBodycom.banuba.sdk.body
acne_eyebags_removalBNBAcneEyebagsRemovalcom.banuba.sdk.acne_eyebags_removal
neurobeauty_makeupBNBNeurobeautyMakeupcom.banuba.sdk.neurobeauty_makeup
banuba_sdk_resourcesBNBResourcescom.banuba.sdk.banuba_sdk_resources
banuba_sdkBanubaSdkcom.banuba.sdk.banuba_sdk
pose_estimationBNBPoseEstimationcom.banuba.sdk.pose_estimation

sdk_core - provides the functionality of EffectPlayer. Detailed description of EffectPlayer can be found here.

effect_player - contains the necessary shaders, used by sdk_core module and provide the following features: math utilities, texture utilities, morphing, beautification, etc.

scripting - includes the basic functionality used by effect api, see effect api.

This first three modules are the core of BanubaSDK and shouldn't be included in your application, they are dependencies for other modules. All other packages that will be listed below are feature-specific and can be enabled as needed. This will keep the build minimal.

face_tracker - package consists of neural network models used to track face and parts of the face such lips, eyes, etc. Include it whenever you deal with tracking. See more about FRX.

lips - provides neural network models for lips segmentation. See more about Lips Segmentation.

hair - provides neural network models for hair segmentation. See more about Hair Segmentation.

occlusion - provides occlusion neural network. It is used to detect face collisions with different objects in the screen.

eyes - provides neural network models for eyes segmentation. See more about Eye Segmentation.

skin - provides neural network models for skin segmentation. See more about Skin Segmentation.

background - provides neural network models for background separation. See more about Background Separation.

body - provides neural network model to recognize the human body in full and separate it from the background in images and videos.

acne_eyebags_removal - provides neural network models for acne removal and eye bags removal.

neurobeauty_makeup - provides some makeup-specific textures and other internal use files.

banuba_sdk_resources - this module includes all the resources of the BanubaSDK: shaders, js api (effect_api), neural networks, etc. The same effect will be achieved if you include modules from effect_player to neurobeauty_makeup into your app.

banuba_sdk - this module contains all of the above modules from sdk_core to neurobeauty_makeup. Use it when you don't care about the size or you need all the features.