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
76f14e0
Persist value of DOUBLE_PRECISION.
jzarl Jun 20, 2015
5b7dde2
Remove unnecessary add_definitions().
jzarl Jun 20, 2015
459e2cb
Create cmake package.
jzarl Jun 20, 2015
bdb0115
Use CImg from system if available.
jzarl Jun 20, 2015
f0ae482
Use RapidXML from system if available.
jzarl Jun 20, 2015
6709fe3
Use standard file system layout.
jzarl Jun 20, 2015
b7fe00d
Fix detection of rapidxml on gentoo.
jzarl Jun 21, 2015
a0fc4f4
Apply install destination suggestions by l3u.
jzarl Jun 21, 2015
139afdf
Add check and warning about upstream bug in RapidXML.
jzarl Jun 21, 2015
1deef56
Merge pull request #9 from jzarl/buildsystem
uricamic Jun 23, 2015
398aa2c
Merge branch 'master' of https://github.com/uricamic/clandmark
Jun 23, 2015
b92a779
Update README.md
uricamic Jul 13, 2015
f3bfadb
Added Gitter badge
gitter-badger Jul 14, 2015
33e4fe1
Merge pull request #12 from gitter-badger/gitter-badge
uricamic Jul 14, 2015
044743d
Update examples/CMakeLists.txt
uricamic Jul 27, 2015
068ec7e
Python interface (minimal version)
Nov 4, 2015
fb5408b
Merge pull request #24 from uricamic/develop
uricamic Nov 4, 2015
839622f
Python Interface - examplary usage (ipython notebook)
Nov 4, 2015
cc387b7
Merge pull request #25 from uricamic/develop
uricamic Nov 4, 2015
f9a886a
python interface mac os
K0stIa Nov 5, 2015
1ce4a73
Merge pull request #27 from K0stIa/master
uricamic Nov 5, 2015
dcbdfe6
BMRMCONSTR2 with helper mex-functions added.
Jan 7, 2016
edce6d8
MATLAB learning scripts (parallel) for single view dense set (68 land…
Jan 7, 2016
6ad3ebf
Merge branch 'feature/learning_MATLAB' into develop
Jan 7, 2016
1e0fd14
Merge pull request #33 from uricamic/develop
uricamic Jan 7, 2016
128af9c
MATLAB helper functions
Apr 14, 2016
0f6bf56
MATLAB helpers continued
Apr 14, 2016
07f9716
Multi-view learning scripts init
Apr 14, 2016
06df6da
Merge branch 'feature/MATLAB_mv_learning' into develop
Apr 14, 2016
396265f
Merge pull request #53 from uricamic/develop
uricamic Apr 14, 2016
e4ed418
Core + MATLAB interface update
Apr 15, 2016
e4e2fac
Merge branch 'master' into develop
Apr 15, 2016
6c1413a
Merge branch 'develop'
Apr 15, 2016
48eaeca
Merge branch 'master' of https://github.com/uricamic/clandmark
Apr 15, 2016
db38c9c
Update README.md
uricamic Jul 25, 2016
ecc0f7b
python2 to python3
jiapei100 Aug 11, 2016
d88842a
Remove all 'using namespace'
jiapei100 Aug 11, 2016
dd9260b
Remove all 'using namespace'
jiapei100 Aug 11, 2016
d12c224
Merge pull request #65 from jiapei100/master
uricamic Aug 12, 2016
73b694d
Python Interface & CMake fixes
Aug 22, 2016
a29eb03
Windows build scripts
uricamic Feb 5, 2017
947a3da
Merge pull request #78 from uricamic/windows_build2
uricamic Feb 5, 2017
29ce0c9
Python Interface update
uricamic Aug 7, 2019
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.tlog
3 changes: 2 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ Michal Uricar <uricamic@cmp.felk.cvut.cz>
Vojtech Franc <xfrancv@cmp.felk.cvut.cz>

Python wrappper
Kostiantyn Antoniuk <antonkos@cmp.felk.cvut.cz>
Kostiantyn Antoniuk <antonkos@cmp.felk.cvut.cz>
Michal Uricar <uricamic@cmp.felk.cvut.cz>
34 changes: 19 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,28 @@ project(clandmark)

# The version number
set(clandmark_VERSION_MAJOR 1)
set(clandmark_VERSION_MINOR 5)
set(clandmark_VERSION_MINOR 6)
set(clandmark_VERSION ${clandmark_VERSION_MAJOR}.${clandmark_VERSION_MINOR})

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules")

#option(BUILD_SHARED_LIBS "Check whether to build libraries dynamically or statically. On for dynamic, Off for static build." ON)
mark_as_advanced(CMAKE_INSTALL_PREFIX)
set(BUILD_SHARED_LIBS "TRUE" CACHE BOOL "Global flag to cause add_library to create shared libraries if on.")
set(CMAKE_SKIP_BUILD_RPATH "FALSE" CACHE BOOL "Do not include RPATHs in the build tree.")

# set(BUILD_SHARED_LIBS "TRUE" CACHE BOOL "Global flag to cause add_library to create shared libraries if on.")
# set(CMAKE_SKIP_BUILD_RPATH "FALSE" CACHE BOOL "Do not include RPATHs in the build tree.")

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RELEASE CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE
)
endif(NOT CMAKE_BUILD_TYPE)

