ofxFaceTracker2 on Raspberry Pi 3

I’m trying to get ofxFaceTracker2 to work with a Raspberry Pi 2 with Raspbian Lite. I’ve made some small steps trying to get it to work, but I keep failing. I believe my problem lies with dlib.
When I try to compile the example-pose project, I end up with the following type of errors (among some other ones):

/home/pi/openFrameworks/addons/obj/linuxarmv6l/Release/ofxFaceTracker2/src/ofxFaceTracker2.o: In function `dlib::get_serialized_frontal_faces[abi:cxx11]()':
ofxFaceTracker2.cpp:(.text._ZN4dlib28get_serialized_frontal_facesB5cxx11Ev[_ZN4dlib28get_serialized_frontal_facesB5cxx11Ev]+0x1c): undefined reference to `dlib::base64::base64()'

When I try to compile the same project, but I add ofxDlib, I get the following errors:

/home/pi/openFrameworks/addons/obj/linuxarmv6l/Release/ofxFaceTracker2/src/ofxFaceTracker2.o: In function `dlib::entropy_decoder_model_kernel_5<257ul, dlib::entropy_decoder_kernel_2, 200000ul, 4ul>::decode(unsigned long&)':
ofxFaceTracker2.cpp:(.text._ZN4dlib30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EE6decodeERm[_ZN4dlib30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EE6decodeERm]+0x1c4): undefined reference to `dlib::entropy_decoder_kernel_2::get_target(unsigned int)'
ofxFaceTracker2.cpp:(.text._ZN4dlib30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EE6decodeERm[_ZN4dlib30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EE6decodeERm]+0x250): undefined reference to `dlib::entropy_decoder_kernel_2::decode(unsigned int, unsigned int)'
ofxFaceTracker2.cpp:(.text._ZN4dlib30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EE6decodeERm[_ZN4dlib30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EE6decodeERm]+0x2fc): undefined reference to `dlib::entropy_decoder_kernel_2::decode(unsigned int, unsigned int)'
ofxFaceTracker2.cpp:(.text._ZN4dlib30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EE6decodeERm[_ZN4dlib30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EE6decodeERm]+0x374): undefined reference to `dlib::entropy_decoder_kernel_2::get_target(unsigned int)'
ofxFaceTracker2.cpp:(.text._ZN4dlib30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EE6decodeERm[_ZN4dlib30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EE6decodeERm]+0x390): undefined reference to `dlib::entropy_decoder_kernel_2::decode(unsigned int, unsigned int)'
/home/pi/openFrameworks/addons/obj/linuxarmv6l/Release/ofxFaceTracker2/src/ofxFaceTracker2.o: In function `dlib::matrix<dlib::matrix_op<dlib::op_trans<dlib::matrix<double, 3l, 0l, dlib::memory_manager_stateless_kernel_1<char>, dlib::row_major_layout> > >::type, dlib::matrix_op<dlib::op_trans<dlib::matrix<double, 3l, 0l, dlib::memory_manager_stateless_kernel_1<char>, dlib::row_major_layout> > >::NC, dlib::matrix_op<dlib::op_trans<dlib::matrix<double, 3l, 0l, dlib::memory_manager_stateless_kernel_1<char>, dlib::row_major_layout> > >::NR, dlib::matrix_op<dlib::op_trans<dlib::matrix<double, 3l, 0l, dlib::memory_manager_stateless_kernel_1<char>, dlib::row_major_layout> > >::mem_manager_type, dlib::row_major_layout> const dlib::pinv_helper<dlib::matrix_op<dlib::op_trans<dlib::matrix<double, 3l, 0l, dlib::memory_manager_stateless_kernel_1<char>, dlib::row_major_layout> > > >(dlib::matrix_exp<dlib::matrix_op<dlib::op_trans<dlib::matrix<double, 3l, 0l, dlib::memory_manager_stateless_kernel_1<char>, dlib::row_major_layout> > > > const&, double)':
ofxFaceTracker2.cpp:(.text._ZN4dlib11pinv_helperINS_9matrix_opINS_8op_transINS_6matrixIdLl3ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEEEEEKNS3_INT_4typeEXsrSA_2NCEXsrSA_2NRENSA_16mem_manager_typeES6_EERKNS_10matrix_expISA_EEd[_ZN4dlib11pinv_helperINS_9matrix_opINS_8op_transINS_6matrixIdLl3ELl0ENS_33memory_manager_stateless_kernel_1IcEENS_16row_major_layoutEEEEEEEEEKNS3_INT_4typeEXsrSA_2NCEXsrSA_2NRENSA_16mem_manager_typeES6_EERKNS_10matrix_expISA_EEd]+0x174): undefined reference to `dgesvd_'

