SDK Developer Guide Release 3.4.1

Using the SDK

The purpose of the SDK is to detect facial expressions and their underlying emotions, appearance and emojis from facial images. The SDK is distributed as a Installer. Its included assemblies enable integration with .NET and C++ Windows applications and the data folder required by API in runtime:

  • affdex-native: C++ Namespace headers and library files (the Release and Debug versions).
  • Affdex: .NET Namespace assembly (the Release and Debug versions).
  • data: The classifier data files required by both affdex-native and Affdex libraries runtime.

Watch the video tutorial below to help you get started on how to use the SDK:


Getting started

1. Download and run the SDK installer

Click on the download link from the table for the desired architecture:

Architecture
Version
Size
 
i386 3.4.1-1320 (release notes) 18.6 MB Download
x86_64 3.4.1-575 (release notes) 29.4 MB Download
2. Import an affdex API into your application

    For a C++ Application: Configure your project to use the affdex-native library.

    For a .NET Application: Add the Affdex assembly to your project.

    The .NET assembly depends on the affdex-native.dll and loads it in runtime.

    A dynamic library, opencv_ffmpeg.dll is required by VideoDetector [c++], [c#] in runtime for the video decoding. Also, the SDK uses access to the internet when available to communicate anonymized usage data.

3. Capture and analyze faces

Facial images can be captured from different sources. For each of the different sources, the SDK defines a detector class that can handle processing images acquired from that source:

4. Check out sample applications on GitHub

Sample applications for processing videos, and connecting to the camera are available for cloning on our GitHub repository.

5. Check out AffdexMe

AffdexMe is an open source application that demonstrates the use of the Affdex SDK. It uses the camera connected to your device to view, process and analyze live video of your face. Start the app and you will see your own face on the screen, and metrics describing your facial expression of emotion.

Class documentation

  • .NET (C#) Namespace: [HTML]
  • C++ Namespace: [HTML]

Requirements & Dependencies

  • Processor, 2 GHz
  • RAM, 1 GB
  • Disk Space (min) : 950 MB
Tracking multiple faces

As of v3.1, the SDK exposes a parameter max_faces in the detectors constructor to specify the maximum number of faces to look for in an image. For the realtime use cases, to achieve a high accuracy and processing throughput (20+ processed frames per second), the SDK requires a CPU thread per face.

On a recent dual core machine, we can track up to 3 people in parallel with all the facial expressions, emotions and appearance metrics enabled.

If the number of faces tracked is greater than the number of available CPU threads on the machine, they will all be tracked, but at a cost of the processing frame rate. Therefore, make sure to plan for providing enough hardware power for the number of faces they are expecting to track with each camera.

Runtime Requirements

The software runtime requirements are installed automatically by the SDK installer.

Supported operating systems
  • Windows 7 and above