option(BUILD_SHARED_LIBS "Check whether to build libraries dynamically or statically. On for dynamic, Off for static build." OFF)
option(DOUBLE_PRECISION "Set the default precision used in CLandmark." ON)
option(BUILD_MATLAB_BINDINGS "Check whether to build MATLAB interface." OFF)
option(BUILD_PYTHON_BINDINGS "Check whether to build Python interface." OFF)
option(BUILD_CPP_EXAMPLES "Check whether to build CPP examples." ON)
option(BUILD_CPP_EXAMPLES "Check whether to build CPP examples." OFF)
option(USE_OPENMP "Enable/Disable OpenMP." OFF)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic")
Expand All @@ -34,15 +35,12 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -pedantic")
# for configured header files:
include_directories(${PROJECT_BINARY_DIR})

# build clandmark
# build clandmark & flandmark
add_subdirectory (libclandmark)

## build flandmark
#add_subdirectory (libflandmark)

# build examples
if(BUILD_CPP_EXAMPLES)
add_subdirectory(examples)
add_subdirectory(examples)
# copy important files needed to run examples (opencv haarcascade for facial detector, flandmark_model file, example images and videos)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/flandmark_model.xml ${CMAKE_CURRENT_BINARY_DIR}/examples/flandmark_model.xml COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/face.jpg ${CMAKE_CURRENT_BINARY_DIR}/examples/face.jpg COPYONLY)
Expand All @@ -60,30 +58,36 @@ if(BUILD_PYTHON_BINDINGS)
endif(BUILD_PYTHON_BINDINGS)

include(CMakePackageConfigHelpers)

write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/clandmark/CLandmarkConfigVersion.cmake"
VERSION ${clandmark_VERSION}
COMPATIBILITY AnyNewerVersion
)

export(EXPORT CLandmarkTargets
FILE "${CMAKE_CURRENT_BINARY_DIR}/clandmark/CLandmarkTargets.cmake"
NAMESPACE CLandmark::
)

configure_file(cmake/Templates/CLandmarkConfig.cmake
"${CMAKE_CURRENT_BINARY_DIR}/clandmark/CLandmarkConfig.cmake"
COPYONLY
)

install(EXPORT CLandmarkTargets
FILE CLandmarkTargets.cmake
NAMESPACE CLandmark::
DESTINATION lib/cmake/clandmark
)

install(
FILES
cmake/Templates/CLandmarkConfig.cmake
"${CMAKE_CURRENT_BINARY_DIR}/clandmark/CLandmarkConfigVersion.cmake"
DESTINATION lib/cmake/clandmark
COMPONENT Devel
COMPONENT
Devel
)


#install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/Findclandmark.cmake" DESTINATION ./ COMPONENT Devel)
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# clandmark

