Integrating visage|SDK into Unity project

visage|SDK allows easy integration with Unity 3D game engine using VisageTrackerUnityPlugin. VisageTrackerUnityPlugin is a wrapper that exposes VisageTracker's, VisageFaceAnalyser's and VisageFaceRecognition's functionalities for use in managed programming languages such as C# and Java.
In order to use visage|SDK in your own Unity project, libraries and selected data files need to be included. Unity sample application (VisageTrackerUnityDemo) is provided in visage|SDK as ready-to-build project with all necessary dependencies and can be used as a reference.

Following steps are required to integrate visage|SDK in your own project:

Running the application in Unity Editor

While developing an Android application, it can be useful to run and test the application in Unity Editor instead of having to build and push the app to Android device.

Since visage|SDK for Android only provides libraries that are intended to run on Android device, running the application in Unity Editor on your Windows or Mac development machine will require downloading visage|SDK for that platform from the Visage Technologies Download Center.

Running the application in Unity Editor on Windows

After installing visage|SDK for Windows, simply navigate to visageSDK/Samples/Unity/VisageTrackerUnityDemo/Assets/Plugins and copy Windows folder to your Unity project, specifically, to Plugins folder which should now include Android and Windows folders.
When building the app for your Android device, platform in Build Settings should be set to Android and when running in Unity Editor it should be set to the platform of your development machine.

Running the application in Unity Editor on Mac

After installing visage|SDK for Mac, simply navigate to visageSDK-macOS/lib and copy VisageTrackerUnityPlugin.bundle folder to your Unity project, specifically, to newly created Plugins/macOS folder which should now include Android and macOS folders.
When building the app for your Android device, platform in Build Settings should be set to Android and when running in Unity Editor it should be set to the platform of your development machine.


It is important to note that VisageTrackerUnityPlugin API is not completely identical on different platform. A different approach is used for opening camera and fetching and displaying camera frames in the application. That is why it is recommended to go through documentation of VisageTrackerUnityPlugin on both platforms and AndroidCameraPlugin or simply use VisageTrackerUnityDemo as a basis for your own project. Specifically, all the differences between platforms that were mentioned are demonstrated in script Tracker.cs.