Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
be71de7
Add OpenCV include directories to CMakefile.
Nov 6, 2013
0614346
Include unistd.h in map-list utility.
Nov 6, 2013
d3cf9f7
Fix a compilation problem occuring with OpenCV 2.4.6 and Apple LLVM 5.0.
Nov 13, 2013
dbc90c6
Various includes to get face kit to build
schue Apr 29, 2014
02883e1
Missing including a head file: Foundation/NSValue.h.
Mar 30, 2015
4f878b4
Fix a character case error.
Mar 30, 2015
5b42c0a
Make qt-gui build successfully with GNUStep on linux.
Mar 30, 2015
d221892
update .gitignore.
Aug 26, 2015
cda7f33
Fix file name
wenwei-dev Sep 22, 2015
818bad3
Support OpenCV 3.0.0
GeorgeChan Dec 17, 2015
7308c29
First part of the Windows port: fixed compilation errors and warnings
luigivieira Mar 5, 2016
4de4bdb
Create INSTALL.md
CMCDragonkai Mar 6, 2016
ea86b38
Update INSTALL.md
CMCDragonkai Mar 6, 2016
eabf39c
Second part of the Windows port: fixed link errors; upgraded to Qt5
luigivieira Mar 6, 2016
e8feb8b
Fixes for the compilation in Linux
luigivieira Mar 7, 2016
1496fc4
Renamed README to make it a markdown file
luigivieira Mar 8, 2016
3f8a24b
Added missing cpp file to qt-guit project
luigivieira Mar 8, 2016
d3f8d94
Removed compiler flags in Windows - to let VS do its default in debug…
luigivieira Mar 8, 2016
981463e
Fixed potential crash/assert in Warp method used for expression transfer
luigivieira Mar 15, 2016
e09fea3
Implemented installation in CMake scripts
luigivieira Sep 29, 2016
5a99117
Implemented find script (to allow using find_package(CSIRO) in other …
luigivieira Sep 30, 2016
8d633e0
Exporting includes to correct structure; exporting binaries in both d…
luigivieira Oct 1, 2016
c87844a
Set a default search path for most Linux systems
linas Oct 1, 2016
18638d8
Merge pull request #1 from linas/find
linas Oct 1, 2016
f59bd26
Merge branch 'fix/build' of github.com:wenwei-dev/face-analysis-sdk
linas Oct 1, 2016
2dfad82
Merge pull request #2 from hansonrobotics/wheezybuild
linas Oct 1, 2016
c78e916
Revert "Various includes to get face kit to build"
linas Oct 1, 2016
67384c3
Merge pull request #3 from hansonrobotics/revert-2-wheezybuild
linas Oct 1, 2016
34fd9f6
Merge github.com:tetard/face-analysis-sdk into tetard
linas Oct 1, 2016
ffabddd
Merge pull request #4 from linas/tetard
linas Oct 1, 2016
f66ebae
Merge branch 'fix-issue5' of github.com:cook/face-analysis-sdk into cook
linas Oct 1, 2016
d0c6e88
Check for the GUI components in tthe cmakefile
linas Oct 1, 2016
7e54478
Add the needed linker flags to avoid bomb
linas Oct 1, 2016
c815daf
Merge pull request #5 from linas/cook
linas Oct 1, 2016
c5643a6
Merge branch 'ytxie' of github.com:cook/face-analysis-sdk
linas Oct 1, 2016
cdd496e
Merge branch 'master' of github.com:GeorgeChan/face-analysis-sdk into…
linas Oct 1, 2016
826d1be
Revert some of GeorgeChan's changes
linas Oct 1, 2016
ea6b5b5
Merge github.com:MatrixAI/face-analysis-sdk
linas Oct 1, 2016
c2a011d
Merge pull request #6 from linas/chan
linas Oct 1, 2016
3acffde
Simplify the screw cmakefile
linas Oct 1, 2016
93cc276
Merge github.com:luigivieira/face-analysis-sdk into luigivieira
linas Oct 1, 2016
6e50ff8
Misc fixes to get things to compile
linas Oct 1, 2016
3809cb7
Merge pull request #7 from linas/luigivieira
linas Oct 1, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ build/*
config.log
config.status
.DS_Store
*~
*~
/_build*
48 changes: 31 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,29 @@ cmake_minimum_required(VERSION 2.8)

#set(CMAKE_VERBOSE_MAKEFILE true)

# Default values for options
if(NOT DEFINED OpenCV_PREFIX)
set(OpenCV_PREFIX ${CMAKE_INSTALL_PREFIX})
endif()

# Configurable options
OPTION(WITH_GUI "Build the GUI" OFF)


# Third party libraries
find_package(OpenCV REQUIRED core highgui imgproc objdetect
PATHS ${OpenCV_PREFIX}/lib/cmake/
${OpenCV_PREFIX}/share/OpenCV/
NO_DEFAULT_PATH) # For some reason CMake uses its defaults before the above paths.
find_package(OpenCV REQUIRED core highgui imgproc objdetect)

IF(APPLE)
find_library(FOUNDATION Foundation)
SET(EXTRA_LIBS ${FOUNDATION})
find_library(FOUNDATION Foundation)
SET(EXTRA_LIBS ${FOUNDATION})
ENDIF()

IF(UNIX AND NOT APPLE)
FIND_PROGRAM(HAVE_GNUSTEP NAMES gnustep-config)
IF(HAVE_GNUSTEP)
SET(WITH_GUI "Build the GUI" ON)
MESSAGE(STATUS "Found GnuStep")
ELSE(HAVE_GNUSTEP)
MESSAGE(STATUS "Cannot find GnuStep")
ENDIF(HAVE_GNUSTEP)
ENDIF(UNIX AND NOT APPLE)


# Third party programs
if(NOT DEFINED FFMPEG)
find_program(FFMPEG ffmpeg)
Expand All @@ -46,23 +50,28 @@ endif()
SET(CMAKE_BUILD_TYPE Release CACHE STRING "")

# - flags
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -O0 -Wall -Wextra -DDEBUG")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -O0 -g -Wall -Wextra -DDEBUG")
if(NOT WIN32)
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -O0 -Wall -Wextra -DDEBUG")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -O0 -g -Wall -Wextra -DDEBUG")

SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3 -Wall -Wextra")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -Wall -O3 -Wextra")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3 -Wall -Wextra")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -Wall -O3 -Wextra")
endif()

SET(LIBS ${OpenCV_LIBS} ${EXTRA_LIBS})
INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS})

# Build paths
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib")
#SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib")
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib")
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")

# Include directories
INCLUDE_DIRECTORIES("src/")
INCLUDE_DIRECTORIES("src/avatar/")
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/src/")
INCLUDE_DIRECTORIES(OpenCV_INCLUDE_DIRS)


# Subdirectories with CMakeLists.txt
ADD_SUBDIRECTORY(src/utils)
Expand All @@ -79,6 +88,9 @@ ADD_SUBDIRECTORY(src/display-tracking)
ADD_SUBDIRECTORY(src/create-avatar-model)
ADD_SUBDIRECTORY(src/display-3d-points)

# install(EXPORT CSIRO DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES src/CSIROConfig.cmake DESTINATION "${CMAKE_INSTALL_PREFIX}")

IF(WITH_GUI)
SET(CPACK_PACKAGE_NAME "clm")
SET(CPACK_PACKAGE_VENDOR "CI2CV-CSIRO ci2cv.net")
Expand All @@ -91,7 +103,9 @@ IF(WITH_GUI)
SET(CPACK_BINARY_PACKAGEMAKER OFF)
SET(CPACK_SOURCE_TGZ OFF)
ADD_SUBDIRECTORY(src/qt-gui)
MESSAGE(STATUS "Will build the GUI")
else()
MESSAGE(STATUS "Missing GUI components - will NOT build the GUI")
endif()

#cpack stuff goes here

39 changes: 39 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Make sure you have Bash, Cmake, Git, FFmpeg and OpenCV installed.

If you're on Ubuntu, this should be enough:

```sh
# this installs a prebuilt opencv with python bindings along with some other tools
sudo apt-get install -y \
git \
pkg-config \
build-essential \
cmake \
libopencv-dev \
python-opencv \
ffmpeg
```

Otherwise check:

* http://milq.github.io/install-opencv-ubuntu-debian/
* http://docs.opencv.org/2.4/doc/tutorials/introduction/linux_install/linux_install.html
* http://askubuntu.com/questions/432542/is-ffmpeg-missing-from-the-official-repositories-in-14-04
* https://help.ubuntu.com/community/OpenCV

After you have all the dependencies, the build is simple:

```sh
# assuming you installed from libopencv-dev in ubuntu/debian
# if not, look for the directory that contains OpenCVConfig.cmake
path_to_opencv=$(dpkg --listfiles libopencv-dev | grep --max-count=1 'OpenCVConfig.cmake$')

git clone https://github.com/MatrixAI/face-analysis-sdk
pushd face-analysis-sdk
mkdir -p build
pushd build
cmake -DOpenCV_DIR="$path_to_opencv" -DFFMPEG=$(which ffmpeg) -DBASH=$(which bash) ..
make
popd
popd
```
20 changes: 0 additions & 20 deletions README

This file was deleted.

32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Welcome to the CSIRO Face Analysis SDK. Documentation for the SDK can
be found in doc/documentation.html.

All code in this SDK is provided according to the license found in
LICENSE.

If you use the CSIRO Face Analysis SDK in any publications, we ask
that you reference our works.

The face tracking component is based on the publication:
J. Saragih, S. Lucey and J. Cohn, "Deformable Model Fitting by
Regularized Landmark Mean-Shift", IJCV 2011.

The expression transfer component is based on the publication:
J. Saragih, S. Lucey and J. Cohn, "Real-time Avatar Animation from a
Single Image", AFGR Workshop 2011.

If you use the SDK, we ask that you reference the following paper:
M. Cox, J. Nuevo, J. Saragih and S. Lucey, "CSIRO Face Analysis SDK",
AFGR 2013.

---

Here are the updates in the original code included in this fork of the project:

- The dependency of Qt in the qt-gui project was upgraded from Qt4 to Qt5.
- Some OpenCV missing includes were added (perhaps they are due to changes in version used).
- The type casts were made explicit to remove related warning messages.
- Some static array allocations were replaced with the operator `new[]`.
- The Windows/POSIX-specific function calls were enclosed in `#ifdefs` based on the operating system defined at compilation time, and the the best corresponding functions were used for Windows (for instance: `PathRemoveFileSpec` and `PathStripPath` respectively replaced `dirname` and `basename` in Windows).
- The class `ForkRunner` was completely replaced in Windows by the implementation proposed by Ben Howell [here](http://www.benhowell.net/guide/2015/03/16/porting-face-analysis-sdk-to-windows/). Although, [there is no direct equivalent of `fork` (used by the original class) on Windows](http://stackoverflow.com/a/9148072/2896619) and [`CreateProcess` does not have the same behaviour](http://stackoverflow.com/q/985281/2896619) (further tests required).
- The libraries `utilities`, `clmTracker` and `avatarAnim`, that were originally created as shared libraries, were transformed into static libraries only for the Windows configuration. This was just simpler to do at this time, because the use of the `__declspec(dllexport)` directive (to export the functions/classes to be usable through a DLL) was causing problems related to third part objects not being equally exported (for instance, in some classes/functions, the compiler was producing messages like: "warning C4251: class 'cv::Mat' needs to have dll-interface to be used by clients of class <the class in which cv::Mat was used>").
2 changes: 2 additions & 0 deletions src/CSIROConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
set(CSIRO_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/include")
include("${CMAKE_CURRENT_LIST_DIR}/CSIRO.cmake")
14 changes: 12 additions & 2 deletions src/avatar/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,15 @@ CONFIGURE_FILE("Config.h.in" "Config.h")

SET(AVATAR_FILES "Avatar.cpp" "myAvatar.cpp")

ADD_LIBRARY(avatarAnim SHARED ${AVATAR_FILES})
TARGET_LINK_LIBRARIES(avatarAnim ${LIBS} utilities clmTracker)
if(WIN32)
set(LIBTYPE STATIC)
else()
set(LIBTYPE SHARED)
endif()

ADD_LIBRARY(avatarAnim ${LIBTYPE} ${AVATAR_FILES})
set_target_properties(avatarAnim PROPERTIES DEBUG_POSTFIX "d")
TARGET_LINK_LIBRARIES(avatarAnim ${LIBS} utilities clmTracker)

install(TARGETS avatarAnim EXPORT CSIRO DESTINATION lib)
install(FILES Avatar.hpp IO.hpp DESTINATION include/avatar)
Loading