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)
- 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
- 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.
- 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…
- 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.
- 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)
Jpeg files need to be renamed to jpg
Will read mov, mkv and avi (maybe mp4?)
Take the .exe off the executable
Today Kristen Mapes and I presented at the Chicago Colloquium on DH and Computer Science about some of our work we’ve done to support undergraduates learning about distant viewing techniques. Our work builds upon the classroom work that we have been doing with collaborators such as David Bering-Porter and Cody Mejeur to think about how distant viewing techniques may provide additional options for looking at visual content in DH and Cultural Studies work.
As part of the presentation, we discussed some of the simple shell scripts we’ve written to support our work and make it easier/less time intensive to do some of the tasks. For those who may be interested doing similar work we have provided several scripts on our GitLab instance. We have also made the slides from the presentation available.
Abstract for the talk is below:
We are interested in sharing approaches and examples of teaching computational image analysis to a non-computer science student population in a humanities context. Digital humanities curricula usually include methodological introductions to such topics as text mining and analysis, mapping, network analysis, metadata, preservation, and archival curation. Since 2015, we have incorporated large scale image analysis into introductory digital humanities courses at the undergraduate level.
Incorporating image analysis into the suite of digital humanities methods adds to the possibilities of DH: it makes digitized collections and born digital image and video content available for analysis at scale beyond those currently available for study with text analysis methods. By expanding this potential corpus of material available for study, we also open up digital humanities to more topics that resonate with our students. Teaching digital humanities to undergraduates is a process of eliciting excitement about an expanded methodological toolkit, and including large scale image analysis is a striking way to get students engaged in thinking about corpora, metadata, method, and presentation.
In the Introduction to DH class at the undergraduate level, we have demonstrated the use of ImagePlot (http://lab.softwarestudies.com/p/imageplot.html) and have given students the opportunity to use the software as well. This approach has led several students to pursue a final project using this method (for example: http://smentow2.msu.domains/puremichigan/). This presentation will share how we have used a corpus of Harlem Renaissance art images to tie the software instruction into the content of the course and how we are now extending computational image analysis instruction beyond ImagePlot to incorporate Distant Viewing (https://www.distantviewing.org/) tools into the classroom in early Fall 2018. This extension of image analysis instruction to algorithmic face detection and classification opens up new possibilities for analyzing material in the classroom and engaging in critical conversations about how such programs work in the corpora we create as well as those used in the corporate world.