Installing OpenFace on Macintosh

This is a bare bones guide to installing OpenFace on Macintosh that I wrote during the Towards New Horizons in Digital Humanities workshop hosted by the Passau Center for eHumanities in March 2019.


Go to https://github.com/TadasBaltrusaitis/OpenFace

Download the source code as a zip (it’s 750MB so will take a long time)

Meanwhile…. (Go to https://github.com/TadasBaltrusaitis/OpenFace/wiki)

  1. Install HomeBrew
    You’ll want to install Homebrew to get the open source libraries.
    Open a new Terminal Window (Shell → New Window) and copy and paste the command below:/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”This will take a pretty long time. You will want to check in on terminal every once in a while because you’ll need to enter your password.While this is happening
  2. Install XQuartz
    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.
    Note: When xquartz tells you to log out and back in you can ignore it for now.
  3. Once HomeBrew is installed
    you can Install boost, TBB, dlib, OpenBLAS, OpenCV and Wget with:
    brew install tbb
    brew install openblas
    brew install dlib
    brew install opencv3
    brew install boost
    brew install wget
    Note: While you can run the install for all of these at once, you might want to run these one at at time so you can more easily read any errors that appear.

    While this is happening…

  4. Get ready to Install the landmark detection model
    The landmark detection model is not included due to file size, you can download it using the bash download_models.sh script included in the master files. ( For more details see – https://github.com/TadasBaltrusaitis/OpenFace/wiki/Model-acquisition)
    Move your Zip file of your OpenFace master files into a folder where you are going to want to work with it regularly and unzip it.
    By using normal drag and drop, move the file download_models.sh (in the OpenFace master file folder) into the “build/bin/model/patch_experts” folder.
    Now navigate within terminal to the build/bin/model/patch_experts folder and then run the command “sh download_models.sh”
    This should trigger the download of the landmark detection models.
  5. Install CMake

    Go to https://cmake.org/download/ and download the MACOS version then install. This is a regular install of software where you’ll need to drag/drop into the applications folder.

    Once you have done that go back to the command line and enter the following command (which will ask for your password)

    sudo “/Applications/CMake.app/Contents/bin/cmake-gui” –install

    Also open the file CMakeLists.txt and on line 30 you’ll see that it references version 3.3, you need to update that line to your version of OpenCV (4.0.1 as of March 2019)

 

Notes:

Jpeg files need to be renamed to jpg
Will read mov, mkv and avi (maybe mp4?)
Take the .exe off the executable