FaceUnity AR Filter

Updated

Integrate and use the FaceUnity AR Filter extension in your Android, iOS, or Flutter app.

The FaceUnity AR Filter extension uses 3D vision, 3D graphics, and deep learning technologies to provide advanced AR portrait video effects for the Agora Video SDK. It enables features such as:

  • Basic beauty: Skin beautification, whitening, and rosy effects.
  • Advanced beauty: Beauty effects for shape, face, and skin.
  • Number detection: Detect the number of faces, humans, or gestures.

This page shows you how to integrate and use the FaceUnity AR Filter extension in your app.

Understand the tech

To quickly integrate FaceUnity AR filter capabilities in your app, set extension properties using the key and value parameters in the Video SDK. Calling setExtensionPropertyWithVendor with a pair of key and value parameters is equivalent to calling the corresponding FaceUnity API.

Prerequisites

  • Xcode 12.0 or higher.
  • A physical device running iOS 9.0 or later.
  • Implemented the SDK quickstart.

Project setup

  1. Clone the FaceUnity sample project:

    git clone https://github.com/AgoraIO-Community/AgoraMarketPlace.git
  2. Follow the README.

  3. Download the FaceUnity iOS package and resource package.

  4. Create a Resource folder and place the required model and prop files there.

  5. Import the required .framework files and ensure they are set to Embed & Sign.

Integrate the extension

Enable the extension

[self.agoraKit enableExtensionWithVendor:@"FaceUnity"
                               extension:@"Effect"
                                 enabled:self.enable];

Initialize the extension

After onExtensionStarted, call setExtensionPropertyWithVendor to load certificates, AI models, and prop packages.

Configure beauty effects and body recognition

Call setExtensionPropertyWithVendor with the appropriate keys and values to configure the desired effects.

Release resources

When you stop using FaceUnity, call setExtensionPropertyWithVendor with the fuDestroyLibData key and then destroy the engine after the callback confirms success.

Reference