Go to file
Ruben van de Ven 964101d000 Update module ref 2020-01-29 12:04:15 +01:00
sdk-samples@1be1031eb2 Update module ref 2020-01-29 12:04:15 +01:00
www Final design toches 2019-02-08 22:35:15 +01:00
.gitignore Use upload key 2019-02-08 17:31:46 +01:00
.gitmodules Update module ref 2020-01-29 12:02:50 +01:00
README.md Speed up image compositing by resizing 2019-02-08 19:22:20 +01:00
echoserver.py Speed up image compositing by resizing 2019-02-08 19:22:20 +01:00
portrait_compositor.py send as jpeg to save data 2019-02-08 21:18:49 +01:00
requirements.txt Use upload key 2019-02-08 17:31:46 +01:00
supervisord.conf Rudimentary face compositing 2019-02-03 17:43:32 +01:00

README.md

Specimens of Discriminatory Composite Portraiture - Gender Differentiation

hostname: specimensofgender

Uses a modified version of Affectivas cpp-sdk-samples.

Install

Install dependencies:

sudo apt libopencv-dev install libboost-system-dev libboost-filesystem-dev libboost-date-time-dev libboost-regex-dev libboost-thread-dev libboost-timer-dev libboost-chrono-dev libboost-serialization-dev libboost-log-dev libboost-program-options-dev
sudo apt install cmake build-essential git gzip

#rpi is ARM:
wget http://download.affectiva.com/linux/arm/affdex-cpp-sdk-3.1-40-linux-arm7.tar.gz
mkdir affdex-sdk
tar -xzvf affdex-cpp-sdk-*.tar.gz -C affdex-sdk
rm affdex-cpp-sdk-*.tar.gz

Build:

mkdir build && cd build
cmake -DOpenCV_DIR=/usr/ -DBOOST_ROOT=/usr/ -DAFFDEX_DIR=~/gender_detection/affdex-sdk ~/gender_detection/sdk-samples
make

To avoid ruining the SD-card too soon, mount /tmp as tmpfs. This folder will also be used to store camera frames for analysis. So to /etc/fstab add:

# tmpfs for /tmp, so we save the sd-card a bit
tmpfs           /tmp            tmpfs   defaults,noatime,nosuid   0       0
tmpfs           /var/log        tmpfs   defaults,noatime,mode=1777,size=64m 0      0

sudo ln -s supervisord.conf /etc/supervisor/conf.d/specimens.conf

Install fonts:  cp fonts/*/*.ttf ~/.fonts/

Test

Some quirks in either Rasbian or the video demo require two variables to be set before running. Not doing so results in a segfault.

export LC_ALL=$LANG
export LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libopencv_core.so.2.4
~/gender_detection/build/video-demo/video-demo --input ~/gender_detection/image_test.jpg --data ~/gender_detection/affdex-sdk/data --draw=0 --numFaces=20