Has anyone tried this (and if so, did you end up with a workable framerate?)

I’ve got it working using my branch and ofxDlib

First install ofxDlib

This will compile dlib.

Then install ofxFaceTracker2

There are ways to tune it for ARM/NEON as well. See my benchmarks near the bottom of this thread.

I was using the original ofFaceTracker2 repo before, but with yours I still get errors.
Just tried again with a clean SD card. When installing ofxDlib using sudo ./bootstrap.sh it installs a bunch of things, but ends with an error (see below):. Not sure if this could be part of the problem, with some files not setup properly.

Ignoring the script not completing I tried compiling the example-simple again, which got a fatal error: dlib/pixel.h: no such file. After installing dlib from apt (apt-get install libdlib-dev) I get one stap further, but this time the error is fatal error: dlib/dnn.h: No such file or directory.
Starting with a clean Raspbian image, do I need to install more than just ofxDlib’s ./bootstrap?

Maybe before I continue I should ask another question: did you get a usable framerate on the Rpi3? :wink:

Error from bootstrap.sh:

I: Running preinst scripts with 'install' argument.
dpkg-maintscript-helper: error: environment variable DPKG_MAINTSCRIPT_NAME is required
dpkg-maintscript-helper: error: couldn't identify the package
dpkg-maintscript-helper: error: environment variable DPKG_MAINTSCRIPT_NAME is required
dpkg-maintscript-helper: error: environment variable DPKG_MAINTSCRIPT_NAME is required
dpkg-maintscript-helper: error: environment variable DPKG_MAINTSCRIPT_NAME is required
dpkg-maintscript-helper: error: couldn't identify the package
No diversion 'diversion of /usr/sbin/update-icon-caches to /usr/sbin/update-icon-caches.gtk2 by libgtk-3-bin', none removed.
No diversion 'diversion of /usr/share/man/man8/update-icon-caches.8.gz to /usr/share/man/man8/update-icon-caches.gtk2.8.gz by libgtk-3-bin', none removed.
dpkg-maintscript-helper: error: couldn't identify the package
dpkg-maintscript-helper: error: environment variable DPKG_MAINTSCRIPT_NAME is required
Leaving 'diversion of /usr/share/initramfs-tools/hooks/klibc to /usr/share/initramfs-tools/hooks/klibc^i-t by klibc-utils'
dpkg-maintscript-helper: error: couldn't identify the package
Leaving 'diversion of /usr/bin/dh_gstscancodecs to /usr/bin/dh_gstscancodecs-gst0.10 by libgstreamer1.0-dev'
Leaving 'diversion of /usr/share/man/man1/dh_gstscancodecs.1.gz to /usr/share/man/man1/dh_gstscancodecs.1.gz-gst0.10 by libgstreamer1.0-dev'
dpkg-maintscript-helper: error: environment variable DPKG_MAINTSCRIPT_NAME is required
dpkg-maintscript-helper: error: environment variable DPKG_MAINTSCRIPT_NAME is required
dpkg-maintscript-helper: error: couldn't identify the package
Moving old data out of the way
dpkg-maintscript-helper: error: couldn't identify the package
Setting up raspbian-archive-keyring (20120528.2) ...
/var/lib/dpkg/info/raspbian-archive-keyring.postinst: 8: /var/lib/dpkg/info/raspbian-archive-keyring.postinst: apt-key: not found
dpkg: error processing package raspbian-archive-keyring (--configure):
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
 raspbian-archive-keyring
