Giter Club home page Giter Club logo

drishti's Introduction

drishti

Travis Appveyor License (3-Clause BSD) Hunter Gitter

Real time eye tracking for embedded and mobile devices in C++11.

eye models 1 eye models 2 eye models 3

NEWS (2018/08/10)

Native iOS, Android, and "desktop" variants of the real-time facefilter application have been added here: src/examples/facefilter. These applications link against the installed public drishti::drishti package interface, which is designed without external types in the API definition. The facefilter demos are enabled by the DRISHTI_BUILD_EXAMPLES CMake option, and the entire src/examples tree is designed to be relocatable, you can cp -r src/examples ${HOME}/drishti_examples, customize, and build, by simply updating the drishti package details.

iOS

The iOS facefilter target requires Xcode 9 (beta 4) or above (Swift language requirements) and will be generated directly as a standard CMake add_executable() target as part of the usual top level project build --if you are using an appropriate CMake iOS toolchain for cross compilation from your macOS + Xcode host for your iOS device. Please see Polly Based Build and iOS Build below for more details.

Android Studio

UPDATE: Android NDK r19 is not currently supported due to significant structural changes in the android-ndk toolchain that conflict with CMake's internal Android support. See this _discussion for more details.

You can download standalone NDK r18x toolchains or earlier and specify those directly in your gradle local.properties.

drishti/android-studio/local.properties example:

ndk.dir=/Users/username/android/android-ndk-r18b
sdk.dir=/Users/username/Library/Android/sdk
cmake.dir=/usr/local

The top level Android Studio application is located in the android-studio directory. This target will build and manage repository C++ sources directly as part of the project. Android Studio/Gradle is required to build the application layer, and the CMake build is managed directly by gradle. There are a few platform specific configurations that must be addressed before building. Please see Android Studio Build below for more details.

Overview

