Dependency Installation - thuiar/MMSA-FET GitHub Wiki

1. Linux Installation

For OpenFace binaries to work on Linux platform, a few dependencies needs to be installed system-wide. You'll probably need admin priviledge for this.

1.1 OpenBLAS

$ sudo apt-get install libopenblas-dev

1.2 OpenCV 4.1.0

  • Install opencv dependencies

    $ sudo apt-get install git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
    $ sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev
    
  • Download OpenCV 4.1.0 from https://github.com/opencv/opencv/archive/4.1.0.zip

    $ wget https://github.com/opencv/opencv/archive/4.1.0.zip
    
  • Unzip and create build folder

    $ unzip 4.1.0.zip
    $ cd opencv-4.1.0
    $ mkdir build
    $ cd build
    
  • Build opencv

    $ sudo cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_TIFF=ON -D WITH_TBB=ON ..
    $ sudo make -j4
    $ sudo make install
    

1.3 Dlib 19.13

  • Download and compile dlib

    $ wget http://dlib.net/files/dlib-19.13.tar.bz2
    $ tar xf dlib-19.13.tar.bz2
    $ cd dlib-19.13
    $ mkdir build
    $ cd build
    $ cmake ..
    $ cmake --build . --config Release
    $ sudo make install
    $ sudo ldconfig
    

1.4 Boost

$ sudo apt install libboost-all-dev

1.5 FFmpeg

In case you don't have ffmpeg installed, run sudo apt install ffmpeg on Ubuntu or equivalent commands on other Linux distributions. Refer to FFmpeg Official Website for more information.

2. Windows Installation

2.1 FFmpeg

Download FFmpeg windows executables from FFmpeg Official Website. Add the path of .exe files to PATH environment.

3. Post Installation Script

Normally the python -m MSA_FET install command will handle large file downloads properly. However, if you have trouble accessing Google Drive, you have to download the files from BaiduYunDisk, and place the ext folder under MMSA-FET installation directory, which should be something like ~/anaconda3/envs/ENV_NAME/lib/pythonX.Y/site-packages/MSA_FET if you're using anaconda.

The post installation script basically does 3 things:

  1. Download OpenFace models.
  2. On Windows, download OpenFace executables and dependencies. On Linux, Download OpenFace executable file and set permission.
  3. Download Other trained models. e.g. TalkNet models.

4. Python Dependencies

Normally the pip install command will handle the python dependency packages. The required packages are listed below for clarity:

  • python >= 3.8
  • torch >= 1.9.1
  • mediapipe >= 0.8.8.1
  • opencv-contrib-python >= 4.5.4.58
  • transformers >= 4.4.0
  • opensmile >= 2.2.0
  • librosa >= 0.8.1
  • ffmpeg-python >= 0.2.0
  • numpy >= 1.20.3
  • pandas >= 1.2.5
  • tqdm >= 4.62.2
  • gdown >= 4.4.0
  • scenedetect >= 0.5.6.1
  • scipy >= 1.7.3
  • python_speech_features >= 0.6