# FaceUnity AR Filter (/en/realtime-media/marketplace/build/add-video-and-ar-effects/faceunity/flutter)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

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 [#understand-the-tech-2]

    In a Flutter project, you integrate the native Android and iOS plug-ins through Gradle and CocoaPods respectively.

    ## Prerequisites [#prerequisites-2]

    * [Flutter](https://docs.flutter.dev/get-started/install) 2.0.0 or higher.
    * Dart 2.15.1 or higher.
    * Implemented the [SDK quickstart](../../../video/quickstart.mdx).

    ## Project setup [#project-setup-2]

    1. Integrate the Android plugin through Gradle by adding the downloaded `.aar` files to `android/libs` and configuring `build.gradle`.

    2. Integrate the iOS plugin through CocoaPods by importing the `.framework` files and updating the podspec and Podfile.

    3. Convert the `authpack` certificate to Dart and save it in the Flutter `lib` folder.

    4. Save the required model and `.bundle` files from the resource package to the project folder.

       ![FaceUnity Flutter resources](https://assets-docs.agora.io/images/extensions-marketplace/faceunity-fluter-resources.png)

    5. Add the necessary Flutter dependencies and assets to `pubspec.yaml`.

    ## Integrate the extension [#integrate-the-extension-2]

    ### Enable the extension [#enable-the-extension-2]

    ```dart
    if (Platform.isAndroid) {
      await agoraEngine.loadExtensionProvider(path: 'AgoraFaceUnityExtension');
    }

    await agoraEngine.enableExtension(
      provider: "FaceUnity",
      extension: "Effect",
      enable: true,
    );
    ```

    ### Handle extension callbacks [#handle-extension-callbacks]

    Register `onExtensionStarted`, `onExtensionError`, and `onExtensionEvent` in `RtcEngineEventHandler`.

    ### Initialize the extension [#initialize-the-extension-2]

    Call `setExtensionProperty` to set `fuSetup` and `fuLoadAIModelFromPackage`.

    ### Apply AR effects [#apply-ar-effects]

    Call `setExtensionProperty` to load props and apply effects such as the cat ears demo effect.

    ### Release resources [#release-resources-2]

    Call `setExtensionProperty` with `fuDestroyLibData` when you dispose of the engine.

    ## Reference [#reference-2]

    * [Flutter FaceUnity sample project](https://github.com/AgoraIO-Community/AgoraMarketplace/tree/master/FaceUnity/flutter)
    * [enableExtension](https://api-ref.agora.io/en/video-sdk/flutter/6.x/API/class_irtcengine.html#api_irtcengine_enableextension)
    * [loadExtensionProvider](https://api-ref.agora.io/en/video-sdk/flutter/6.x/API/class_irtcengine.html#api_irtcengine_loadextensionprovider)
    * [setExtensionProperty](https://api-ref.agora.io/en/video-sdk/flutter/6.x/API/class_irtcengine.html#api_irtcengine_setextensionproperty)

    
  