[![Join the chat at https://gitter.im/uricamic/clandmark](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/uricamic/clandmark?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

## Open Source Landmarking Library

Detailed description will be added soon
Expand All @@ -20,13 +22,25 @@ Otherwise, the internal version will be used and its files will be installed alo

In case you use clandmark in an academic work, please cite the following paper:

@InProceedings{
author = {U{\v{r}}i{\v{c}}{\'{a}}{\v{r}}, Michal and Franc, Vojt{\v{e}}ch and Thomas, Diego and Sugimoto, Akihiro and Hlav{\'{a}}{\v{c}}, V{\'{a}}clav},
title = {{Real-time Multi-view Facial Landmark Detector Learned by the Structured Output SVM}},
year = {2015},
booktitle = {BWILD '15: Biometrics in the Wild 2015 (IEEE FG 2015 Workshop)},
venue = {Ljubljana, Slovenia}
www = {http://luks.fe.uni-lj.si/bwild15},
```tex
@article{Uricar-IMAVIS-2016,
author = {U{\v{r}}i{\v{c}}{\'{a}}{\v{r}}, Michal and
Franc, Vojt{\v{e}}ch and Thomas, Diego and Sugimoto, Akihiro and Hlav{\'{a}}{\v{c}}, V{\'{a}}clav },
title = {Multi-view facial landmark detector learned by the Structured Output {SVM}},
journal = {Image and Vision Computing},
volume = {47},
pages = {45--59},
year = {2016},
month = {March},
note = {300-W, the First Automatic Facial Landmark Detection in-the-Wild Challenge},
issn = {0262-8856},
doi = {http://dx.doi.org/10.1016/j.imavis.2016.02.004},
url = {http://www.sciencedirect.com/science/article/pii/S0262885616300105},
publisher = {Elsevier},
address = {Amsterdam, Netherlands},
keywords = {Deformable Part Models, Structured output SVM, Facial landmarks detection },
}

```

Visit http://cmp.felk.cvut.cz/~uricamic/clandmark for further information.
28 changes: 28 additions & 0 deletions build_clandmark_libs.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
:: Builds and installs CLandmark libraries (both static and dynamic version)

call build_setup_variables.bat

set OLDDIR=%CD%

if NOT EXIST %BUILD_DIR% (
mkdir %BUILD_DIR%
)

cd %BUILD_DIR%

:: build static version of the libraries
cmake -G %CMAKE_GENERATOR% -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=%INSTALL_PATH% -DBUILD_CPP_EXAMPLES=OFF -DBUILD_MATLAB_BINDINGS=OFF -DBUILD_PYTHON_BINDINGS=OFF ..\
cmake --build . --target clandmark --config %CMAKE_CONFIGURATION%
cmake --build . --target flandmark --config %CMAKE_CONFIGURATION%

:: build dynamic version of the libraries
cmake -G %CMAKE_GENERATOR% -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=%INSTALL_PATH% -DBUILD_CPP_EXAMPLES=OFF -DBUILD_MATLAB_BINDINGS=OFF -DBUILD_PYTHON_BINDINGS=OFF ..\
cmake --build . --target clandmark --config %CMAKE_CONFIGURATION%
cmake --build . --target flandmark --config %CMAKE_CONFIGURATION%

:: install
cmake --build . --target INSTALL --config %CMAKE_CONFIGURATION%

cd %OLDDIR%

pause
28 changes: 28 additions & 0 deletions build_examples.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
:: Builds and installs C++ examples

call build_setup_variables.bat

set OLDDIR=%CD%

if NOT EXIST %BUILD_DIR% (
mkdir %BUILD_DIR%
)

cd %BUILD_DIR%

:: check if the library was compiled
IF NOT EXIST %INSTALL_PATH%\bin\clandmark.dll (
call %OLDDIR%\build_clandmark_libs.bat
)

:: build examples
cmake -G %CMAKE_GENERATOR% -DOPENCV_DIR=%OpenCV_DIR% -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=%INSTALL_PATH% -DBUILD_CPP_EXAMPLES=ON -DBUILD_MATLAB_BINDINGS=OFF -DBUILD_PYTHON_BINDINGS=OFF ..\
cmake --build . --target static_input --config %CMAKE_CONFIGURATION%
cmake --build . --target video_input --config %CMAKE_CONFIGURATION%

:: install
cmake --build . --target INSTALL --config %CMAKE_CONFIGURATION%

cd %OLDDIR%

pause
28 changes: 28 additions & 0 deletions build_matlab_interface.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
:: Builds and installs MATLAB interface

call build_setup_variables.bat

set OLDDIR=%CD%

if NOT EXIST %BUILD_DIR% (
mkdir %BUILD_DIR%
)

cd %BUILD_DIR%

:: check if the library was compiled
IF NOT EXIST %INSTALL_PATH%\lib\clandmark.lib (
call %OLDDIR%\build_clandmark_libs.bat
)

:: build MATLAB interface
cmake -G%CMAKE_GENERATOR% -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=%INSTALL_PATH% -DBUILD_CPP_EXAMPLES=OFF -DBUILD_MATLAB_BINDINGS=ON -DBUILD_PYTHON_BINDINGS=OFF ..\
cmake --build . --target flandmark_interface --config %CMAKE_CONFIGURATION%
cmake --build . --target featuresPool_interface --config %CMAKE_CONFIGURATION%

:: install
cmake --build . --target INSTALL --config %CMAKE_CONFIGURATION%

cd %OLDDIR%

pause
39 changes: 39 additions & 0 deletions build_python_interface.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
:: Builds and installs Python interface

call build_setup_variables.bat

set OLDDIR=%CD%

if NOT EXIST %BUILD_DIR% (
mkdir %BUILD_DIR%
)

cd %BUILD_DIR%

:: check if the library was compiled
IF NOT EXIST %INSTALL_PATH%\bin\clandmark.dll (
call %OLDDIR%\build_clandmark_libs.bat
)

::python interface build
cmake -G %CMAKE_GENERATOR% \
-DPYTHON_LIBRARY=%PYTHON_LIBRARY% \
-DPYTHON_EXECUTABLE=%PYTHON_EXECUTABLE% \
-DPYTHON_INCLUDE_DIR=%PYTHON_INCLUDE_DIR% \
-DCYTHON_EXECUTABLE=%CYTHON_EXECUTABLE% \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_INSTALL_PREFIX=%INSTALL_PATH% \
-DBUILD_CPP_EXAMPLES=OFF \
-DBUILD_MATLAB_BINDINGS=OFF \
-DBUILD_PYTHON_BINDINGS=ON ..\

cmake --build . --target ReplicatePythonSourceTree %CMAKE_CONFIGURATION%
cmake --build . --target py_featurePool --config %CMAKE_CONFIGURATION%
cmake --build . --target py_flndmark --config %CMAKE_CONFIGURATION%

:: install
cmake --build . --target INSTALL --config %CMAKE_CONFIGURATION%

cd %OLDDIR%

pause
21 changes: 21 additions & 0 deletions build_setup_variables.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
:: Change these variables to fit your settings

set BUILD_DIR=D:\GitHub\clandmark\build_win10
:: set CMAKE_GENERATOR="Visual Studio 14 2015 Win64"
set CMAKE_GENERATOR="Visual Studio 15 2017 Win64"
set CMAKE_CONFIGURATION=Release

set INSTALL_PATH=D:\GitHub\clandmark\build_win10\install

:: set OpenCV_DIR=D:\opencv\opencv-2.4.13\build\

:: set PYTHON_EXECUTABLE=D:\ProgramFiles\Anaconda2\python.exe
:: set PYTHON_INCLUDE_DIR=D:\ProgramFiles\Anaconda2\include
:: set PYTHON_LIBRARY=D:\ProgramFiles\Anaconda2\python27.dll
:: set PYTHON_LIBRARY=D:\ProgramFiles\Anaconda2\libs\python27.lib
:: set CYTHON_EXECUTABLE=D:\ProgramFiles\Anaconda2\Scripts\cython.exe
set CYTHON_EXECUTABLE="C:/Program Files (x86)/Microsoft Visual Studio/Shared/Anaconda3_64/Scripts/cython.exe"
set PYTHON_EXECUTABLE="C:/Program Files (x86)/Microsoft Visual Studio/Shared/Anaconda3_64/python.exe"
set PYTHON_INCLUDE_DIR="C:/Program Files (x86)/Microsoft Visual Studio/Shared/Anaconda3_64/include"
::set PYTHON_LIBRARY="C:/Program Files (x86)/Microsoft Visual Studio/Shared/Anaconda3_64/python3.dll"
set PYTHON_LIBRARY="C:/Program Files (x86)/Microsoft Visual Studio/Shared/Anaconda3_64/pkgs/python-3.6.5-h0c2934d_0/libs/python36.lib"
74 changes: 74 additions & 0 deletions cmake/Modules/Findclandmark.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# - Try to find the clandmark landmark detector library
#
# =============================================================================
# Once done this will define:
#
# CLANDMARK_FOUND TRUE if found; FALSE otherwise
# CLANDMARK_INCLUDE_DIRS where to find flandmark_detector.h
# CLANDMARK_LIBRARIES the libraries to link against
#
# =============================================================================
# Variables used by this module:
#
# CLANDMARK_PREFER_STATIC If TRUE and available, link against the static
# flandmark library. Otherwise select the shared
# version
#
# =============================================================================
# To use this from another project:
#
# create a directory named cmake/Modules under the project root, copy this file
# (FindCLANDMARK.cmake) there, and in the top-level CMakeLists.txt include:
# set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
# "${CMAKE_SOURCE_DIR}/cmake/Modules/")
#
# =============================================================================

find_path(CLANDMARK_INCLUDE_DIR CLandmark.h HINTS ${CLANDMARK_INSTALL_DIR} ${CLANDMARK_INSTALL_DIR}/include )
find_path(FLANDMARK_INCLUDE_DIR Flandmark.h HINTS ${CLANDMARK_INSTALL_DIR} ${CLANDMARK_INSTALL_DIR}/include )

set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".dll" ".dylib")
find_library(CLANDMARK_LIBRARY_SHARED NAMES clandmark)
find_library(FLANDMARK_LIBRARY_SHARED NAMES flandmark)

#
if (UNIX)
set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
endif(UNIX)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".lib")
find_library(CLANDMARK_LIBRARY_STATIC NAMES clandmark)
find_library(FLANDMARK_LIBRARY_STATIC NAMES flandmark)


# set(CLANDMARK_LIBRARY ${CLANDMARK_LIBRARY_STATIC})
set(CLANDMARK_LIBRARY ${CLANDMARK_LIBRARY_SHARED})
# set(CLANDMARK_LIBRARY ${CLANDMARK_LIBRARY_STATIC} ${CLANDMARK_LIBRARY_SHARED})
set(CLANDMARK_LIBRARIES ${CLANDMARK_LIBRARY})
set(CLANDMARK_INCLUDE_DIRS ${CLANDMARK_INCLUDE_DIR})

set(FLANDMARK_LIBRARY ${FLANDMARK_LIBRARY_SHARED})
# set(FLANDMARK_LIBRARY ${FLANDMARK_LIBRARY_STATIC} ${FLANDMARK_LIBRARY_SHARED})
set(FLANDMARK_LIBRARIES ${FLANDMARK_LIBRARY})
set(FLANDMARK_INCLUDE_DIRS ${FLANDMARK_INCLUDE_DIR})

# Temporary DEBUG message
message(STATUS "CLANDMARK: ${CLANDMARK_INCLUDE_DIR}, ${CLANDMARK_LIBRARIES}")
message(STATUS "FLANDMARK: ${FLANDMARK_INCLUDE_DIR}, ${FLANDMARK_LIBRARIES}")

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set CLANDMARK_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(
CLANDMARK
DEFAULT_MSG
CLANDMARK_LIBRARY CLANDMARK_INCLUDE_DIR
)

find_package_handle_standard_args(
FLANDMARK
DEFAULT_MSG
FLANDMARK_LIBRARY FLANDMARK_INCLUDE_DIR
)

mark_as_advanced(CLANDMARK_INCLUDE_DIR CLANDMARK_LIBRARY)
mark_as_advanced(FLANDMARK_INCLUDE_DIR FLANDMARK_LIBRARY)
Loading