Install X11 Library Mac

NOTE I don't have a Mac to easily test and amend these instructions, but it has been tested through Travis Continuous Integration tool and a lot of people managed to get it working. If anyone wants to edit the wiki with better and more up to date Mac instructions please do!

  1. Xquartz X11
  2. Download X11 For Mac
  3. Install X11 Library Machine

Gretl: Gnu Regression, Econometrics and Time-series Library for Mac OS X on Intel (X11 version) Step 0: install X11, if need be (first time only) If you're running OS X 10.8 (Mountain Lion) or higher, and you don't already have X11 installed, you'll have to do this first. (X11 came installed by default on OS X up to 10.7.) You get X11 from.

Prerequisites

Xquartz X11

  • I recommend installing Homebrew as the easiest way to get a variety of Open Source libraries. Think of it as the Mac equivalent of apt-get. Homebrew usually installs things under /usr/local/Cellar and then creates links to the version you're using in /usr/local/bin, /usr/local/lib etc. This will be relevant later.

  • Install C++17 compiler, boost, TBB, dlib, OpenBLAS, and OpenCV, wget (for model download) with:

  • The landmark detection model is not included due to file size, you can download it using the bash download_models.sh script. For more details see - https://github.com/TadasBaltrusaitis/OpenFace/wiki/Model-acquisition

  • You'll want the Command Line Tools for Xcode. If you can't use these for any reason, you can build gcc using Homebrew -- in fact, it will happen automatically -- but it'll be much slower.

  • Get XQuartz (an X Window system for OS X). You don't actually need it to run OpenFace, but having the X libraries and include files on your system will make OpenFace (and various other things) much easier to build.

  • Optional, but you may find it useful to tell CMake how to find your X Windows libraries, since they may not be in the same place as expected on Linux. Add the following lines to CMakeLists.txt (e.g. after the similar section for OpenCV):

Building

After that, the build process is very similar to Linux (in OpenFace directory execute the following).

and you should have binaries in the bin directory. e.g. you can run:

OpenBLAS performance

OpenFace uses OpenBLAS to accelerate numerical computations and TBB for parallelization, in some cases the threading of OpenBLAS and TBB clash. This can lead to the following error:OpenBLAS : Program will terminate because you tried to start too many threads.

Terminal

To fix it and to potentially improve OpenFace performance:

Download X11 For Mac

Mac

You can add the below environmental variables (run in the shell just before running any of the OpenFace executables):

You can reinstall OpenBLAS with openmp:

Install X11 Library Machine

Also see this thread: https://github.com/TadasBaltrusaitis/OpenFace/issues/748