Goal: SDK size <= 1 MB and combined resources (object detection + regression models) <= 4 MB.

  • Hunter package management and CMake build system by Ruslan Baratov, as well as CI and much of the real time facefilter mobile application(s) layer: "Organize Freedom!" :)
  • A C++ and OpenGL ES 2.0 implementation of Fast Feature Pyramids for Object Detection (see Piotr's Matlab Toolbox) for face and eye detection -- the ACF library is available as a standalone Hunter package here
  • Iris ellipse fitting via Cascaded Pose Regression (Piotr Dollar, et al) + XGBoost regression (Tianqi Chen, et al)
  • Face landmarks and global eye models provided by "One Millisecond Face Alignment with an Ensemble of Regression Trees (Kazemi, et al) using a modified implementation from Dlib (Davis King) (normalized pixel differences, line indexed features, PCA size reductions)
  • OpenGL ES friendly GPGPU shader processing and efficient iOS + Android texture handling using a modified version of ogles_gpgpu (Markus Kondrad) with a number of shader implementations taken directly from GPUImage (Brad Larson)
iPhone @ 30 FPS (VIDEO)
iPhone

Drishti Right Eye Annotation Scheme

FEATURE SPECIFICATION
eyelids   2D points 0-15
crease 2D points 16-24
iris center 2D point 25
outer limbus limbus intersection with ray from outer corner to iris center
inner limbus limbus intersection with ray from inner corner to iris center
iris ellipse 2D center, minor axis, major axis, angle (radians)
pupil ellipse 2D center, minor axis, major axis, angle (radians)
  • the left eye is obtained by Y axis mirroring
  • total (27*2)+(2*5) = 64 parameters
  • the eye crease is useful for pose indexing, but better guidelines are needed
  • the 2D limbus points are slightly redundant (given the ellipse iris model) but the intersection points are stable with respect to squinting and provide an efficient anchor for posed indexed features (accurate point-to-ellipse distances are non-trivial and are fairly computationally intensive)
  • currently 2D only (gaze angle ground truth would be beneficial)

Quick Start (i.e., How do I make this library work?)

General

Drishti is a CMake based project that uses the Hunter package manager to download and build project dependencies from source as needed. Hunter contains detailed documentation, but a few high level notes and documentation links are provided here to help orient first time users. In practice, some working knowledge of CMake may also be required. Hunter itself is written in CMake, and is installed as part of the build process from a single HunterGate() macro at the top of the root CMakeLists.txt file (typically cmake/Hunter/HunterGate.cmake) (you don't have to build or install it). Each CMake dependency's find_package(FOO) call that is paired with a hunter_add_package(FOO CONFIG REQUIRED) will be managed by Hunter. In most cases, the only system requirement for building a Hunter project is a recent CMake , a working compiler corresponding to the operative toolchain and native build tool. If you're not familiar with CMake, you can try to build this minimal example to get a basic understanding.

Hunter will maintain all dependencies in a versioned local cache by default (typically ${HOME}/.hunter) where they can be reused in subsequent builds and shared between different projects. They can also be stored in a server side binary cache --select toolchains will be backed by a server side binary cache (https://github.com/elucideye/hunter-cache) and will produce faster first time builds (use them if you can!).

Get Latest Sources

Clone this repository and initialize all submodules:

> git clone https://github.com/elucideye/drishti
> cd drishti
[drishti]> git submodule update --init .

or

> git clone --recursive https://github.com/elucideye/drishti

Generate and Build

Desktop platforms usually don't require a toolchain (a default toolchain with C++11 support will be set by Drishti) and you can generate and build Drishti as a regular CMake project.

Linux + GCC + Makefile with Drishti examples, Release:

cmake -H. -B_builds -DHUNTER_STATUS_DEBUG=ON -DDRISHTI_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release
cmake --build _builds

macOS + Xcode with Drishti examples, Release:

cmake -H. -B_builds -GXcode -DHUNTER_STATUS_DEBUG=ON -DDRISHTI_BUILD_EXAMPLES=ON
cmake --build _builds --config Release

Windows + Visual Studio 15 2017 with Drishti examples, Release:

cmake -H. -B_builds -G "Visual Studio 15 2017" -DHUNTER_STATUS_DEBUG=ON -DDRISHTI_BUILD_EXAMPLES=ON
cmake --build _builds --config Release

To run the install procedure add the CMAKE_INSTALL_PREFIX variable and use --target install:

cmake -H. -B_builds -G "Visual Studio 15 2017" -DHUNTER_STATUS_DEBUG=ON -DCMAKE_INSTALL_PREFIX=_install
cmake --build _builds --config Release --target install

Polly Based Build

To support cross platform builds and testing, the CI scripts make use of Polly: a set of common CMake toolchains paired with a simple polly.py CMake build script. Polly is a Python script, make sure Python 3 is installed:

> which python3
/usr/bin/python3

Clone Polly and add bin folder to PATH:

> git clone https://github.com/ruslo/polly
> export PATH=`pwd`/polly/bin:$PATH

Check it:

> which polly.py
/.../polly/bin/polly.py

> polly.py --help
Python version: 3.5
usage: polly.py [-h]
    [--toolchain ...

Note: Polly is not a build requirement, CMake can always be used directly, but it is used here for convenience.

After the environment is configured, you can build for any supported Polly toolchain (below you can find some toolchains used in CI) with a command like this:

polly.py --toolchain ${TOOLCHAIN} --config-all ${CONFIG} --install --verbose

Building examples:

polly.py --toolchain ${TOOLCHAIN} --config-all ${CONFIG} --install --verbose --reconfig --fwd DRISHTI_BUILD_EXAMPLES=ON

:

Note: The --reconfig flag is included in the example above, which will re-run the CMake configure step (to incorporate CMake changes) for you. It is a reasonable step to add in cases where you aren't sure if it is needed.

iOS Build

Since CMake contains an Xcode generator, building for iOS is fairly straightforward. In practice, it is no different than the other polly.py toolchain builds. As always, you will need to have an Apple Developer Account to build and run on iOS devices. There are a few setup steps associated with Apple code signing requirements. Since iOS 10.0, Xcode projects require a valid Team ID entry, which can be set through CMake using the CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM CMake variable. If you generate an Xcode project through a polly.py command (described below), it will initialize the field for you if the POLLY_IOS_DEVELOPMENT_TEAM environment variable is set with your Team ID, which can be found in your Apple Developer Account. If you are using an Apple Enterprise Developer Account, the CMAKE_TRY_COMPILE step can fail with an error beginning with No profiles for 'com.example' were found: .... You can fix this with a one time Xcode initialization described in POLLY_IOS_DEVELOPMENT_TEAM.

Android Studio Build

For Android Studio, there are additional requirements:

  • CMake 3.9.2+
  • Ninja
  • Android Studio 3.2.1

Note: Polly will not be used here, because CMake is launched by Android Studio itself.

Note: Host compiler is required for some parts of the build. E.g. on Windows you have to install Visual Studio. Please check that minimal C++ example is working.

The path to the CMake executable should be added to the local.properties file before opening drishti/android-studio in Android Studio, or before invoking the Gradle build script. If you do not have a local.properties file, it will be generated automatically by Android Studio in the top level android-studio folder (usually drishti/android-studio/local.properites), when it is launched, at which point you can add the cmake.dir=/path/to/native/cmake CMake entry and rerun. The local.properties file will look something like this:

ndk.dir=/home/username/Android/Sdk/ndk-bundle
sdk.dir=/home/username/Android/Sdk
cmake.dir=/opt/cmake

The cmake.dir entry should be set such that <cmake.dir>/bin/cmake points to a valid cmake executable file.

Please check these instructions for details and useful notes:

There is another entry point for Android Studio - src/examples/facefilter/android-studio. It should be used only for testing or as a template for starting your own project based on Drishti.

Android Studio Workarounds

The following factors may contribute to some instability in the Android Studio managed build.

  • Using custom CMake 3.7+ in Android Studio is a relatively new feature
  • Some issues are hard to track or confirm, some issues are already reported but still not fixed

With support for official CMake binaries now in the Android Studio 3.2.1 release, the Android build stability is very likely improved compared to earlier beta versions.

From experience, the weakest part in the build has been communication between Gradle and CMake. To minimize it, the following trick can be used:

  • Open the top-level CMakeLists.txt file
  • Find if(DRISHTI_DEBUG_STOP) condition
  • Substitute if(DRISHTI_DEBUG_STOP) with if(TRUE)
  • Run Gradle build:
[drishti]> cd android-studio
[drishti/android-studio]> ./gradlew assembleDebug

If you're running it a first time there will be a high chance to hit this Gradle issue:

* What went wrong:
Execution failed for task '...'.
> Conversion = c, Flags =

In this case, just wait for few seconds and run Gradle again:

[drishti/android-studio]> ./gradlew assembleDebug
  • Revert CMakeLists.txt file, i.e. substitute if(TRUE) with if(DRISHTI_DEBUG_STOP).
  • Run the CMake build without Gradle:
[drishti/android-studio]> cmake --build ../src/examples/facefilter/android-studio/app/.externalNativeBuild/cmake/debug/arm64-v8a

Once the CMake build is ready, you can use ./gradlew assembleDebug or open Android Studio IDE.

Applications

Please see the README for the drishti-hci console application to see an example of a full eye tracking pipeline with the GPGPU optimizations.

Integration

Drishti is also available as a Hunter package. If you would like to integrate Drishti in your project, please see the Hunter Drishti package documentation.

Steps (check https://docs.hunter.sh/en/latest/quick-start.html):

Add cmake/HunterGate.cmake and a minimal cmake/Hunter/config.cmake to your project:

mkdir -p cmake/Hunter
wget https://raw.githubusercontent.com/hunter-packages/gate/master/cmake/HunterGate.cmake -O cmake/HunterGate.cmake
wget https://raw.githubusercontent.com/ruslo/hunter/master/examples/drishti/config.cmake -O cmake/Hunter/config.cmake

:

Add HunterGate(URL <url> SHA1 <sha1>) to the top of your CMakeLists.txt (You can find updated release information here).

include("cmake/HunterGate.cmake")
HunterGate(
    URL "https://github.com/ruslo/hunter/archive/v0.19.140.tar.gz"
    SHA1 "f2c30348c05d0d424976648ce3560044e007496c"
    LOCAL # use cmake/Hunter/config.cmake
)

:

Finally, add the Drishti package to your CMakeLists.txt and link it to your target:

hunter_add_package(drishti)
find_package(drishti CONFIG REQUIRED)
target_link_libraries(your_app_or_lib PUBLIC drishti::drishti)

:

You can customize the drishti package (and dependencies) by specifying a VERSION and/or CMAKE_ARGS (options) list for each package in cmake/Hunter/config.cmake.

Please see https://github.com/elucideye/drishti_hunter_test for a minimal working example using the drishti hunter package.

Toolchains

The configurations listed below have all been tested. In general, most C++11 toolchains should work with minimal effort. A CI comment indicates that the configuration is part of the Travis or Appveyor CI tests, so all Hunter packages will be available in the server side binary cache.

Linux (Ubunty Trusty 14.04):

  • TOOLCHAIN=clang-fpic-hid-sections CONFIG=Release # CI
  • TOOLCHAIN=gcc-5-pic-hid-sections-lto CONFIG=Release # CI
  • TOOLCHAIN=libcxx CONFIG=Release # w/ clang 3.8

OSX:

  • TOOLCHAIN=osx-10-13 CONFIG=Release # CI
  • TOOLCHAIN=osx-10-12-sanitize-address-hid-sections CONFIG=Release # CI
  • TOOLCHAIN=xcode-hid-sections CONFIG=Release # generic

iOS:

  • TOOLCHAIN=ios-nocodesign-11-3-dep-9-3-arm64 CONFIG=Release # CI
  • TOOLCHAIN=ios-10-1-arm64-dep-8-0-hid-sections CONFIG=Release

Android:

  • TOOLCHAIN=android-ndk-r17-api-19-armeabi-v7a-neon-clang-libcxx CONFIG=MinSizeRel # CI
  • TOOLCHAIN=android-ndk-r17-api-24-arm64-v8a-clang-libcxx14 CONFIG=Release # CI
  • TOOLCHAIN=android-ndk-r10e-api-19-armeabi-v7a-neon-hid-sections-lto CONFIG=MinSizeRel

Windows:

  • TOOLCHAIN=vs-15-2017 CONFIG=Release # CI
  • TOOLCHAIN=vs-14-2015-sdk-8-1 CONFIG=Release # CI
  • TOOLCHAIN=vs-14-2015-win64-sdk-8-1 CONFIG=Release # CI
  • TOOLCHAIN=vs-14-2015-win64-sdk-8-1 CONFIG=Debug # CI

The polly out of source build trees are located in _builds/${TOOLCHAIN}, the final build products (the stuff you want) are installed in _install/${TOOLCHAIN}, and the build logs are dumped in _logs/${TOOLCHAIN}. The iOS frameworks are installed in _frameworks/${TOOLCHAIN}.

Choosing simplest toolchain

On Linux you will usually want --toolchain gcc-pic (GCC based toolchain with position independent code).

On Windows, the preferred toolchain will depend on the generator you want, e.g., if you want "Visual Studio 15 2017", then use --toolchain vs-15-2017, if you want the 64 bit version use --toolchain vs-15-2017-win64.

On macOS, the choice of toolchain depends on Xcode version you have installed. Please check this table for Xcode versions and corresponding iOS/macOS SDK versions:

E.g., if you have Xcode 8.3.1 installed, then the default SDK will be macOS 10.12 SDK, hence you can use --toolchain osx-10-12. Instead of the Xcode generator, you can use a Makefile toolchain - --toolchain osx-10-12-make.

In the same table, you can find iOS SDK version. E.g., if you have installed Xcode 9.4 with default iOS SDK 11.4, and you want to set the deployment SDK to version 9.3, you can use --toolchain ios-11-4-dep-9-3-arm64 to build the ARM64 architecture. If you have several versions of Xcode installed, you can use IOS_X_Y_DEVELOPER_DIR/OSX_X_Y_DEVELOPER_DIR environment variables for switching. E.g., if OSX_10_13_DEVELOPER_DIR will be set to Xcode 9.0 location, then Xcode 9.0 will be used with --toolchain osx-10-13, even if Xcode 9.3 is installed and set as the default.

You can use Polly toolchains to build Android if you don't want to rely on Android Studio. The only requirement is an environment variable with the Android NDK location. Set the ANDROID_NDK_r17 environment variable with the path to the Android NDK r17, and you can use any --toolchain android-ndk-r17-* variants.

drishti's People

Contributors

gitter-badger avatar headupinclouds avatar jalandhara avatar ruslo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

drishti's Issues

Review/cleanup

Other stuff from chat:

  • size of the SDK (see #5)
    • O2 instead of O3?
    • MinSizeRel?
    • Link Time Optimization?
    • Single Compilation Unit?
  • build time (Hunter binary cache enough? Try Travis directory cache (see comment)

cvmatio is printing file header info to stdout

int Detector::deserialize(const char *filename)
{
    MatlabIO matio;
    ParserNode<Detector> root_(filename, *this); // <=== printing
    // SNIP
}

Output:

File: /Users/dhirvonen/devel/drishti/assets/drishti_face_inner_48x48.mat
MATLAB 5.0 MAT-file, Platform: MACI64, Created on: Fri Oct  2 22:17:11 2015                                         Variables: detector vector<vector<MatlabIOContainer>>

Hunter store passwords for packages

  • Use experimental (not yet released) CMake
  • Describe location of config file
  • Describe usage of GitHub tokens instead of passwords
# ~/.configs/Hunter/passwords.cmake
hunter_http_password(<packagename-1> USERNAME "MyName" PASSWORD "MyPassword")
hunter_http_password(<packagename-2> USERNAME "MyName2" PASSWORD "MyPassword2")

drishti_world option

Build monolithic static library drishti_world by aggregating all sources collected using sugar.

ogles_gpgpu package includes

    add_definitions(-DUSE_LOCAL_OGLES_GPGPU=0)
    hunter_add_package(ogles_gpgpu)
    find_package(ogles_gpgpu CONFIG REQUIRED)
    include_directories("${OGLES_GPGPU_ROOT}/include/ogles_gpgpu")
    include_directories("${OGLES_GPGPU_ROOT}/include/ogles_gpgpu/common")
    list(APPEND DRISHTI_SDK_3RDPARTY_PKG_LIBS ogles_gpgpu::ogles_gpgpu) # Add library    

The include_directories() calls above needed after the hunter_add_package(ogles_gpgpu) call to provide paths needed by internal ogles_gpgpu header use, such as:

#include "proc/filter3x3.h"

The internal #include calls should be made to use consistent paths like this:

#include "ogles_gpgpu/common/proc/filter3x3.h"

Sample build log:
ProcessPCH++ /var/folders/03/f9zk5wl94437_7j7vcssvd5r0000gn/C/com.apple.DeveloperTools/7.2.1-7C1002/Xcode/SharedPrecompiledHeaders/drishti_world_CXX_prefix-cyjocbcbdqsnmndrtburcdrlvonp/drishti_world_CXX_prefix.hxx.pch _builds/xcode/src/lib/drishti/Release/cotire/drishti_world_CXX_prefix.hxx normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/dhirvonen/devel/drishti
export LANG=en_US.US-ASCII
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++-header -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -Wno-trigraphs -fpascal-strings -O3 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -DCMAKE_INTDIR="Release" -D_USE_MATH_DEFINES -DON=1 -DOFF=0 -DDRISHTI_OPENGL_ES=0 -DHAS_XGBOOST=1 -DHAVE_FP16=1 -DHAVE_HALF_FLOAT=1 -DDO_SQUEEZE=1 -DDLIB_NO_GUI_SUPPORT=1 -DUSE_LOCAL_OGLES_GPGPU=0 -DXGBOOST_DO_LEAN=0 -DXGBOOST_USE_BOOST=1 -DXGBOOST_SQUEEZE=1 -DHALF_ENABLE_CPP11_CMATH=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min=10.10 -Wno-sign-conversion -I/Users/dhirvonen/devel/drishti/_builds/xcode/src/lib/drishti/Release/include -I/Users/dhirvonen/devel/hunter/_Base/xxxxxxx/1043db2/388520a/Install/include/opencv -I/Users/dhirvonen/devel/hunter/_Base/xxxxxxx/1043db2/388520a/Install/include -I/Users/dhirvonen/devel/drishti/src/lib -I/Users/dhirvonen/devel/drishti/src/lib/drishti -I/Users/dhirvonen/devel/drishti/src/3rdparty/pba -I/Users/dhirvonen/devel/drishti/src/3rdparty -I/Users/dhirvonen/devel/drishti/src/lib/drishti/acf/acf/toolbox -I/Users/dhirvonen/devel/drishti/_builds/xcode/src/lib/drishti -I/Users/dhirvonen/devel/hunter/_Base/xxxxxxx/1043db2/388520a/Install/include/eigen3 -I/Users/dhirvonen/devel/hunter/_Base/xxxxxxx/1043db2/388520a/Install/include/cvmatio -I/Users/dhirvonen/devel/hunter/_Base/xxxxxxx/1043db2/388520a/Install/include/xgboost -I/Users/dhirvonen/devel/drishti/_builds/xcode/src/lib/drishti/drishtisdk.build/Release/drishti_world.build/DerivedSources/x86_64 -I/Users/dhirvonen/devel/drishti/_builds/xcode/src/lib/drishti/drishtisdk.build/Release/drishti_world.build/DerivedSources -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -F/Users/dhirvonen/devel/drishti/_builds/xcode/src/lib/drishti/Release -std=c++11 -stdlib=libc++ -Wno-c++11-narrowing -Wno-unused-parameter -Wno-unused-local-typedefs -Wno-unknown-attributes -ftemplate-depth=900 -DNDEBUG -MD -MT dependencies -MF /var/folders/03/f9zk5wl94437_7j7vcssvd5r0000gn/C/com.apple.DeveloperTools/7.2.1-7C1002/Xcode/SharedPrecompiledHeaders/drishti_world_CXX_prefix-cyjocbcbdqsnmndrtburcdrlvonp/drishti_world_CXX_prefix.hxx.d -c /Users/dhirvonen/devel/drishti/_builds/xcode/src/lib/drishti/Release/cotire/drishti_world_CXX_prefix.hxx -o /var/folders/03/f9zk5wl94437_7j7vcssvd5r0000gn/C/com.apple.DeveloperTools/7.2.1-7C1002/Xcode/SharedPrecompiledHeaders/drishti_world_CXX_prefix-cyjocbcbdqsnmndrtburcdrlvonp/drishti_world_CXX_prefix.hxx.pch --serialize-diagnostics /var/folders/03/f9zk5wl94437_7j7vcssvd5r0000gn/C/com.apple.DeveloperTools/7.2.1-7C1002/Xcode/SharedPrecompiledHeaders/drishti_world_CXX_prefix-cyjocbcbdqsnmndrtburcdrlvonp/drishti_world_CXX_prefix.hxx.dia
In file included from /Users/dhirvonen/devel/drishti/_builds/xcode/src/lib/drishti/Release/cotire/drishti_world_CXX_prefix.hxx:4:
In file included from /Users/dhirvonen/devel/drishti/_builds/xcode/src/lib/drishti/Release/cotire/drishti_world_CXX_prefix.cxx:66:
/Users/dhirvonen/devel/hunter/_Base/xxxxxxx/1043db2/388520a/Install/include/ogles_gpgpu/common/proc/grad.h:16:10: fatal error: 'proc/filter3x3.h' file not found

include "proc/filter3x3.h"

build-android.sh test-thread-pool.cpp error

Not critical, disabling for now.

CMakeFiles/test-thread-pool.dir/test-thread-pool.cpp.o:/Users/dhirvonen/devel/drishti/src/tests/thread-pool/test-thread-pool.cpp:function main: error: undefined reference to '__aeabi_read_tp'
CMakeFiles/test-thread-pool.dir/test-thread-pool.cpp.o:/Users/dhirvonen/devel/drishti/src/tests/thread-pool/test-thread-pool.cpp:function Worker<128u>::threadFunc(unsigned int, Worker<128u>*): error: undefined reference to '__aeabi_read_tp'

evaluate: Hierarchical Part Model

https://github.com/golnazghiasi/hpm-detection-code

Part based models begin do better than pure regression approaches for heavily occluded face images. HPM outperforms RCPR in occlusion data sets. Need to benchmark for feasibility in mobile processing (size + speed). See:

occlusion_comp

This may not be suitable for real time processing on mobile devices. The paper reports 10 seconds per frame using this approach [reference?].

add granularity to IDE folders

Currently library modules are built as static libraries and CMake adds "Source Files" and "Header Files" folders like this:

module
 |-- Source Files
 |-- Header Files

It would be nice to include an addition folder for subcategories, such as the gpu modules.

module
 |-- Source Files
 |-- Header Files
 |- gpu
      |-- Source Files
      |-- Header Files

cvmatio istream input

The current cvmatio design uses an overloaded class EFStream : public std::fstream approach for endian portability which forces MatlabIO to use an input filename. This prevent portable istream use, which is required for loading baked assets in Qt (and similar). The EFStream read operator performs a normal read followed by a swapEndian call.

    // overloaded fstream read method with 
    // byte swapping capacity
    std::istream& read(char *s, std::streamsize n) {
        // call the parent read
        std::istream& stream = std::fstream::read(s,n);
        // swap the endianness if necessary
        if (byte_swap_ && n%2 == 0) swapEndian(s,n);
        return stream;
    }

Moving the endian swap out of the EFStream (into MatlabIO) would allow MatlabIO to work with arbitrary istream classes.

address sanitizer

http://clang.llvm.org/docs/AddressSanitizer.html
http://useyourloaf.com/blog/using-the-address-sanitizer/

Trying polly xcode-address-sanitizer toolchain (similar to [] Enable Address Sanitizer in Xcode scheme).

xcode-sanitizer-address.cmake

# Copyright (c) 2014-2015, Ruslan Baratov
# All rights reserved.

if(DEFINED POLLY_XCODE_SANITIZE_ADDRESS_CMAKE_)
  return()
else()
  set(POLLY_XCODE_SANITIZE_ADDRESS_CMAKE_ 1)
endif()

include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake")

set(POLLY_XCODE_COMPILER "clang")
polly_init(
    "Xcode / ${POLLY_XCODE_COMPILER} / \
LLVM Standard C++ Library (libc++) / c++11 support / sanitize-address"
    "Xcode"
)

include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake")

include("${CMAKE_CURRENT_LIST_DIR}/compiler/xcode.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/library/std/libcxx.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/flags/sanitize_address_libcxx.cmake")

sanitize_address_libcxx.cmake

# Copyright (c) 2014-2016, Ruslan Baratov
# Copyright (c) 2016, David Hirvonen
# All rights reserved.

if(DEFINED POLLY_FLAGS_SANITIZE_ADDRESS_LIBCXX_CMAKE_)
  return()
else()
  set(POLLY_FLAGS_SANITIZE_ADDRESS_LIBCXX_CMAKE_ 1)
endif()

include(polly_add_cache_flag)

polly_add_cache_flag(CMAKE_CXX_FLAGS "-fsanitize=address")
polly_add_cache_flag(CMAKE_CXX_FLAGS "-g")
polly_add_cache_flag(CMAKE_CXX_FLAGS "-D_LIBCPP_HAS_NO_ASAN")

set(
    CMAKE_CXX_FLAGS_RELEASE
    "-O1 -DNDEBUG"
    CACHE
    STRING
    "C++ compiler flags"
    FORCE
)

polly_add_cache_flag(CMAKE_C_FLAGS "-fsanitize=address")
polly_add_cache_flag(CMAKE_C_FLAGS "-g")
polly_add_cache_flag(CMAKE_C_FLAGS "-D_LIBCPP_HAS_NO_ASAN")

set(
    CMAKE_C_FLAGS_RELEASE
    "-O1 -DNDEBUG"
    CACHE
    STRING
    "C compiler flags"
    FORCE
)

Running ./bin/build-xcode.sh with the above toolchain fails with the following error:

CMake Error at /usr/local/Cellar/cmake/3.5.0/share/cmake/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler
  "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
  is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: /Users/dhirvonen/devel/drishti/_builds/xcode-sanitize-address/CMakeFiles/CMakeTmp



  Run Build Command:"/usr/bin/xcodebuild" "-project"
  "CMAKE_TRY_COMPILE.xcodeproj" "build" "-target" "cmTC_3f5d6"
  "-configuration" "Debug"

  === BUILD TARGET cmTC_3f5d6 OF PROJECT CMAKE_TRY_COMPILE WITH CONFIGURATION
  Debug ===



  Check dependencies



  Write auxiliary files

  /bin/mkdir -p
  /Users/dhirvonen/devel/drishti/_builds/xcode-sanitize-address/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTC_3f5d6.build/Objects-normal/x86_64


  write-file
  /Users/dhirvonen/devel/drishti/_builds/xcode-sanitize-address/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTC_3f5d6.build/Objects-normal/x86_64/cmTC_3f5d6.LinkFileList




  CompileC
  CMAKE_TRY_COMPILE.build/Debug/cmTC_3f5d6.build/Objects-normal/x86_64/testCCompiler.o
  testCCompiler.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compiler

      cd /Users/dhirvonen/devel/drishti/_builds/xcode-sanitize-address/CMakeFiles/CMakeTmp
      export LANG=en_US.US-ASCII
      /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -DCMAKE_INTDIR=\"Debug\" -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -mmacosx-version-min=10.10 -g -Wno-sign-conversion -I/Users/dhirvonen/devel/drishti/_builds/xcode-sanitize-address/CMakeFiles/CMakeTmp/Debug/include -I/Users/dhirvonen/devel/drishti/_builds/xcode-sanitize-address/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTC_3f5d6.build/DerivedSources/x86_64 -I/Users/dhirvonen/devel/drishti/_builds/xcode-sanitize-address/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTC_3f5d6.build/DerivedSources -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -F/Users/dhirvonen/devel/drishti/_builds/xcode-sanitize-address/CMakeFiles/CMakeTmp/Debug -D_LIBCPP_HAS_NO_ASAN -fsanitize=address -MMD -MT dependencies -MF /Users/dhirvonen/devel/drishti/_builds/xcode-sanitize-address/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTC_3f5d6.build/Objects-normal/x86_64/testCCompiler.d --serialize-diagnostics /Users/dhirvonen/devel/drishti/_builds/xcode-sanitize-address/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTC_3f5d6.build/Objects-normal/x86_64/testCCompiler.dia -c /Users/dhirvonen/devel/drishti/_builds/xcode-sanitize-address/CMakeFiles/CMakeTmp/testCCompiler.c -o /Users/dhirvonen/devel/drishti/_builds/xcode-sanitize-address/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTC_3f5d6.build/Objects-normal/x86_64/testCCompiler.o



  Ld Debug/cmTC_3f5d6 normal x86_64

      cd /Users/dhirvonen/devel/drishti/_builds/xcode-sanitize-address/CMakeFiles/CMakeTmp
      export MACOSX_DEPLOYMENT_TARGET=10.10
-- Configuring incomplete, errors occurred!
See also "/Users/dhirvonen/devel/drishti/_builds/xcode-sanitize-address/CMakeFiles/CMakeOutput.log".
See also "/Users/dhirvonen/devel/drishti/_builds/xcode-sanitize-address/CMakeFiles/CMakeError.log".
      /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -L/Users/dhirvonen/devel/drishti/_builds/xcode-sanitize-address/CMakeFiles/CMakeTmp/Debug -F/Users/dhirvonen/devel/drishti/_builds/xcode-sanitize-address/CMakeFiles/CMakeTmp/Debug -filelist /Users/dhirvonen/devel/drishti/_builds/xcode-sanitize-address/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTC_3f5d6.build/Objects-normal/x86_64/cmTC_3f5d6.LinkFileList -mmacosx-version-min=10.10 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Xlinker -dependency_info -Xlinker /Users/dhirvonen/devel/drishti/_builds/xcode-sanitize-address/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTC_3f5d6.build/Objects-normal/x86_64/cmTC_3f5d6_dependency_info.dat -o /Users/dhirvonen/devel/drishti/_builds/xcode-sanitize-address/CMakeFiles/CMakeTmp/Debug/cmTC_3f5d6

  Undefined symbols for architecture x86_64:

    "___asan_init", referenced from:
        _asan.module_ctor in testCCompiler.o
    "___asan_version_mismatch_check_v6", referenced from:
        _asan.module_ctor in testCCompiler.o

  ld: symbol(s) not found for architecture x86_64

  clang: error: linker command failed with exit code 1 (use -v to see
  invocation)



  ** BUILD FAILED **





  The following build commands failed:

    Ld Debug/cmTC_3f5d6 normal x86_64

  (1 failure)

complete documentation

Doxygen headers have been added for all files, but function and class documentation needs to be added (starting with drishti public API).

TODO: The standard library style namespace macros (which prevent IDE indentation) are currently confusing doxygen. This needs to be fixed.

cotire builds

Initial cotire testing...

The cotter builds seem to reduce to 0.66x (debug) to 0.75x (release) the standard build time. I've added an option to use these targets. This will create new _unity targets. The current installed SDK has not been updated to use drishti_world_unity target, however.

Release : 0.75x
drishti_world: 80, 79
drishti_world_unity: 63, 60

Debug: 0.66x
drishti_world: 91, 78, 77
drishti_world_unity: 48, 50, 53

cotire_drishti_world
cotire_drishti_world_unity

Add tests

Effectively enable --test and debug/fix problems

drishti:src/app/facefilter needs settings file

A settings file is needed to configure various device specific settings (resolution, scale parameters, etc.)

Does QT have a generic way to report the active device name (manufacturer + model)?

target_link_libraries(drishti PRIVATE "${DRISHTI_SDK_LIBS}") vs PUBLIC

If I use

target_link_libraries(drishti_c PRIVATE "${DRISHTI_SDK_LIBS}")
I'm able to install cleanly, but when I switch this to PUBLIC:

target_link_libraries(drishti_c PUBLIC "${DRISHTI_SDK_LIBS}")
I get the following errors on installation. This is a shared library, so I wouldn't expect a need to install the dependencies.

CMake Error: install(EXPORT "drishtiTargets" ...) includes target "drishti_c" which requires target "drishti_eye" that is not in the export set.
CMake Error: install(EXPORT "drishtiTargets" ...) includes target "drishti_c" which requires target "drishti_rcpr" that is not in the export set.
CMake Error: install(EXPORT "drishtiTargets" ...) includes target "drishti_c" which requires target "drishti_ml" that is not in the export set.
CMake Error: install(EXPORT "drishtiTargets" ...) includes target "drishti_c" which requires target "drishti_geometry" that is not in the export set.
CMake Error: install(EXPORT "drishtiTargets" ...) includes target "drishti_c" which requires target "drishti_sensor" that is not in the export set.
CMake Error: install(EXPORT "drishtiTargets" ...) includes target "drishti_c" which requires target "drishti_core" that is not in the export set.
CMake Error: install(EXPORT "drishtiTargets" ...) includes target "drishti_c" which requires target "xgboost" that is not in the export set.
CMake Error: install(EXPORT "drishtiTargets" ...) includes target "drishti_c" which requires target "boost-pba" that is not in the export set.
-- Generating done

@ruslo : Continuation of PR discussion

ACFTest fails on for TOOLCHAIN=vs-14-2015, CONFIG=Debug (Release OK)

TOOLCHAIN=vs-14-2015, CONFIG=Release

[00:13:40] EIGEN3_INCLUDE_DIR =
[00:13:40] HAVE_VALGRIND: HAVE_VALGRIND-NOTFOUND
[00:13:40] CMAKE_CXX_COMPILER_ID: MSVC
[00:13:40] =======
[00:13:40] 3: Test timeout computed to be: 9.99988e+006
[00:13:40] 3: [==========] Running 1 test from 1 test case.
[00:13:40] 3: [----------] Global test environment set-up.
[00:13:40] 3: [----------] 1 test from ACFTest
[00:13:40] 3: [ RUN      ] ACFTest.ACFDetection
[00:13:40] 3: -------------------------
[00:13:40] 3: File: C:/projects/drishti/assets/drishti_face_inner_48x48.mat
[00:13:40] 3: MATLAB 5.0 MAT-file, Platform: MACI64, Created on: Fri Oct  2 22:17:11 2015                                         Variables: detector vector<vector<MatlabIOContainer>>
[00:13:40] 3: -------------------------
[00:13:40] 3: [       OK ] ACFTest.ACFDetection (123 ms)
[00:13:40] 3: [----------] 1 test from ACFTest (123 ms total)
[00:13:40] 3:
[00:13:40] 3: [----------] Global test environment tear-down
[00:13:40] 3: [==========] 1 test from 1 test case ran. (123 ms total)
[00:13:40] 3: [  PASSED  ] 1 test.
[00:13:40] 3/3 Test #3: acf_test .........................   Passed    0.13 sec
[00:13:40] 
[00:13:40] 100% tests passed, 0 tests failed out of 3
[00:13:40] 

TOOLCHAIN=vs-14-2015, CONFIG=Debug

[00:13:53] EIGEN3_INCLUDE_DIR =
[00:13:53] HAVE_VALGRIND: HAVE_VALGRIND-NOTFOUND
[00:13:53] CMAKE_CXX_COMPILER_ID: MSVC
[00:13:53] =======
[00:13:53] Errors while running CTest
[00:13:53] 3: [----------] 1 test from ACFTest
[00:13:53] 3: [ RUN      ] ACFTest.ACFDetection
[00:13:53] 3/3 Test #3: acf_test .........................***Failed    0.06 sec
[00:13:53] 
[00:13:53] 67% tests passed, 1 tests failed out of 3
[00:13:53] 
[00:13:53] Total Test time (real) =  65.65 sec
[00:13:53] 
[00:13:53] The following tests FAILED:
[00:13:53]     3 - acf_test (Failed)
[00:13:53] Command exit with status "8": [C:\projects\drishti\_builds\vs-14-2015]> "ctest" "-C" "Debug" "-VV"

Add initial/minimal Metal (iOS) and OpenCL (Android) support

Investigate in the context of GPU friendly tree evaluation. In ACF processing we compute features in shaders and pull down the textures to the CPU w/ platform optimized transfers, then evaluate regression and classification trees on the CPU. It would be nice to investigate ways to do this end-to-end on the GPU (my sense is it will be hard to beat the CPU even w/ transfer overhead).

cvmatio travis build error

CVMATIO ZLIB:
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)


cvmatio Configuration Summary

Building with ECTO/Catkin: OFF
Build as executable: OFF
Build with documentation: OFF


-- Configuring done
CMake Error at src/CMakeLists.txt:8 (add_library):
Target "cvmatio" links to target "JPEG::jpeg" but the target was not found.
Perhaps a find_package() call is missing for an IMPORTED target, or an
ALIAS target is missing?

CMake Error at src/CMakeLists.txt:8 (add_library):
Target "cvmatio" links to target "JPEG::jpeg" but the target was not found.
Perhaps a find_package() call is missing for an IMPORTED target, or an
ALIAS target is missing?

CMake Error at src/CMakeLists.txt:8 (add_library):
Target "cvmatio" links to target "JPEG::jpeg" but the target was not found.
Perhaps a find_package() call is missing for an IMPORTED target, or an
ALIAS target is missing?

CMake Error at src/CMakeLists.txt:8 (add_library):
Target "cvmatio" links to target "JPEG::jpeg" but the target was not found.
Perhaps a find_package() call is missing for an IMPORTED target, or an
ALIAS target is missing?
-- Generating done

-- Build files have been written to: /home/travis/.hunter/_Base/defe8ce/95401fc/9de7cb3/Build/cvmatio/Build/cvmatio-Release-prefix/src/cvmatio-Release-build
CMake Warning:
Manually-specified variables were not used by the project:

CMAKE_CONFIGURATION_TYPES

make[2]: Leaving directory /home/travis/.hunter/_Base/defe8ce/95401fc/9de7cb3/Build/cvmatio/Build' make[2]: *** [cvmatio-Release-prefix/src/cvmatio-Release-stamp/cvmatio-Release-configure] Error 1 make[1]: *** [CMakeFiles/cvmatio-Release.dir/all] Error 2 make: *** [all] Error 2 make[1]: Leaving directory/home/travis/.hunter/_Base/defe8ce/95401fc/9de7cb3/Build/cvmatio/Build'

[hunter ** FATAL ERROR **] Build step failed (dir: /home/travis/.hunter/_Base/defe8ce/95401fc/9de7cb3/Build/cvmatio
[hunter ** FATAL ERROR **] [Directory:/home/travis/.hunter/_Base/Download/Hunter/0.16.2/defe8ce/Unpacked/cmake/projects/cvmatio]

------------------------------ WIKI -------------------------------

https://github.com/ruslo/hunter/wiki/error.external.build.failed

CMake Error at /home/travis/.hunter/_Base/Download/Hunter/0.16.2/defe8ce/Unpacked/cmake/modules/hunter_wiki.cmake:12 (message):
Call Stack (most recent call first):
/home/travis/.hunter/_Base/Download/Hunter/0.16.2/defe8ce/Unpacked/cmake/modules/hunter_fatal_error.cmake:20 (hunter_wiki)
/home/travis/.hunter/_Base/Download/Hunter/0.16.2/defe8ce/Unpacked/cmake/modules/hunter_download.cmake:499 (hunter_fatal_error)
/home/travis/.hunter/_Base/Download/Hunter/0.16.2/defe8ce/Unpacked/cmake/projects/cvmatio/hunter.cmake:59 (hunter_download)
/home/travis/.hunter/_Base/Download/Hunter/0.16.2/defe8ce/Unpacked/cmake/modules/hunter_add_package.cmake:87 (include)
CMakeLists.txt:314 (hunter_add_package)

-- Configuring incomplete, errors occurred!
See also "/home/travis/build/elucideye/drishti/_builds/gcc-4-8-pic-Release/CMakeFiles/CMakeOutput.log".
See also "/home/travis/build/elucideye/drishti/_builds/gcc-4-8-pic-Release/CMakeFiles/CMakeError.log".
Command exit with status "1": [/home/travis/build/elucideye/drishti]> "cmake" "-H." "-B/home/travis/build/elucideye/drishti/_builds/gcc-4-8-pic-Release" "-DCMAKE_BUILD_TYPE=Release" "-GUnix Makefiles" "-DCMAKE_TOOLCHAIN_FILE=/home/travis/build/elucideye/drishti/polly-master/gcc-4-8-pic.cmake" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DPOLLY_STATUS_DEBUG=ON" "-DHUNTER_STATUS_DEBUG=ON" "-DCMAKE_INSTALL_PREFIX=/home/travis/build/elucideye/drishti/_install/gcc-4-8-pic" "-DDRISHTI_BUILD_REGRESSION_SIMD=NO" "-DDRISHTI_BUILD_REGRESSION_FIXED_POINT=NO" "-DHUNTER_USE_CACHE_SERVERS=YES" "-DHUNTER_DISABLE_BUILDS=NO" "-DCMAKE_INSTALL_PREFIX=/home/travis/build/elucideye/drishti/_install"

Log: /home/travis/build/elucideye/drishti/_logs/polly/log.txt
*** FAILED ***

The command "build.py --toolchain ${TOOLCHAIN} --config ${CONFIG} --verbose --fwd DRISHTI_BUILD_REGRESSION_SIMD=NO DRISHTI_BUILD_REGRESSION_FIXED_POINT=NO HUNTER_USE_CACHE_SERVERS=YES HUNTER_DISABLE_BUILDS=NO CMAKE_INSTALL_PREFIX="pwd/_install" --test --jobs 8 ${STRIP}
" exited with 1.

Done. Your build exited with 1.

CI testing of post install libraries

We need to ensure that functionality in the post installation libraries (after stripping etc.) is tested, as something could go wrong during that stage.

Travis: "No output has been received in the last 10m0s"

This seems to be inevitable

No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received

The build has been terminated

Manual restarts are almost always required for 1 toolchain. Need to investigate .

add hunter JPEG package to OpenCV 3.0.0-p6

I've currently removed JPEG support, which I believe was causing problems for cvmatio builds (see #106)

hunter_config(OpenCV VERSION 3.0.0-p6 CMAKE_ARGS "${OPENCV_CMAKE_ARGS}")

Per @ruslo:

# Look for WITH_JPEG=ON in Hunter/config.cmake
# Dependency for OpenCV and cvmatio. Usually dependent packages are
# installed automatically but current hardcoded version of OpenCV is not
# hunterized enough so it doesn't know about Jpeg, i.e. there is no
# `hunter_add_package(Jpeg)`.  But Jpeg is present in fresh version of Hunter with
# custom FindJPEG.cmake module which expect JPEGConfig.cmake installed.
# OpenCV do use `find_package(JPEG)` without `hunter_add_package(Jpeg)`, hence
# FindJPEG.cmake exits with error "JPEG::jpeg not found". As a workaround
# we manually download Jpeg before OpenCV.
# TODO: remove after OpenCV version updated
hunter_add_package(Jpeg)
find_package(JPEG CONFIG REQUIRED)

reusable QT app + application pipeline interface

For simple video processing applications, most of the boilerplate QT qmlvideofilter type code can probably be abstracted into something more reusable (and potentially replaced by alternative frameworks). It should be easy to swap in different video pipelines with an API that receives as input an OpenGL texture ID (or void * + width + height + stride + format) and outputs an OpenGL texture ID for display. Some specification for additional output images and or texture ID's could be specified by the user as needed.

additional unit test coverage

  • acf cpu vs gpu channel computation
  • acf SIMD code
  • geometry : fitEllipse
  • ml : xgboost regression tests (fit cosine, etc); shape_predictor covered by eye model tests
  • core : arithmetic + conversions (SIMD)
  • graphics: WIP, but test basic ogles_gpgpu texture manipulation
  • rcpr : test end-to-end CPR for synthetic ellipse data (train + predict)
  • face : test FaceDetectorAndTracker.h
  • Coveralls for coverage badge? https://github.com/JoakimSoderberg/coveralls-cmake-example

consistent drishti include "namespace"

The internal library folder layout should be such that both build and install paths can use a "namespaced" include path:

#include <drishti/foo/thing.hpp>

We can adopt the layout used in opencv:

Single per module include (optional):

opencv/modules/core/include/opencv2/core.hpp

Individual module files:

opencv/modules/core/include/opencv2/core/core.hpp

SDK size reduction

The SDK and classifier/regressor files must be reduced:

  • investigate replacing compressed boost portable binary archives with cereal
  • compare above w/ flatbuffers (see dest)
  • BUILD_MIN_SIZE macro to remove training and IO that isn't needed at runtime
  • reduce opencv use

Some discussion: http://stackoverflow.com/questions/1061169/boost-serialization-vs-google-protocol-buffers. flatbuffers is not really intended for serialization but may provide more compact storage at the expense of less concise code. Need to compare combined lib + storage size after library stripping.

need pba2xml and xml2pba to support windows use

Boost portable binary archive caveats:
http://www.boost.org/doc/libs/1_55_0/libs/serialization/doc/todo.html

We could always rely on xml or json archives to get things working:

  1. login linux
  2. deserialize foo.pba.z
  3. serialize to foo.xml
  4. login windows
  5. deserialize foo.xml
  6. serialize to foo.win64.pba.z [optional]
  7. Need: src/app/pba/pbatoxml and src/app/pba/xmltopba

That should be portable and might be good enough to support Windows development, since this stuff is primarily targeting mobile platforms.

3rd parties enhancement

There are an improvement ideas about CMake/Hunter/Polly that have mentioned in few bugs which may have influence on Drishti. This bug will summarize them. Though most of them can be fixed simply in Drishti itself or workarounded somehow, it may be useful to know the whole picture. Probably those pieces of the puzzle will form a new directions.

CMake

Automatic grouping in IDE (Xcode/Visual Studio)

I have a bunch of Python modules in Sugar for such job. But this functionality require to have Python installed and require patching of CMakeLists.txt. If such feature will be implemented in CMake then we can simply add set(CMAKE_IDE_AUTOMATIC_LAYOUT TRUE) or even have this feature ON by default (introduce new CMake policy).

Mirror CMake option to C++ definition

This is kind of widely used pattern of transparent connectivity of CMake and C++ levels. Though I think that drishti_mirror_definition should be applied for targets (i.e. call target_compile_definitions instead of add_definitions).

Size of installed files

Introduce two features:

  • New command file(SIZE ...)
  • Add option for printing installed sizes using file(SIZE ...), like CMAKE_INSTALL_SIZE_INFO=K (K - kilobytes, M - megabytes, H - human readable, see man ls)

Testing of installed libraries

This feature missing in CMake itself, I did mentioned it here for example. The next errors is not covered by regular testing:

  • Missing definitions. Internally package can define macro by add_definitions("-DFOO"). And if macro FOO used in public header then FOO will be defined on build step and not after the install step.
  • Missing find_dependency call. Error happens quite often: after package installed and find_package(CONFIG) called, users got "target Boo::boo is not built by this project, probably find_package is missing". This error means that we have to call find_dependency(Boo) in FooConfig.cmake file.
  • Private headers usage/missing headers. Layout of headers on build step may differs from layout after install. In this case if package is using some private header (header that are not planned to install) there will be no error on build step. And vice versa if we are planning to use some header but forget to install it.

CMake methods for manipulation C++ warnings

The feature described here: https://cmake.org/pipermail/cmake-developers/2016-April/028279.html and I'm planning to implement it anyway (my priorities: CGold, Hunter docs, this feature) since it's an importand part of C++ ecosystem which provide one more benefit of using CMake :) Also it will be closely coupled with Leathers (Leathers is a C++ level of CMake funtionality). Idea based/tested on Sugar modules.

Work with JSON format for GitHub API

This one needed for Hunter for uploading binaries to GitHub using CMake instead of Python scripts. Need to introduce new command/family of commands for working with JSON format, like json(PARSE ...) or string(JSON ...) to parse responses from GitHub. I know that some JSON library already integrated into CMake for server-mode feature so just need to discuss/develop API and implement it. Alternatively kind of GitHub API commands can be introduced, like file(GITHUB_API RELEASE_ID release_id RELEASE "v0.0.1" REPO user/repo), file(GITHUB_API RELEASE_LIST release_list REPO user/repo).

I no longer think it's a good idea. It's better to create service that will handle this stuff and other "remote" things.

Single Compilation Unit

I still haven't used cotire tool however common sense and API I saw make me think that implementing SCU in CMake itself has next benefits:

  • You don't have to patch CMakeLists.txt
  • 3rd party library can be added to final single source file too

It means that if you have add_library(foo foo.cpp) there are next variants:

  • BUILD_SHARED_LIBS=ON build shared library
  • BUILD_SHARED_LIBS=OFF build static library (default)
  • CMAKE_BUILD_SCU=ON: for libraries don't build anything, just save the list of files and add them to the final executable. If such library planned to be installed - install only sources and special directive in *Config.cmake file so user can still use find_package(foo CONFIG REQUIRED) + target_link_libraries(<exe> PUBLIC foo)

Hunter

Uploading binaries to GitHub without use of Python script

This feature is important for having custom/private cache servers when user upload binaries without having fork of the Hunter with upload.* branches. The main difference is about the fact that upload.* do operations step-by-step, e.g. if there are A, B, C dependent packages then first we run upload.A, then upload.B, then upload.C. When user have one job for it he should wait for all A, B, C packages built in one single step. If A+B+C takes longer then 50 minutes (or other timeout) there will be no packages uploaded at all. For this feature we need CMake support (see JSON/GitHub API).

Alternative approach will be to use custom front-end server that will handle requests from Hunter and redirect them to the back-end. Different back-ends can be implemented depending on user's settings: S3 bucket, GitHub repository, Sourceforge, custom server, etc. I see it like this: user enter the site with service, login with credentials, set back-end for the upload. Then using same credentials Hunter send request about upload. Server check credentials, determine user, determine user's back-end and redirect request. I have very poor experience with web development so can't say any implementation details for now.

Managing compilers with Hunter

Alternative to using clang from Xcode or brew. The benefits is that we can control build options and version of compilers using CMake code and Hunter packages, store them to binary cache server, etc.
Basic issue is here: https://github.com/ruslo/hunter/issues/495

Thaw

I have an idea about creating super tool for bootstraping. This tool will include:

  • functionality of Polly (something based on aliasing, some will be moved to Hunter)
  • install-ci-dependencies.py: install latest CMake verion (or precise)
  • Implement aliasing system: https://github.com/ruslo/CMake/issues/3 (instead of implementing it in CMake, my proposal was rejected)
  • Hunter root maintenance: https://github.com/ruslo/hunter/issues/173
  • Reporting human readable/understandable difference between toolchains-id so user can easily find the way how to tweak his environment to use cache server

populate https://github.com/elucideye/hunter-cache

I've created a public https://github.com/elucideye/hunter-cache site to host binary packages for drishti builds. We need travis + appveyor build mode to support uploading hunter packages to this site for an indepdent/backup binary cache, per documentation here:

https://github.com/ruslo/hunter/blob/master/docs/faq/why-binaries-from-server-not-used.rst

list(APPEND HUNTER_CACHE_SERVERS "https://github.com/elucideye/hunter-cache")
HunterGate(URL ... SHA1 ...)

DRISHTI_BUILD_SHARED_SDK=OFF install() needs fixing (static sdk)

DRISHTI_BUILD_SHARED_SDK=OFF

The install() is currently skipped on static builds, since the initial use for static builds was asan testing (workaround), that is ok.

# TODO: The install section is failing for static libraries.
#CMake Error: install(EXPORT "drishtiTargets" ...) includes target "drishti" which requires target "drishti_world" that is not in the export set.
#CMake Error: install(EXPORT "drishtiTargets" ...) includes target "drishti" which requires target "xgboost" that is not in the export set.
#CMake Error: install(EXPORT "drishtiTargets" ...) includes target "drishti" which requires target "boost-pba" that is not in the export set.
if(NOT DRISHTI_BUILD_SHARED_SDK)
  return()
endif()

See: https://github.com/headupinclouds/drishti/blob/pr.xcode.asan.exp/src/lib/drishti/CMakeLists.txt#L352-L354
https://github.com/headupinclouds/drishti/blob/pr.xcode.asan.exp/src/lib/drishti/CMakeLists.txt#L329

drishti_symbol_list.cmake LINK_FLAGS

Migrated from PR discussion...

Ruslo: LINK_FLAGS can be set outside of the project: in someone's toolchain or by using Drishti with add_subdirectory(drishti). It's better to not rely on such things and clean variable always.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.