ERR: dpkg configure reported an error.
Native mode configuration reported an error!
I: Tidying up apt cache and list data.
I: Tidying up apt cache and list data.

Multistrap system reported 1 error in /home/pi/openFrameworks/scripts/apothecary/scripts/linuxarmv6l/raspbian/.

Trying to compile example-simple I get this:

/home/pi/openFrameworks/addons/obj/linuxarmv6l/Release/ofxFaceTracker2/src/ofxFaceTracker2.o: In function `dlib::entropy_decoder_model_kernel_5<257ul, dlib::entropy_decoder_kernel_2, 200000ul, 4ul>::decode(unsigned long&)':
ofxFaceTracker2.cpp:(.text._ZN4dlib30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EE6decodeERm[_ZN4dlib30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EE6decodeERm]+0x1c4): undefined reference to `dlib::entropy_decoder_kernel_2::get_target(unsigned int)'
ofxFaceTracker2.cpp:(.text._ZN4dlib30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EE6decodeERm[_ZN4dlib30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EE6decodeERm]+0x250): undefined reference to `dlib::entropy_decoder_kernel_2::decode(unsigned int, unsigned int)'
ofxFaceTracker2.cpp:(.text._ZN4dlib30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EE6decodeERm[_ZN4dlib30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EE6decodeERm]+0x2fc): undefined reference to `dlib::entropy_decoder_kernel_2::decode(unsigned int, unsigned int)'
ofxFaceTracker2.cpp:(.text._ZN4dlib30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EE6decodeERm[_ZN4dlib30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EE6decodeERm]+0x374): undefined reference to `dlib::entropy_decoder_kernel_2::get_target(unsigned int)'
ofxFaceTracker2.cpp:(.text._ZN4dlib30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EE6decodeERm[_ZN4dlib30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EE6decodeERm]+0x390): undefined reference to `dlib::entropy_decoder_kernel_2::decode(unsigned int, unsigned int)'
/home/pi/openFrameworks/addons/obj/linuxarmv6l/Release/ofxFaceTracker2/src/ofxFaceTracker2.o: In function `dlib::compress_stream_kernel_1<dlib::entropy_encoder_model_kernel_5<257ul, dlib::entropy_encoder_kernel_2, 200000ul, 4ul>, dlib::entropy_decoder_model_kernel_5<257ul, dlib::entropy_decoder_kernel_2, 200000ul, 4ul>, dlib::crc32>::decompress(std::istream&, std::ostream&) const':
ofxFaceTracker2.cpp:(.text._ZNK4dlib24compress_stream_kernel_1INS_30entropy_encoder_model_kernel_5ILm257ENS_24entropy_encoder_kernel_2ELm200000ELm4EEENS_30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EEENS_5crc32EE10decompressERSiRSo[_ZNK4dlib24compress_stream_kernel_1INS_30entropy_encoder_model_kernel_5ILm257ENS_24entropy_encoder_kernel_2ELm200000ELm4EEENS_30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EEENS_5crc32EE10decompressERSiRSo]+0x40): undefined reference to `dlib::entropy_decoder_kernel_2::entropy_decoder_kernel_2()'
ofxFaceTracker2.cpp:(.text._ZNK4dlib24compress_stream_kernel_1INS_30entropy_encoder_model_kernel_5ILm257ENS_24entropy_encoder_kernel_2ELm200000ELm4EEENS_30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EEENS_5crc32EE10decompressERSiRSo[_ZNK4dlib24compress_stream_kernel_1INS_30entropy_encoder_model_kernel_5ILm257ENS_24entropy_encoder_kernel_2ELm200000ELm4EEENS_30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EEENS_5crc32EE10decompressERSiRSo]+0x4c): undefined reference to `dlib::entropy_decoder_kernel_2::set_stream(std::istream&)'
ofxFaceTracker2.cpp:(.text._ZNK4dlib24compress_stream_kernel_1INS_30entropy_encoder_model_kernel_5ILm257ENS_24entropy_encoder_kernel_2ELm200000ELm4EEENS_30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EEENS_5crc32EE10decompressERSiRSo[_ZNK4dlib24compress_stream_kernel_1INS_30entropy_encoder_model_kernel_5ILm257ENS_24entropy_encoder_kernel_2ELm200000ELm4EEENS_30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EEENS_5crc32EE10decompressERSiRSo]+0x224): undefined reference to `dlib::entropy_decoder_kernel_2::~entropy_decoder_kernel_2()'
ofxFaceTracker2.cpp:(.text._ZNK4dlib24compress_stream_kernel_1INS_30entropy_encoder_model_kernel_5ILm257ENS_24entropy_encoder_kernel_2ELm200000ELm4EEENS_30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EEENS_5crc32EE10decompressERSiRSo[_ZNK4dlib24compress_stream_kernel_1INS_30entropy_encoder_model_kernel_5ILm257ENS_24entropy_encoder_kernel_2ELm200000ELm4EEENS_30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EEENS_5crc32EE10decompressERSiRSo]+0x294): undefined reference to `dlib::entropy_decoder_kernel_2::get_target(unsigned int)'
ofxFaceTracker2.cpp:(.text._ZNK4dlib24compress_stream_kernel_1INS_30entropy_encoder_model_kernel_5ILm257ENS_24entropy_encoder_kernel_2ELm200000ELm4EEENS_30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EEENS_5crc32EE10decompressERSiRSo[_ZNK4dlib24compress_stream_kernel_1INS_30entropy_encoder_model_kernel_5ILm257ENS_24entropy_encoder_kernel_2ELm200000ELm4EEENS_30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EEENS_5crc32EE10decompressERSiRSo]+0x358): undefined reference to `dlib::entropy_decoder_kernel_2::decode(unsigned int, unsigned int)'
ofxFaceTracker2.cpp:(.text._ZNK4dlib24compress_stream_kernel_1INS_30entropy_encoder_model_kernel_5ILm257ENS_24entropy_encoder_kernel_2ELm200000ELm4EEENS_30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EEENS_5crc32EE10decompressERSiRSo[_ZNK4dlib24compress_stream_kernel_1INS_30entropy_encoder_model_kernel_5ILm257ENS_24entropy_encoder_kernel_2ELm200000ELm4EEENS_30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EEENS_5crc32EE10decompressERSiRSo]+0x594): undefined reference to `dlib::entropy_decoder_kernel_2::decode(unsigned int, unsigned int)'
ofxFaceTracker2.cpp:(.text._ZNK4dlib24compress_stream_kernel_1INS_30entropy_encoder_model_kernel_5ILm257ENS_24entropy_encoder_kernel_2ELm200000ELm4EEENS_30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EEENS_5crc32EE10decompressERSiRSo[_ZNK4dlib24compress_stream_kernel_1INS_30entropy_encoder_model_kernel_5ILm257ENS_24entropy_encoder_kernel_2ELm200000ELm4EEENS_30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EEENS_5crc32EE10decompressERSiRSo]+0x63c): undefined reference to `dlib::entropy_decoder_kernel_2::get_target(unsigned int)'
ofxFaceTracker2.cpp:(.text._ZNK4dlib24compress_stream_kernel_1INS_30entropy_encoder_model_kernel_5ILm257ENS_24entropy_encoder_kernel_2ELm200000ELm4EEENS_30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EEENS_5crc32EE10decompressERSiRSo[_ZNK4dlib24compress_stream_kernel_1INS_30entropy_encoder_model_kernel_5ILm257ENS_24entropy_encoder_kernel_2ELm200000ELm4EEENS_30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EEENS_5crc32EE10decompressERSiRSo]+0x65c): undefined reference to `dlib::entropy_decoder_kernel_2::decode(unsigned int, unsigned int)'
ofxFaceTracker2.cpp:(.text._ZNK4dlib24compress_stream_kernel_1INS_30entropy_encoder_model_kernel_5ILm257ENS_24entropy_encoder_kernel_2ELm200000ELm4EEENS_30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EEENS_5crc32EE10decompressERSiRSo[_ZNK4dlib24compress_stream_kernel_1INS_30entropy_encoder_model_kernel_5ILm257ENS_24entropy_encoder_kernel_2ELm200000ELm4EEENS_30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EEENS_5crc32EE10decompressERSiRSo]+0x6a8): undefined reference to `dlib::entropy_decoder_kernel_2::get_target(unsigned int)'
ofxFaceTracker2.cpp:(.text._ZNK4dlib24compress_stream_kernel_1INS_30entropy_encoder_model_kernel_5ILm257ENS_24entropy_encoder_kernel_2ELm200000ELm4EEENS_30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EEENS_5crc32EE10decompressERSiRSo[_ZNK4dlib24compress_stream_kernel_1INS_30entropy_encoder_model_kernel_5ILm257ENS_24entropy_encoder_kernel_2ELm200000ELm4EEENS_30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EEENS_5crc32EE10decompressERSiRSo]+0x6c4): undefined reference to `dlib::entropy_decoder_kernel_2::decode(unsigned int, unsigned int)'
ofxFaceTracker2.cpp:(.text._ZNK4dlib24compress_stream_kernel_1INS_30entropy_encoder_model_kernel_5ILm257ENS_24entropy_encoder_kernel_2ELm200000ELm4EEENS_30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EEENS_5crc32EE10decompressERSiRSo[_ZNK4dlib24compress_stream_kernel_1INS_30entropy_encoder_model_kernel_5ILm257ENS_24entropy_encoder_kernel_2ELm200000ELm4EEENS_30entropy_decoder_model_kernel_5ILm257ENS_24entropy_decoder_kernel_2ELm200000ELm4EEENS_5crc32EE10decompressERSiRSo]+0x7f0): undefined reference to `dlib::entropy_decoder_kernel_2::~entropy_decoder_kernel_2()'
/home/pi/openFrameworks/addons/obj/linuxarmv6l/Release/ofxFaceTracker2/src/ofxFaceTracker2.o: In function `dlib::get_serialized_frontal_faces[abi:cxx11]()':
ofxFaceTracker2.cpp:(.text._ZN4dlib28get_serialized_frontal_facesB5cxx11Ev[_ZN4dlib28get_serialized_frontal_facesB5cxx11Ev]+0x18): undefined reference to `dlib::base64::base64()'
ofxFaceTracker2.cpp:(.text._ZN4dlib28get_serialized_frontal_facesB5cxx11Ev[_ZN4dlib28get_serialized_frontal_facesB5cxx11Ev]+0xac20): undefined reference to `dlib::base64::decode(std::istream&, std::ostream&) const'
ofxFaceTracker2.cpp:(.text._ZN4dlib28get_serialized_frontal_facesB5cxx11Ev[_ZN4dlib28get_serialized_frontal_facesB5cxx11Ev]+0xacc4): undefined reference to `dlib::base64::~base64()'
ofxFaceTracker2.cpp:(.text._ZN4dlib28get_serialized_frontal_facesB5cxx11Ev[_ZN4dlib28get_serialized_frontal_facesB5cxx11Ev]+0xacd8): undefined reference to `dlib::base64::~base64()'
collect2: error: ld returned 1 exit status