Skip to content

Commit

Permalink
Updating OpenFace to version 2.2.0 (#741)
Browse files Browse the repository at this point in the history
Change log:

Moving to C++17. This means that the code can only be build using C++17 compilers (e.g. g++ >8 and Visual Studio 2017, clang > 5), fixing related bugs - (#698, #629, #641)
Removing an explicit dependency on boost (all the filesystem operations are performed using std::filesystem or boost::filesysteme). If boost is available it will used boost:filesystem, otherwise std::filesystem (this requires C++17)
Visual Studio 2017 is now the main version for Visual Studio builds, VS 2015 is no longer supported
Updating OpenCV to 4.1 version (#511)
Fixing a bug with output images when using GUI (#694)
Updating RAWImage - #609, so it can be initialized from System.Drawing.Bitmap directly
Fixing overlap detection for multi face tracking (#693)
  • Loading branch information
TadasBaltrusaitis authored Jul 13, 2019
1 parent f023667 commit e4a57e1
Show file tree
Hide file tree
Showing 2,838 changed files with 65,057 additions and 380,364 deletions.
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.git
docker-compose.yml
build
matlab_runners
matlab_version
python_scripts
test-dump
samples
model_training
gui
gui
6 changes: 6 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## This is read by docker-compose. You can overwrite these at runtime, e.g.:
## DOCKERUSER=bobfoo docker-compose build

DOCKERUSER=openface
DOCKERTAG=latest
DATA_MOUNT=/tmp/openface
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
lib/local/LandmarkDetector/model/patch_experts/cen_patches_*.dat

matlab_version/experiments_menpo/out_semifrontal/
/x64/Release/
/x64/Debug/
Expand Down Expand Up @@ -100,3 +102,6 @@ lib/local/Utilities/Debug/
lib/3rdParty/CameraEnumerator/Debug/
lib/local/CppInerop/Debug/
*.user

# IDE-generated folders
.idea
30 changes: 18 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
language: cpp

dist: trusty
dist: xenial
sudo: required

branches:
only:
- master
- develop
- feature/opencv4
compiler:
- gcc

Expand All @@ -16,14 +17,17 @@ os:

before_install:

# OpenCV dependencies, dlib and boost
# G++ 8 compiler, OpenCV dependencies, dlib, openblas, and tbb
- if [ ${TRAVIS_OS_NAME} = linux ]; then
sudo apt-get update;
sudo apt-get install libopenblas-dev;
cd ../;
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test;
sudo apt-get update -qq;
sudo apt-get install -qq g++-8;
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 90;
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;
sudo apt-get install cmake;
sudo apt-get install libboost-all-dev;
sudo apt-get install libopenblas-dev;
wget http://dlib.net/files/dlib-19.13.tar.bz2;
tar xf dlib-19.13.tar.bz2;
cd dlib-19.13;
Expand All @@ -34,14 +38,14 @@ before_install:
sudo make install;
sudo ldconfig;
cd ../..;
wget https:/opencv/opencv/archive/3.4.0.zip;
unzip -qq 3.4.0.zip;
cd opencv-3.4.0;
wget https:/opencv/opencv/archive/4.0.0.zip;
unzip -qq 4.0.0.zip;
cd opencv-4.0.0;
mkdir build;
cd build;
fi

# g++4.8.1
# g++ TODO these should not be separated?
- if [ "$CXX" = "g++" ]; then
if [ ${TRAVIS_OS_NAME} = linux ]; then
$CXX --version;
Expand All @@ -52,7 +56,7 @@ before_install:
fi
fi

# clang 3.4
# clang
- if [ "$CXX" = "clang++" ]; then
if [ ${TRAVIS_OS_NAME} = linux ]; then
$CXX --version;
Expand All @@ -68,16 +72,18 @@ before_install:
brew install tbb;
brew install openblas;
brew install dlib;
brew install opencv3;
brew install opencv;
cd ../;
fi

script:
- cd OpenFace
- $CXX --version
- chmod 777 ./download_models.sh
- ./download_models.sh
- mkdir build
- cd build
- cmake -D CMAKE_BUILD_TYPE=RELEASE CMAKE_CXX_FLAGS="-std=c++11" -D CMAKE_EXE_LINKER_FLAGS="-std=c++11" ..
- cmake -D CMAKE_BUILD_TYPE=RELEASE ..
- make
- ../build/bin/FeatureExtraction -f "../samples/2015-10-15-15-14.avi" -q -mloc model/main_clm_general.txt
- ../build/bin/FaceLandmarkImg -fdir ../samples -out_dir data -multi_view 1 -wild -q
Expand Down
19 changes: 10 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
cmake_minimum_required (VERSION 3.2)
cmake_minimum_required (VERSION 3.8)
set(CMAKE_CXX_STANDARD 17)

project(OpenFace VERSION 2.0.2)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/)
Expand Down Expand Up @@ -27,7 +29,7 @@ else()
MESSAGE(" OpenBLAS_INCLUDE: ${OpenBLAS_INCLUDE_DIR}")
endif()

find_package( OpenCV 3.3 REQUIRED COMPONENTS core imgproc calib3d highgui objdetect)
find_package( OpenCV 4.0 REQUIRED COMPONENTS core imgproc calib3d highgui objdetect)
if(${OpenCV_FOUND})
MESSAGE("OpenCV information:")
MESSAGE(" OpenCV_INCLUDE_DIRS: ${OpenCV_INCLUDE_DIRS}")
Expand All @@ -37,17 +39,18 @@ else()
MESSAGE(FATAL_ERROR "OpenCV not found in the system.")
endif()

find_package( Boost 1.5.9 REQUIRED COMPONENTS filesystem system)
find_package( Boost 1.5.9 COMPONENTS filesystem system)
if(${Boost_FOUND})
MESSAGE("Boost information:")
MESSAGE(" Boost_VERSION: ${Boost_VERSION}")
MESSAGE(" Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}")
MESSAGE(" Boost_LIBRARIES: ${Boost_LIBRARIES}")
MESSAGE(" Boost_LIBRARY_DIRS: ${Boost_LIBRARY_DIRS}")
else()
MESSAGE(FATAL_ERROR "Boost not found in the system.")
MESSAGE("Boost not found in the system.")
endif()


# Move LandmarkDetector model
file(GLOB files "lib/local/LandmarkDetector/model/*.txt")
foreach(file ${files})
Expand Down Expand Up @@ -134,13 +137,11 @@ endforeach()

if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
if (GCC_VERSION VERSION_LESS 4.7)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -msse -msse2 -msse3")
if (GCC_VERSION VERSION_LESS 8.0)
MESSAGE(FATAL_ERROR "Need a 8.0 or newer GCC compiler. Current GCC: ${GCC_VERSION}")
else ()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -msse -msse2 -msse3")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse -msse2 -msse3")
endif ()
else ()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -msse -msse2 -msse3")
endif ()

# dlib
Expand Down
63 changes: 0 additions & 63 deletions Dockerfile

This file was deleted.

7 changes: 5 additions & 2 deletions OpenFace.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 17
VisualStudioVersion = 15.8.2
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LandmarkDetector", "lib\local\LandmarkDetector\LandmarkDetector.vcxproj", "{BDC1D107-DE17-4705-8E7B-CDDE8BFB2BF8}"
EndProject
Expand Down Expand Up @@ -179,4 +179,7 @@ Global
{78196985-EE54-411F-822B-5A23EDF80642} = {652CCE53-4997-4B43-9A99-28D075199C99}
{50B7D4BF-E33B-41D0-AA89-76BBA57BF5CC} = {652CCE53-4997-4B43-9A99-28D075199C99}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {228609CD-6688-47E7-8D5B-5EE684F8A7A1}
EndGlobalSection
EndGlobal
Loading

0 comments on commit e4a57e1

Please sign in to comment.