2016-04-08 14:12:02 +00:00
#Sample Apps for Affdex SDK for Windows and Linux
2015-03-09 21:24:59 +00:00
2017-02-04 03:47:24 +00:00
Welcome to our repository on GitHub! Here you will find example code to get you started with our Affdex Linux SDK 3.2, Affdex Windows SDK 3.4 and begin emotion-enabling you own app! Documentation for the SDKs is available on the < a href = http://developer.affectiva.com/ > Affectiva's Developer Portal< / a > .
2015-03-09 21:24:59 +00:00
2016-06-06 03:52:17 +00:00
*Build Status*
- Windows: [![Build status ](https://ci.appveyor.com/api/projects/status/pn2y9h8a3nnkiw41?svg=true )]
2016-02-03 12:20:08 +00:00
(https://ci.appveyor.com/project/ahamino/win-sdk-samples)
2016-06-06 03:52:17 +00:00
- Ubuntu: [![Build Status ](https://travis-ci.org/Affectiva/cpp-sdk-samples.svg?branch=master )](https://travis-ci.org/Affectiva/cpp-sdk-samples)
2015-03-09 21:24:59 +00:00
2016-02-03 12:20:08 +00:00
Dependencies
------------
2015-03-09 21:24:59 +00:00
2016-03-18 18:28:55 +00:00
*Windows*
2017-02-04 03:47:24 +00:00
- Affdex SDK 3.4 (64 bit)
2015-03-09 21:24:59 +00:00
- Visual Studio 2013 or higher
2016-03-18 18:28:55 +00:00
*Linux*
2016-07-25 18:42:21 +00:00
- Ubuntu 14.04 or CentOS 7
2017-02-04 03:47:24 +00:00
- Affdex SDK 3.2
2016-03-18 18:28:55 +00:00
- CMake 2.8 or higher
2016-07-25 18:42:21 +00:00
- GCC 4.8
2015-03-09 21:24:59 +00:00
2016-03-18 18:28:55 +00:00
*Additional dependencies*
2016-02-03 12:20:08 +00:00
2016-07-25 18:42:21 +00:00
- OpenCV 2.4
2017-07-07 14:34:17 +00:00
- Boost 1.55
2017-02-04 03:47:24 +00:00
- libuuid
- libcurl
- libopenssl
2016-02-03 12:20:08 +00:00
Installation
------------
2016-03-18 18:28:55 +00:00
*Windows*
2017-06-07 13:21:28 +00:00
- Download Affdex SDK [from here ](https://knowledge.affectiva.com/docs/getting-started-with-the-emotion-sdk-for-windows )
2015-04-21 22:12:54 +00:00
- Install the SDK using MSI installer.
2016-02-03 12:20:08 +00:00
- The additional dependencies get installed automatically by NuGet.
2016-03-18 18:28:55 +00:00
*Ubuntu*
2017-06-07 13:21:28 +00:00
- Download Affdex SDK [from here ](https://knowledge.affectiva.com/docs/getting-started-with-the-affectiva-sdk-for-linux )
2016-03-18 18:28:55 +00:00
```bashrc
2017-04-24 17:40:53 +00:00
sudo apt-get install build-essential libopencv-dev libboost1.55-all-dev libcurl4-openssl uuid-dev cmake
2017-02-04 03:47:24 +00:00
wget https://download.affectiva.com/linux/affdex-cpp-sdk-3.2-20-ubuntu-xenial-xerus-64bit.tar.gz
2016-03-25 17:52:08 +00:00
mkdir $HOME/affdex-sdk
2017-02-04 03:47:24 +00:00
tar -xzvf affdex-cpp-sdk-3.2-20-ubuntu-xenial-xerus-64bit.tar.gz -C $HOME/affdex-sdk
2016-03-25 17:52:08 +00:00
export AFFDEX_DATA_DIR=$HOME/affdex-sdk/data
git clone https://github.com/Affectiva/cpp-sdk-samples.git $HOME/sdk-samples
mkdir $HOME/build
cd $HOME/build
cmake -DOpenCV_DIR=/usr/ -DBOOST_ROOT=/usr/ -DAFFDEX_DIR=$HOME/affdex-sdk $HOME/sdk-samples
2016-03-18 18:28:55 +00:00
make
2016-03-25 17:52:08 +00:00
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/affdex-sdk/lib
2016-03-18 18:28:55 +00:00
```
2017-02-04 03:47:24 +00:00
*CentOS*
2017-06-07 13:52:02 +00:00
- Download Affdex SDK [from here ](https://knowledge.affectiva.com/docs/getting-started-with-the-affectiva-sdk-for-linux )
2017-02-04 03:47:24 +00:00
```bashrc
sudo yum install libcurl-devel.x86_64 libuuid-devel.x86_64 opencv-devel cmake.x86_64
wget https://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.gz/download -O boost_1_55_0.tar.gz
tar -xzvf boost_1_55_0.tar.gz -C $HOME
cd boost_1_55
./bootstrap.sh --with-libraries=log,serialization,system,date_time,filesystem,regex,timer,chrono,thread,program_options
sudo ./b2 link=static install
wget https://download.affectiva.com/linux/affdex-cpp-sdk-3.2-2893-centos-7-64bit.tar.gz
mkdir $HOME/affdex-sdk
tar -xzvf affdex-cpp-sdk-3.2-2893-centos-7-64bit.tar.gz -C $HOME/affdex-sdk
export AFFDEX_DATA_DIR=$HOME/affdex-sdk/data
git clone https://github.com/Affectiva/cpp-sdk-samples.git $HOME/sdk-samples
mkdir $HOME/build
cd $HOME/build
cmake -DOpenCV_DIR=/usr/ -DBOOST_ROOT=/usr/ -DAFFDEX_DIR=$HOME/affdex-sdk $HOME/sdk-samples
make
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/affdex-sdk/lib
```
2016-02-03 12:20:08 +00:00
2016-02-03 12:22:00 +00:00
OpenCV-webcam-demo (c++)
2016-02-03 12:20:08 +00:00
------------------
2017-07-07 14:34:17 +00:00
Project for demoing the [FrameDetector class ](https://knowledge.affectiva.com/docs/analyze-a-video-frame-stream-3 ). It grabs frames from the camera, analyzes them and displays the results on screen.
2016-02-03 12:20:08 +00:00
The following command line arguments can be used to run it:
-h [ --help ] Display this help message.
-d [ --data ] arg (=data) Path to the data folder
-r [ --resolution ] arg (=640 480) Resolution in pixels (2-values): width
height
--pfps arg (=30) Processing framerate.
--cfps arg (=30) Camera capture framerate.
--bufferLen arg (=30) process buffer size.
--cid arg (=0) Camera ID.
--faceMode arg (=0) Face detector mode (large faces vs small
faces).
--numFaces arg (=1) Number of faces to be tracked.
--draw arg (=1) Draw metrics on screen.
Video-demo (c++)
----------
2017-07-07 14:34:17 +00:00
Project for demoing the Windows SDK [VideoDetector class ](https://knowledge.affectiva.com/docs/analyze-a-recorded-video-file ) and [PhotoDetector class ](https://knowledge.affectiva.com/docs/analyze-a-photo-4 ). It processs video or image files, displays the emotion metrics and exports the results in a csv file.
2015-04-21 22:12:54 +00:00
2016-02-03 12:20:08 +00:00
The following command line arguments can be used to run it:
2015-04-21 22:12:54 +00:00
2016-02-03 12:20:08 +00:00
-h [ --help ] Display this help message.
-d [ --data ] arg (=data) Path to the data folder
2016-06-06 03:31:56 +00:00
-i [ --input ] arg Video or photo file to process.
2016-02-03 12:20:08 +00:00
--pfps arg (=30) Processing framerate.
--draw arg (=1) Draw video on screen.
--faceMode arg (=1) Face detector mode (large faces vs small
faces).
--numFaces arg (=1) Number of faces to be tracked.
--loop arg (=0) Loop over the video being processed.
2015-04-21 22:12:54 +00:00
2016-02-03 12:20:08 +00:00
For an example of how to use Affdex in a C# application .. please refer to [AffdexMe ](https://github.com/affectiva/affdexme-win )