elucideye / drishti

Real time eye tracking for embedded and mobile devices.
BSD 3-Clause "New" or "Revised" License
392 stars 82 forks source link

What should I do to make this library work? #574

Closed emreaslan closed 7 years ago

emreaslan commented 7 years ago

Hi,

I was trying to find location of pupil and track eyes. I found Drishti library. I created a TravisCI account to compile library. It passed tests. But I don't know how to compile library on my local computer. At first I tried to make it work on Ubuntu 16.04, but I couldn't.

When I run cmake . command in root folder, I got results below.


[hunter ** FATAL ERROR **] SHA1 suboption of HunterGate is mandatory
[hunter ** FATAL ERROR **] [Directory:/home/sparkh2o/installTest/drishti-master]

------------------------------ WIKI -------------------------------
    https://github.com/ruslo/hunter/wiki/error.incorrect.input.data
-------------------------------------------------------------------

CMake Error at cmake/HunterGate.cmake:76 (message):
Call Stack (most recent call first):
  cmake/HunterGate.cmake:100 (hunter_gate_wiki)
  cmake/HunterGate.cmake:104 (hunter_gate_fatal_error)
  cmake/HunterGate.cmake:364 (hunter_gate_user_error)
  CMakeLists.txt:34 (HunterGate)

-- Configuring incomplete, errors occurred!

When i run cmake . command in the src folder, I got results below.

CMake Error at CMakeLists.txt:19 (sugar_include):
  Unknown CMake command "sugar_include".

CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.5)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!
See also "/home/sparkh2o/installTest/drishti-master/src/CMakeFiles/CMakeOutput.log".

I tried to run travis codes below in terminal.

CONFIG=Release 
TOOLCHAIN=gcc-5-pic-hid-sections-lto 
INSTALL=--strip

# Add '--quiet' to avoid leaking the token to logs
git submodule update --init --recursive --quiet

# Install Python 3
if [[ "`uname`" == "Darwin" ]]; then travis_retry brew install python3; fi

# Install Python package 'requests'
# 'easy_install3' is not installed by 'brew install python3' on OS X 10.9 Maverick
if [[ "`uname`" == "Darwin" ]]; then pip3 install requests; fi
if [[ "`uname`" == "Linux" ]]; then travis_retry pip3 install --user requests; fi

# Install latest Polly toolchains and scripts
wget https://github.com/ruslo/polly/archive/master.zip
unzip master.zip
POLLY_ROOT="`pwd`/polly-master"
export PATH="${POLLY_ROOT}/bin:${PATH}"

# Install dependencies (CMake, Android NDK)
install-ci-dependencies.py

# Tune locations
export PATH="`pwd`/_ci/cmake/bin:${PATH}"

ARGS=(
    --toolchain ${TOOLCHAIN}
    --config ${CONFIG}
    --verbose
    --ios-multiarch --ios-combined
    --fwd
    DRISHTI_BUILD_REGRESSION_SIMD=NO
    DRISHTI_BUILD_REGRESSION_FIXED_POINT=NO
    DRISHTI_BUILD_TESTS=YES
    DRISHTI_BUILD_EXAMPLES=YES
    DRISHTI_COPY_3RDPARTY_LICENSES=ON
    GAUZE_ANDROID_USE_EMULATOR=YES
    HUNTER_USE_CACHE_SERVERS=ONLY
    HUNTER_DISABLE_BUILDS=YES
    HUNTER_CONFIGURATION_TYPES=${CONFIG}
    HUNTER_SUPPRESS_LIST_OF_FILES=ON
    --archive drishti
    --jobs 2
    --test      
    ${INSTALL}
)

polly.py ${ARGS[@]} --reconfig

Unfortunately, this trial also failed. Log file is below.

Execute command: [
  `which`
  `cmake`
]
[/home/sparkh2o/installTest/drishti-master]> "which" "cmake"
/home/sparkh2o/installTest/drishti-master/_ci/cmake/bin/cmake
Execute command: [
  `cmake`
  `--version`
]
[/home/sparkh2o/installTest/drishti-master]> "cmake" "--version"
cmake version 3.9.4

CMake suite maintained and supported by Kitware (kitware.com/cmake).
Execute command: [
  `cmake`
  `-H.`
  `-B/home/sparkh2o/installTest/drishti-master/_builds/gcc-5-pic-hid-sections-lto-Release`
  `-DCMAKE_BUILD_TYPE=Release`
  `-GUnix Makefiles`
  `-DCMAKE_TOOLCHAIN_FILE=/home/sparkh2o/installTest/drishti-master/polly-master/gcc-5-pic-hid-sections-lto.cmake`
  `-DCMAKE_VERBOSE_MAKEFILE=ON`
  `-DPOLLY_STATUS_DEBUG=ON`
  `-DHUNTER_STATUS_DEBUG=ON`
  `-DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO`
  `-DCMAKE_IOS_INSTALL_COMBINED=YES`
  `-DCMAKE_INSTALL_PREFIX=/home/sparkh2o/installTest/drishti-master/_install/gcc-5-pic-hid-sections-lto`
  `-DDRISHTI_BUILD_REGRESSION_SIMD=NO`
  `-DDRISHTI_BUILD_REGRESSION_FIXED_POINT=NO`
  `-DDRISHTI_BUILD_TESTS=YES`
  `-DDRISHTI_BUILD_EXAMPLES=YES`
  `-DDRISHTI_COPY_3RDPARTY_LICENSES=ON`
  `-DGAUZE_ANDROID_USE_EMULATOR=YES`
  `-DHUNTER_USE_CACHE_SERVERS=ONLY`
  `-DHUNTER_DISABLE_BUILDS=YES`
  `-DHUNTER_CONFIGURATION_TYPES=Release`
  `-DHUNTER_SUPPRESS_LIST_OF_FILES=ON`
]
[/home/sparkh2o/installTest/drishti-master]> "cmake" "-H." "-B/home/sparkh2o/installTest/drishti-master/_builds/gcc-5-pic-hid-sections-lto-Release" "-DCMAKE_BUILD_TYPE=Release" "-GUnix Makefiles" "-DCMAKE_TOOLCHAIN_FILE=/home/sparkh2o/installTest/drishti-master/polly-master/gcc-5-pic-hid-sections-lto.cmake" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DPOLLY_STATUS_DEBUG=ON" "-DHUNTER_STATUS_DEBUG=ON" "-DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO" "-DCMAKE_IOS_INSTALL_COMBINED=YES" "-DCMAKE_INSTALL_PREFIX=/home/sparkh2o/installTest/drishti-master/_install/gcc-5-pic-hid-sections-lto" "-DDRISHTI_BUILD_REGRESSION_SIMD=NO" "-DDRISHTI_BUILD_REGRESSION_FIXED_POINT=NO" "-DDRISHTI_BUILD_TESTS=YES" "-DDRISHTI_BUILD_EXAMPLES=YES" "-DDRISHTI_COPY_3RDPARTY_LICENSES=ON" "-DGAUZE_ANDROID_USE_EMULATOR=YES" "-DHUNTER_USE_CACHE_SERVERS=ONLY" "-DHUNTER_DISABLE_BUILDS=YES" "-DHUNTER_CONFIGURATION_TYPES=Release" "-DHUNTER_SUPPRESS_LIST_OF_FILES=ON"

[hunter ** FATAL ERROR **] SHA1 suboption of HunterGate is mandatory
[hunter ** FATAL ERROR **] [Directory:/home/sparkh2o/installTest/drishti-master]

-- Configuring incomplete, errors occurred!
------------------------------ WIKI -------------------------------
    https://github.com/ruslo/hunter/wiki/error.incorrect.input.data
-------------------------------------------------------------------

CMake Error at cmake/HunterGate.cmake:76 (message):
Call Stack (most recent call first):
  cmake/HunterGate.cmake:100 (hunter_gate_wiki)
  cmake/HunterGate.cmake:104 (hunter_gate_fatal_error)
  cmake/HunterGate.cmake:364 (hunter_gate_user_error)
  CMakeLists.txt:34 (HunterGate)

I am sorry to ask such question but I really need some information about compilation process. What should I do to make this library work?

Kind Regards

ruslo commented 7 years ago

cmake .

In-source build is not recommended for CMake, always use out-of-source build:

When i run cmake . command in the src folder, I got results below

It's not designed to work this way.

Unfortunately, this trial also failed. Log file is below

I think submodule is not initialized. Is file ./drishti-upload/config.cmake present?

emreaslan commented 7 years ago

Thank you for your help. Yes, submodule was not initialized. Now I fixed it. I checked .travis.yml file again applied whole steps. This time I cloned sources from repositories and I got different result.

Execute command: [
  `which`
  `cmake`
]
[/home/sparkh2o/installDrishti/elucideye/drishti]> "which" "cmake"
/home/sparkh2o/installDrishti/elucideye/drishti/_ci/cmake/bin/cmake
Execute command: [
  `cmake`
  `--version`
]
[/home/sparkh2o/installDrishti/elucideye/drishti]> "cmake" "--version"
cmake version 3.9.4

CMake suite maintained and supported by Kitware (kitware.com/cmake).
Execute command: [
  `cmake`
  `-H.`
  `-B/home/sparkh2o/installDrishti/elucideye/drishti/_builds/gcc-5-pic-hid-sections-lto-Release`
  `-DCMAKE_BUILD_TYPE=Release`
  `-GUnix Makefiles`
  `-DCMAKE_TOOLCHAIN_FILE=/home/sparkh2o/installDrishti/elucideye/drishti/polly-master/gcc-5-pic-hid-sections-lto.cmake`
  `-DCMAKE_VERBOSE_MAKEFILE=ON`
  `-DPOLLY_STATUS_DEBUG=ON`
  `-DHUNTER_STATUS_DEBUG=ON`
  `-DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO`
  `-DCMAKE_IOS_INSTALL_COMBINED=YES`
  `-DCMAKE_INSTALL_PREFIX=/home/sparkh2o/installDrishti/elucideye/drishti/_install/gcc-5-pic-hid-sections-lto`
  `-DDRISHTI_BUILD_REGRESSION_SIMD=NO`
  `-DDRISHTI_BUILD_REGRESSION_FIXED_POINT=NO`
  `-DDRISHTI_BUILD_TESTS=YES`
  `-DDRISHTI_BUILD_EXAMPLES=YES`
  `-DDRISHTI_COPY_3RDPARTY_LICENSES=ON`
  `-DGAUZE_ANDROID_USE_EMULATOR=YES`
  `-DHUNTER_USE_CACHE_SERVERS=ONLY`
  `-DHUNTER_DISABLE_BUILDS=NO`
  `-DHUNTER_CONFIGURATION_TYPES=Release`
  `-DHUNTER_SUPPRESS_LIST_OF_FILES=ON`
]
[/home/sparkh2o/installDrishti/elucideye/drishti]> "cmake" "-H." "-B/home/sparkh2o/installDrishti/elucideye/drishti/_builds/gcc-5-pic-hid-sections-lto-Release" "-DCMAKE_BUILD_TYPE=Release" "-GUnix Makefiles" "-DCMAKE_TOOLCHAIN_FILE=/home/sparkh2o/installDrishti/elucideye/drishti/polly-master/gcc-5-pic-hid-sections-lto.cmake" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DPOLLY_STATUS_DEBUG=ON" "-DHUNTER_STATUS_DEBUG=ON" "-DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO" "-DCMAKE_IOS_INSTALL_COMBINED=YES" "-DCMAKE_INSTALL_PREFIX=/home/sparkh2o/installDrishti/elucideye/drishti/_install/gcc-5-pic-hid-sections-lto" "-DDRISHTI_BUILD_REGRESSION_SIMD=NO" "-DDRISHTI_BUILD_REGRESSION_FIXED_POINT=NO" "-DDRISHTI_BUILD_TESTS=YES" "-DDRISHTI_BUILD_EXAMPLES=YES" "-DDRISHTI_COPY_3RDPARTY_LICENSES=ON" "-DGAUZE_ANDROID_USE_EMULATOR=YES" "-DHUNTER_USE_CACHE_SERVERS=ONLY" "-DHUNTER_DISABLE_BUILDS=NO" "-DHUNTER_CONFIGURATION_TYPES=Release" "-DHUNTER_SUPPRESS_LIST_OF_FILES=ON"
-- [hunter *** DEBUG *** 2017-10-09T17:42:52] HUNTER_ROOT set using HOME environment variable
-- [hunter *** DEBUG *** 2017-10-09T17:42:52] HUNTER_ROOT: /home/sparkh2o/.hunter
-- [hunter *** DEBUG *** 2017-10-09T17:42:52] Settings (initialize):
-- [hunter *** DEBUG *** 2017-10-09T17:42:52]   HunterGate done (NO)
-- [hunter *** DEBUG *** 2017-10-09T17:42:52]   Cache init (NO)
-- [polly] Used toolchain: gcc 5 / PIC / c++11 support / hidden / function-sections / data-sections / LTO
-- [polly *** DEBUG ***] Used tag: gcc-5-pic-hid-sections-lto
-- [polly *** DEBUG ***] CMAKE_DEBUG_POSTFIX is empty
-- [polly *** DEBUG ***] CMAKE_DEBUG_POSTFIX set to 'd'
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/gcc-5
-- Check for working C compiler: /usr/bin/gcc-5 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/g++-5
-- Check for working CXX compiler: /usr/bin/g++-5 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMAKE_INSTALL_PREFIX: /home/sparkh2o/installDrishti/elucideye/drishti/_install/gcc-5-pic-hid-sections-lto
-- Performing Test COMPILER_SUPPORTS_NO_NARROWING
-- Performing Test COMPILER_SUPPORTS_NO_NARROWING - Success
-- Performing Test COMPILER_SUPPORTS_NO_UNUSED_PARAMETER
-- Performing Test COMPILER_SUPPORTS_NO_UNUSED_PARAMETER - Success
-- Performing Test COMPILER_SUPPORTS_NO_UNUSED_LOCAL_TYPEDEFS
-- Performing Test COMPILER_SUPPORTS_NO_UNUSED_LOCAL_TYPEDEFS - Success
-- Performing Test COMPILER_SUPPORTS_NO_UNKNOWN_ATTRIBUTES
-- Performing Test COMPILER_SUPPORTS_NO_UNKNOWN_ATTRIBUTES - Success
-- Performing Test COMPILER_SUPPORTS_NO_SHORTEN_64_TO_32
-- Performing Test COMPILER_SUPPORTS_NO_SHORTEN_64_TO_32 - Success
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- [hunter *** DEBUG *** 2017-10-09T17:42:58] Single-configuration generator
-- [hunter *** DEBUG *** 2017-10-09T17:42:58] List of cache servers:
-- [hunter *** DEBUG *** 2017-10-09T17:42:58]   * https://github.com/elucideye/hunter-cache
-- [hunter *** DEBUG *** 2017-10-09T17:42:58]   * https://github.com/ingenue/hunter-cache
-- [hunter *** DEBUG *** 2017-10-09T17:42:58] Settings (finalize):
-- [hunter *** DEBUG *** 2017-10-09T17:42:58]   HunterGate done (NO)
-- [hunter *** DEBUG *** 2017-10-09T17:42:58]   Cache init (NO)
-- [hunter *** DEBUG *** 2017-10-09T17:42:58] Variables from HunterGate:
-- [hunter *** DEBUG *** 2017-10-09T17:42:58]   HUNTER_GATE_ROOT: /home/sparkh2o/.hunter
-- [hunter *** DEBUG *** 2017-10-09T17:42:58]   HUNTER_GATE_VERSION: 0.19.116
-- [hunter *** DEBUG *** 2017-10-09T17:42:58]   HUNTER_GATE_SHA1: c872605eee88941a751fb91a028cc5a69c77eac0
-- [hunter] Calculating Toolchain-SHA1
-- [hunter *** DEBUG *** 2017-10-09T17:42:58] [/home/sparkh2o/installDrishti/elucideye/drishti/_builds/gcc-5-pic-hid-sections-lto-Release/_3rdParty/Hunter/toolchain] > "/home/sparkh2o/installDrishti/elucideye/drishti/_ci/cmake/bin/cmake" "-DTOOLCHAIN_INFO_FILE=/home/sparkh2o/installDrishti/elucideye/drishti/_builds/gcc-5-pic-hid-sections-lto-Release/_3rdParty/Hunter/toolchain/toolchain.info" "-DCMAKE_TOOLCHAIN_FILE=/home/sparkh2o/installDrishti/elucideye/drishti/polly-master/gcc-5-pic-hid-sections-lto.cmake" "-DHUNTER_SELF=/home/sparkh2o/.hunter/_Base/Download/Hunter/0.19.116/c872605/Unpacked" "-GUnix Makefiles" "-H/home/sparkh2o/installDrishti/elucideye/drishti/_builds/gcc-5-pic-hid-sections-lto-Release/_3rdParty/Hunter/toolchain" "-B/home/sparkh2o/installDrishti/elucideye/drishti/_builds/gcc-5-pic-hid-sections-lto-Release/_3rdParty/Hunter/toolchain/_builds" "-DCMAKE_MAKE_PROGRAM=/usr/bin/make" "-DCMAKE_RELEASE_POSTFIX="
-- [polly] Used toolchain: gcc 5 / PIC / c++11 support / hidden / function-sections / data-sections / LTO
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/gcc-5
-- Check for working C compiler: /usr/bin/gcc-5 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/g++-5
-- Check for working CXX compiler: /usr/bin/g++-5 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/sparkh2o/installDrishti/elucideye/drishti/_builds/gcc-5-pic-hid-sections-lto-Release/_3rdParty/Hunter/toolchain/_builds
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] Already exists: /home/sparkh2o/.hunter/_Base/c872605/f04654b/toolchain.info
-- [hunter] Calculating Config-SHA1
>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>: /home/sparkh2o/installDrishti/elucideye/drishti/cmake/Modules;/home/sparkh2o/installDrishti/elucideye/drishti/drishti-upload/cmake/Modules;/home/sparkh2o/.hunter/_Base/Download/Hunter/0.19.116/c872605/Unpacked/cmake/modules;/home/sparkh2o/.hunter/_Base/Download/Hunter/0.19.116/c872605/Unpacked/cmake/find;/home/sparkh2o/installDrishti/elucideye/drishti/polly-master/utilities/../find;/home/sparkh2o/installDrishti/elucideye/drishti/polly-master/utilities <:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:<:
-- config.cmake --
  MSVC:
  APPLE:
  ANDROID:
  IOS:
  is_linux: 1
  XCODE:
is_linux =======================================================================
-- Found Git: /usr/bin/git (found version "2.7.4")
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] Using git executable: /usr/bin/git
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] Creating archive '/home/sparkh2o/installDrishti/elucideye/drishti/_builds/gcc-5-pic-hid-sections-lto-Release/_3rdParty/Hunter/git-archives/imshow.tar'
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] No SUBMODULE_SOURCE_SUBDIR specified, archive whole submodule
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] Locking directory: /home/sparkh2o/.hunter/_Base/c872605/f04654b/4fca926
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] Lock done
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] Locking directory: /home/sparkh2o/.hunter/_Base/c872605/f04654b/4fca926
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] Lock done
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] Config: /home/sparkh2o/.hunter/_Base/c872605/f04654b/4fca926/config.cmake
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] Config sha1: 4fca926eeb73638cde351959d31a919ab8915596
-- [hunter] HUNTER_ROOT: /home/sparkh2o/.hunter
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] HUNTER_TOOLCHAIN_ID_PATH: /home/sparkh2o/.hunter/_Base/c872605/f04654b
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] HUNTER_CONFIGURATION_TYPES: Release
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] HUNTER_BUILD_SHARED_LIBS:
-- [hunter] [ Hunter-ID: c872605 | Toolchain-ID: f04654b | Config-ID: 4fca926 ]
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] Locking directory: /home/sparkh2o/.hunter/_Base/c872605/f04654b/4fca926
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] Lock done
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] ABI forwarding: CMAKE_C_SIZEOF_DATA_PTR = 8
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] ABI forwarding: CMAKE_C_COMPILER_ABI = ELF
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] ABI forwarding: CMAKE_C_IMPLICIT_LINK_LIBRARIES = gcc;gcc_s;c;gcc;gcc_s
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] ABI forwarding: CMAKE_C_IMPLICIT_LINK_DIRECTORIES = /usr/lib/gcc/x86_64-linux-gnu/5;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] ABI forwarding: CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES =
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] ABI forwarding: CMAKE_C_LIBRARY_ARCHITECTURE = x86_64-linux-gnu
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] ABI forwarding: CMAKE_C_ABI_COMPILED = TRUE
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] ABI forwarding: CMAKE_CXX_SIZEOF_DATA_PTR = 8
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] ABI forwarding: CMAKE_CXX_COMPILER_ABI = ELF
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] ABI forwarding: CMAKE_CXX_IMPLICIT_LINK_LIBRARIES = stdc++;m;gcc_s;gcc;c;gcc_s;gcc
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] ABI forwarding: CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES = /usr/lib/gcc/x86_64-linux-gnu/5;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] ABI forwarding: CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES =
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] ABI forwarding: CMAKE_CXX_LIBRARY_ARCHITECTURE = x86_64-linux-gnu
-- [hunter *** DEBUG *** 2017-10-09T17:43:03] ABI forwarding: CMAKE_CXX_ABI_COMPILED = TRUE
-- [hunter *** DEBUG *** 2017-10-09T17:43:04] load: /home/sparkh2o/.hunter/_Base/Download/Hunter/0.19.116/c872605/Unpacked/cmake/projects/gauze/hunter.cmake
-- [hunter *** DEBUG *** 2017-10-09T17:43:04] gauze versions available: [0.1.0;0.1.1]
-- [hunter *** DEBUG *** 2017-10-09T17:43:04] Install to: /home/sparkh2o/.hunter/_Base/c872605/f04654b/4fca926/Install
-- [hunter] GAUZE_ROOT: /home/sparkh2o/.hunter/_Base/c872605/f04654b/4fca926/Install (ver.: 0.1.1)
-- [hunter *** DEBUG *** 2017-10-09T17:43:04] Default arguments: GAUZE_BUILD_TESTS=OFF
-- [hunter *** DEBUG *** 2017-10-09T17:43:04] User arguments:
-- [hunter *** DEBUG *** 2017-10-09T17:43:04] Locking directory: /home/sparkh2o/.hunter/_Base/Download/gauze/0.1.1/4993b09
-- [hunter *** DEBUG *** 2017-10-09T17:43:04] Lock done
-- [hunter *** DEBUG *** 2017-10-09T17:43:04] Already locked: /home/sparkh2o/.hunter/_Base/Download/gauze/0.1.1/4993b09
-- [hunter *** DEBUG *** 2017-10-09T17:43:04] Locking directory: /home/sparkh2o/.hunter/_Base/c872605/f04654b/4fca926
-- [hunter *** DEBUG *** 2017-10-09T17:43:04] Lock done
-- [hunter *** DEBUG *** 2017-10-09T17:43:04] Add extra CMake args: 'GAUZE_BUILD_TESTS' = 'OFF'
-- [hunter *** DEBUG *** 2017-10-09T17:43:04] Locking directory: /home/sparkh2o/.hunter/_Base/Cache
-- [hunter *** DEBUG *** 2017-10-09T17:43:04] Lock done
-- [hunter *** DEBUG *** 2017-10-09T17:43:04] Downloading file (try #0 of 10):
-- [hunter *** DEBUG *** 2017-10-09T17:43:04]   https://raw.githubusercontent.com/elucideye/hunter-cache/master/f04654b/gauze/0.1.1/4993b09/34ce655/d41f56c/da39a3e/basic-deps.DONE
-- [hunter *** DEBUG *** 2017-10-09T17:43:04]   -> /home/sparkh2o/.hunter/_Base/Cache/meta/f04654b/gauze/0.1.1/4993b09/34ce655/d41f56c/da39a3e/basic-deps.DONE
-- [hunter *** DEBUG *** 2017-10-09T17:43:04] File not found
-- [hunter *** DEBUG *** 2017-10-09T17:43:04] Downloading file (try #0 of 10):
-- [hunter *** DEBUG *** 2017-10-09T17:43:04]   https://raw.githubusercontent.com/ingenue/hunter-cache/master/f04654b/gauze/0.1.1/4993b09/34ce655/d41f56c/da39a3e/basic-deps.DONE
-- [hunter *** DEBUG *** 2017-10-09T17:43:04]   -> /home/sparkh2o/.hunter/_Base/Cache/meta/f04654b/gauze/0.1.1/4993b09/34ce655/d41f56c/da39a3e/basic-deps.DONE
-- [hunter *** DEBUG *** 2017-10-09T17:43:05] File not found
-- [hunter *** DEBUG *** 2017-10-09T17:43:05] Downloading file (try #1 of 10):
-- [hunter *** DEBUG *** 2017-10-09T17:43:05]   https://raw.githubusercontent.com/elucideye/hunter-cache/master/f04654b/gauze/0.1.1/4993b09/34ce655/d41f56c/da39a3e/basic-deps.DONE
-- [hunter *** DEBUG *** 2017-10-09T17:43:05]   -> /home/sparkh2o/.hunter/_Base/Cache/meta/f04654b/gauze/0.1.1/4993b09/34ce655/d41f56c/da39a3e/basic-deps.DONE
-- [hunter *** DEBUG *** 2017-10-09T17:43:05] File not found
-- [hunter *** DEBUG *** 2017-10-09T17:43:05] Downloading file (try #1 of 10):
-- [hunter *** DEBUG *** 2017-10-09T17:43:05]   https://raw.githubusercontent.com/ingenue/hunter-cache/master/f04654b/gauze/0.1.1/4993b09/34ce655/d41f56c/da39a3e/basic-deps.DONE
-- [hunter *** DEBUG *** 2017-10-09T17:43:05]   -> /home/sparkh2o/.hunter/_Base/Cache/meta/f04654b/gauze/0.1.1/4993b09/34ce655/d41f56c/da39a3e/basic-deps.DONE
-- [hunter *** DEBUG *** 2017-10-09T17:43:06] File not found
-- [hunter *** DEBUG *** 2017-10-09T17:43:06] Downloading file (try #2 of 10):
-- [hunter *** DEBUG *** 2017-10-09T17:43:06]   https://raw.githubusercontent.com/elucideye/hunter-cache/master/f04654b/gauze/0.1.1/4993b09/34ce655/d41f56c/da39a3e/basic-deps.DONE
-- [hunter *** DEBUG *** 2017-10-09T17:43:06]   -> /home/sparkh2o/.hunter/_Base/Cache/meta/f04654b/gauze/0.1.1/4993b09/34ce655/d41f56c/da39a3e/basic-deps.DONE
-- [hunter *** DEBUG *** 2017-10-09T17:43:06] Retry after 5 seconds (attempt #2) ...
-- [hunter *** DEBUG *** 2017-10-09T17:43:11] File not found
-- [hunter *** DEBUG *** 2017-10-09T17:43:11] Downloading file (try #2 of 10):
-- [hunter *** DEBUG *** 2017-10-09T17:43:11]   https://raw.githubusercontent.com/ingenue/hunter-cache/master/f04654b/gauze/0.1.1/4993b09/34ce655/d41f56c/da39a3e/basic-deps.DONE
-- [hunter *** DEBUG *** 2017-10-09T17:43:11]   -> /home/sparkh2o/.hunter/_Base/Cache/meta/f04654b/gauze/0.1.1/4993b09/34ce655/d41f56c/da39a3e/basic-deps.DONE
-- [hunter *** DEBUG *** 2017-10-09T17:43:11] Retry after 5 seconds (attempt #2) ...
-- [hunter *** DEBUG *** 2017-10-09T17:43:17] File not found
-- [hunter *** DEBUG *** 2017-10-09T17:43:17] Downloading file (try #3 of 10):
-- [hunter *** DEBUG *** 2017-10-09T17:43:17]   https://raw.githubusercontent.com/elucideye/hunter-cache/master/f04654b/gauze/0.1.1/4993b09/34ce655/d41f56c/da39a3e/basic-deps.DONE
-- [hunter *** DEBUG *** 2017-10-09T17:43:17]   -> /home/sparkh2o/.hunter/_Base/Cache/meta/f04654b/gauze/0.1.1/4993b09/34ce655/d41f56c/da39a3e/basic-deps.DONE
-- [hunter *** DEBUG *** 2017-10-09T17:43:17] Retry after 5 seconds (attempt #3) ...
-- [hunter *** DEBUG *** 2017-10-09T17:43:22] File not found
-- [hunter *** DEBUG *** 2017-10-09T17:43:22] Downloading file (try #3 of 10):
-- [hunter *** DEBUG *** 2017-10-09T17:43:22]   https://raw.githubusercontent.com/ingenue/hunter-cache/master/f04654b/gauze/0.1.1/4993b09/34ce655/d41f56c/da39a3e/basic-deps.DONE
-- [hunter *** DEBUG *** 2017-10-09T17:43:22]   -> /home/sparkh2o/.hunter/_Base/Cache/meta/f04654b/gauze/0.1.1/4993b09/34ce655/d41f56c/da39a3e/basic-deps.DONE
-- [hunter *** DEBUG *** 2017-10-09T17:43:22] Retry after 5 seconds (attempt #3) ...
-- [hunter *** DEBUG *** 2017-10-09T17:43:28] File not found
-- [hunter *** DEBUG *** 2017-10-09T17:43:28] Cache miss (no basic dependencies info found: /home/sparkh2o/.hunter/_Base/Cache/meta/f04654b/gauze/0.1.1/4993b09/34ce655/d41f56c/da39a3e/basic-deps.DONE)
-- [hunter *** DEBUG *** 2017-10-09T17:43:28] Number of logical cores per physical core: 4
-- [hunter *** DEBUG *** 2017-10-09T17:43:28] Number of physical cores: 4
-- [hunter *** DEBUG *** 2017-10-09T17:43:28] Total number of cores: 16
-- [hunter *** DEBUG *** 2017-10-09T17:43:28] HUNTER_JOBS_NUMBER:
-- [hunter *** DEBUG *** 2017-10-09T17:43:28] HUNTER_JOBS_OPTION: 16
-- [hunter *** DEBUG *** 2017-10-09T17:43:28] Add package: gauze
-- [hunter *** DEBUG *** 2017-10-09T17:43:28] Download scheme: url_sha1_cmake
-- [hunter *** DEBUG *** 2017-10-09T17:43:28] Url: https://github.com/hunter-packages/gauze/archive/v0.1.1.tar.gz
-- [hunter *** DEBUG *** 2017-10-09T17:43:28] SHA1: 4993b09855e51047ea51136a05fcd6d0216f2716

[hunter ** FATAL ERROR **] Building package from source is disabled (dir: /home/sparkh2o/.hunter/_Base/c872605/f04654b/4fca926/Build/gauze)
[hunter ** FATAL ERROR **] [Directory:/home/sparkh2o/.hunter/_Base/Download/Hunter/0.19.116/c872605/Unpacked/cmake/projects/gauze]

------------------------------ WIKI -------------------------------
    https://github.com/ruslo/hunter/wiki/error.build.disabled
-------------------------------------------------------------------

CMake Error at /home/sparkh2o/.hunter/_Base/Download/Hunter/0.19.116/c872605/Unpacked/cmake/modules/hunter_wiki.cmake:12 (message):
Call Stack (most recent call first):
  /home/sparkh2o/.hunter/_Base/Download/Hunter/0.19.116/c872605/Unpacked/cmake/modules/hunter_fatal_error.cmake:20 (hunter_wiki)
  /home/sparkh2o/.hunter/_Base/Download/Hunter/0.19.116/c872605/Unpacked/cmake/modules/hunter_download.cmake:530 (hunter_fatal_error)
  /home/sparkh2o/.hunter/_Base/Download/Hunter/0.19.116/c872605/Unpacked/cmake/projects/gauze/hunter.cmake:37 (hunter_download)
  /home/sparkh2o/.hunter/_Base/Download/Hunter/0.19.116/c872605/Unpacked/cmake/modules/hunter_add_package.cmake:53 (include)
  CMakeLists.txt:270 (hunter_add_package)

-- [hunter *** DEBUG *** 2017-10-09T17:43:28] Configuration types: Release
-- [hunter *** DEBUG *** 2017-10-09T17:43:28] Scheme file used: /home/sparkh2o/.hunter/_Base/Download/Hunter/0.19.116/c872605/Unpacked/cmake/schemes/url_sha1_cmake.cmake.in
-- [hunter] Building gauze
-- Configuring incomplete, errors occurred!
See also "/home/sparkh2o/installDrishti/elucideye/drishti/_builds/gcc-5-pic-hid-sections-lto-Release/CMakeFiles/CMakeOutput.log".

I got same error for the option HUNTER_DISABLE_BUILDS equals to YES and NO just added one log here.

ruslo commented 7 years ago

Those one used for CI optimization:

No need to use them while building locally.

You can find some info here:

mlb5000 commented 7 years ago

@ruslo I was getting the exact same failure on the gauze/0.1.1 dependency from the ingenue hunter cache. Turns out those options you called out were in my build script (taken from appveyor.yml)

export CONFIG=MinSizeRel
export TOOLCHAIN=ios-nocodesign-11-0-dep-9-0-bitcode-cxx11
export INSTALL=--install

git submodule update --init --recursive --quiet
wget https://github.com/ruslo/polly/archive/master.zip
unzip -o master.zip
POLLY_ROOT="`pwd`/polly-master"
export PATH="${POLLY_ROOT}/bin:${PATH}"
install-ci-dependencies.py
export PATH="`pwd`/_ci/cmake/bin:${PATH}"
export ANDROID_NDK_r10e="`pwd`/_ci/android-ndk-r10e"

polly.py --toolchain ${TOOLCHAIN} --config ${CONFIG} --verbose --ios-multiarch --ios-combined --fwd DRISHTI_BUILD_REGRESSION_SIMD=NO DRISHTI_BUILD_REGRESSION_FIXED_POINT=NO DRISHTI_BUILD_TESTS=YES DRISHTI_BUILD_EXAMPLES=YES DRISHTI_COPY_3RDPARTY_LICENSES=ON GAUZE_ANDROID_USE_EMULATOR=YES HUNTER_CONFIGURATION_TYPES=${CONFIG} --archive drishti --jobs 2 --test ${INSTALL}

For someone with absolutely no knowledge of Hunter, and who hasn't used cmake in 5+ years the curve to just getting this to build was mildly excessive. Part of the issue was the Git checkout not pulling submodules as mentioned above, but I only discovered that after reading the CI scripts and looking at the CMakeLists. Having a simple build script like this one for people to build locally would probably be a good addition for people looking into using this.

It's probably also worth noting that depending on which version of XCode you have installed you may need to change TOOLCHAIN to target the proper SDK. The Polly Toolchain wiki page removed all mention of iOS for some reason so it was a little hard to figure out exactly what was going on.

mlb5000 commented 7 years ago

@ruslo After building with that new toolchain all the tests fail. What should I do to get the tests to run successfully?

UpdateCTestConfiguration  from :/Users/matthewbaker/Documents/Projects/drishti/_builds/ios-nocodesign-11-0-dep-9-0-bitcode-cxx11/DartConfiguration.tcl
UpdateCTestConfiguration  from :/Users/matthewbaker/Documents/Projects/drishti/_builds/ios-nocodesign-11-0-dep-9-0-bitcode-cxx11/DartConfiguration.tcl
Test project /Users/matthewbaker/Documents/Projects/drishti/_builds/ios-nocodesign-11-0-dep-9-0-bitcode-cxx11
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 1
      Start  1: DrishtiCoreTest

1: Test command: /Users/matthewbaker/Documents/Projects/drishti/_ci/cmake/bin/cmake "-DAPP_SOURCE=/Users/matthewbaker/Documents/Projects/drishti/_builds/ios-nocodesign-11-0-dep-9-0-bitcode-cxx11/src/lib/drishti/core/ut/MinSizeRel${EFFECTIVE_PLATFORM_NAME}/test-drishti-core.app/test-drishti-core" "-P" "/Users/matthewbaker/Documents/Projects/drishti/_builds/ios-nocodesign-11-0-dep-9-0-bitcode-cxx11/src/lib/drishti/core/ut/_3rdParty/gauze_test/DrishtiCoreTest.cmake"
1: Test timeout computed to be: 9.99988e+06
1: Test that iOS device is connected
1: > ios-deploy --no-wifi --detect
1: Result: No such file or directory
1: Output:
1: *** BEGIN ***
1:
1: *** END ***
1: CMake Error at _3rdParty/gauze_test/DrishtiCoreTest.cmake:47 (message):
1:   Command failed
1: Call Stack (most recent call first):
1:   _3rdParty/gauze_test/DrishtiCoreTest.cmake:79 (run_cmd)
1:
1:
 1/11 Test  #1: DrishtiCoreTest ..................***Failed    0.04 sec
headupinclouds commented 7 years ago

After building with that new toolchain all the tests fail. What should I do to get the tests to run successfully?

On iOS platforms, the tests must be run on a physical device, which has to be tethered to the host machine. From the error message, it looks like you don't have an iOS device connected. You can also skip the tests by removing --test from your build command. (The Android SDK has a QEMU emulator mode, so you can run the tests w/ GLSL shaders on your host machine without a device.)

ruslo commented 7 years ago

For someone with absolutely no knowledge of Hunter, and who hasn't used cmake in 5+ years the curve to just getting this to build was mildly excessive.

It's probably also worth noting that depending on which version of XCode you have installed you may need to change TOOLCHAIN to target the proper SDK. The Polly Toolchain wiki page removed all mention of iOS for some reason so it was a little hard to figure out exactly what was going on.

@mlb5000 Projects mentioned here are open source. Fixes/improvements are welcome:

headupinclouds commented 7 years ago

Having a simple build script like this one for people to build locally would probably be a good addition for people looking into using this.

@mlb5000 : I agree with that. We can refactor the CI scripts into a polly_cmake_setup_ci.{sh,cmd} configuration for a sandboxed CMake + Polly environment (something that can be sourced from a .bashrc or similar for PATH setup to demonstrate one possible working setup), and a drishti_build_ci.{sh,cmd} script for building (tab based autocompletion to enforce validTOOLCHAIN, CONFIG and INSTALL would be nice). The polly_cmake_setup.{sh,cmd} would essentially contain the before_install: and install: sections from .travis.yml (and similar for appveyor.yml) as you have sketched in your script.

As a starting point...

This script is currently used for the appveyor CI build step: https://github.com/elucideye/drishti/blob/master/bin/build-appveyor.cmd

This ones mimics the travis build: https://github.com/elucideye/drishti/blob/master/bin/build-travis.sh

We can adapt it for use in .travis.yml.

CMake and Hunter (w/ Polly) do add some complexity (compared to Visual Studio, Android Studio, or Xcode projects), but I find the tools incredibly useful for multi-platform builds. Perhaps a few notes describing the tools (and high level CMake build philosophy) in the README could help in combination with the refactored CI script. I'll try to add something this week.

mlb5000 commented 7 years ago

@ruslo Rereading what I wrote it was unintentionally harsh, I was just in a hurry. Mostly I was just suggesting having a handful of easy to follow steps for building locally for my target platform would be welcome, as well as additional steps for test support, etc. There were several things I only discovered I needed, how they were needed, and where they should reside, once I read the CI scripts.

@headupinclouds OK I fixed that part (needed this: https://gauze.readthedocs.io/en/latest/prereq/ios.html). Then they all failed with this error:

11: 2017-10-10 10:22:33.601 ios-deploy[51665:416160] [ !! ] Error 0xe800801c: No code signature found. AMDeviceSecureInstallApplication(0, device, url, options, install_callback, 0)

Then I removed -nocodesign from the toolchain (since all code deployed to iOS must be signed) and now it's at least trying to run the tests on device. I'm mostly just writing this out so I can document it a little later.

headupinclouds commented 7 years ago

@mlb5000 : I always use the standard code signing toolchain version for iOS builds. When I'm building drishti on iOS w/ the optional QT facefilter application (real time demo), I typically use this:

cd drishti
./bin/build-xcode-ios-dev.sh -o 

These are development scripts I maintain (my iPhone toolchain, etc), but it should serve as a starting point at least.

This requires a few variables to be configured.

Recent iOS projects require a development team to be set in the project, which can be provided (if using polly) with this variable:

export POLLY_IOS_DEVELOPMENT_TEAM="ABCD123456" # your id here

Additionally, the developer ID is needed (see the last argument):

COMMAND=(
    "--verbose --fwd "
    "${DRISHTI_BUILD_ARGS[*]} "
    "${DRISHTI_BUILD_HIDE[*]} "
    "${DRISHTI_BUILD_LOCAL[*]} "
    "CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET=9.0 "        
    "${DRISHTI_POLLY_ARGS[*]} "
    "--framework-device "
    "--framework-lib libdrishti.*"
    "--install "
    "--jobs 8 "
    "--plist \"${DRISHTISDK}/cmake/framework/Info.plist\" "
    "--identity \"${DRISHTISDK_IOS_IDENTITY}\" "    
)

That has the form:

export DRISHTISDK_IOS_IDENTITY="iPhone Developer: Your Name (QWERTY1234)"

I have these all in my ${HOME}/.profile:

export DRISHTISDK=${HOME}/path/to/drishti
export POLLY_IOS_DEVELOPMENT_TEAM="ABCD123456" # your id here
export DRISHTISDK_IOS_IDENTITY="iPhone Developer: Your Name (QWERTY1234)"

This might be a useful starting point for the device builds and tests.

mlb5000 commented 7 years ago

I removed --archive and added --framework to produce a framework file for iOS, but the build fails with:

Expected only one lib in directory: /Users/matthewbaker/Documents/Projects/drishti/_install/ios-11-0-dep-9-0-bitcode-cxx11/lib
But found: ['/Users/matthewbaker/Documents/Projects/drishti/_install/ios-11-0-dep-9-0-bitcode-cxx11/lib/libdrishti_world-MinSizeRel.a', '/Users/matthewbaker/Documents/Projects/drishti/_install/ios-11-0-dep-9-0-bitcode-cxx11/lib/libdrishti-MinSizeRel.a']

What is the supported way to generate a framework file?

headupinclouds commented 7 years ago

See the "--framework-lib libdrishti.*" polly.py option in the script above. If there is more than 1 library in the install folder lib directory you need to tell polly which one to use.

mlb5000 commented 7 years ago

@headupinclouds after updating the TOOLCHAIN argument to iOS 11 (specifically ios-11-0-dep-9-0-bitcode-cxx11) in build-xcode-ios-dev.sh and setting the proper environment variables I get the following error:

[hunter ** FATAL ERROR **] Broken package:  Some parts of Qt can't be built for armv7s. For example Qt Multimedia: https://bugreports.qt.io/browse/QTBUG-48805
[hunter ** FATAL ERROR **] [Directory:/Users/matthewbaker/.hunter/_Base/Download/Hunter/0.19.116/c872605/Unpacked/cmake/projects/Qt]

------------------------------ WIKI -------------------------------
    https://github.com/ruslo/hunter/wiki/error.broken.package
-------------------------------------------------------------------
headupinclouds commented 7 years ago

This is a known QT issue. You can modify your toolchain file to build for arm64 to avoid the issue (I believe Apple has dropped support for 32 bit architectures anyway). (Caveat: I've never compiled QT w/ a bitcode toolchain.) QT itself is fairly large and complex and has long build times, however, it provides a very nice C++ only application framework for write it once and run everywhere development. There is no actual QT dependency in the library itself. Note that the library has a minimal API layer in src/lib/drishti/drishti to avoid 3rdparty dependencies in the exported lib. That is the layer that is used for the iOS framework, for example. That supports the per eye crop model fitting (as in the batch processing tool drishti-eye src/app/eye). The face tracking (ACF detection, etc) has only recently been added to that layer and is still a WIP, but should be functional. I have a sample repository illustrating how to use drishti for end to end processing (including: face detection (ACF), landmarks (dlib) and eye model fitting) in an external project that I'll make available soon to help with this type of thing. This is still a WIP.

mlb5000 commented 7 years ago

It looks like that fails because bitcode toolchains build for all 3 architectures set(IPHONEOS_ARCHS armv7;armv7s;arm64). I modified that line in polly-master/ios-11-0-dep-9-0-bitcode-cxx11.cmake as a quick hack to see if I could get it to build that omitting armv7s. It's kind of annoying that the QT CMake scripts check the architecture limitations for QT as a whole, even though you guys are only integrating with qtbase.

It's still building. Has been for a couple hours now, lol

mlb5000 commented 7 years ago

@headupinclouds OK, I got it to build by omitting everything but amd64. It generated an xcodeproj file, which builds (after I updated the CMake Rules build phase to include POLLY_IOS_DEVELOPMENT_TEAM). What does that project actually generate? Is this a full sample app? If so how do I deploy it?

mlb5000 commented 7 years ago

@headupinclouds Update: GOT IT TO RUN! Just needed to set the target to facefilter.

Now the million dollar question. Any support for Gaze detection in here yet, and if not, any recommendation of which part of the library I should focus on to develop a really naive heuristic?

mlb5000 commented 7 years ago

@headupinclouds If I have generated the XCode project and gotten it to build, can I just take the built libdrishtisdkd.a and libdrishti_worldd.a files and use them in a new project? I only point those out because they're what facefilter links against.

Basically, I need just the core library (or .framework file if you can generate one) to integrate into a Swift app, and not the QT demo application. What is the supported way for producing that?

headupinclouds commented 7 years ago

Update: GOT IT TO RUN! Just needed to set the target to facefilter.

Glad to hear it. Be sure to set the facefilter scheme to Release mode (or a variant of it) in Xcode. SFML (instead of Qt) paired with a native mobile camera lib might be a good lightweight alternative to QT for a demo/test app.

Any support for Gaze detection in here yet

Not yet, but minimal calibration absolute gaze for mobile screens is a stretch goal: 2x2, 3x3 grid keypads, etc. I don't currently have a labeled dataset for this, but the SimGAN project in this issue might be workable to create some eye + gaze ground truth data: https://github.com/elucideye/drishti/issues/479#issuecomment-318902381. I'm not sure what your application is, but the current eye models are sufficient for some simple relative gaze approaches. You can register a listener in the high leveldrishti::hci::FaceFinder class as shown in this test:

https://github.com/elucideye/drishti/blob/ea74b892e1f57fc4c6b53dcc42d5d2bebcd38053/src/lib/drishti/hci/ut/test-FaceFinder.cpp#L196-L197

Where the callback would look something like this:

class YourFaceCallback : public drishti::hci::FaceMonitor
{
public:
    virtual Request request(const Faces& faces, const TimePoint& timeStamp)
    {
        for(const auto &f : faces)
        {
             if(f.eyeFullL->has && f.eyeFullR->has)
             {
                 std::array<cv::Point2f, 2> eyes {{ f.eyeFullL->irisEllipse.center, f.eyeFullR->irisEllipse.center }};
                 auto modelBasedGaze = yourGazeFunction(eyes); // some simple model based gaze

                 // Return a request (infrequently) for corresponding image data:
                 int frameCount = needFrames(f);
                 return Request {frameCount, true, true}; // request `frameCount` frames
             }
        }
    }
    virtual void grab(const std::vector<FaceImage>& frames, bool isInitialized)
    {
        auto imageBasedGaze = doFurtherGazeClassificationFromFramesIfRequestedAbove(frames);
    }
   // ...
};

That would be instantiated in the facefilter app for now. The classes mentioned above use the low level OpenCV based API, which is wrapped in a dependency free public API layer, which is currently exported by CMake (there are high level counterparts in src/lib/drishti/drishti for the framework). That layer is intended for dependency free shared library builds in projects without Hunter. Once drishti is added as a package to Hunter (for easier builds from source w/ package management) it will probably make sense to export the lower level OpenCV interface in the CMake build.

headupinclouds commented 7 years ago

Basically, I need just the core library (or .framework file if you can generate one) to integrate into a Swift app, and not the QT demo application. What is the supported way for producing that?

Completing the design and implementation of the library API is currently an open issue:

https://github.com/elucideye/drishti/issues/301

The discussion in the comment above should provide some background. The exported API layer, using a set of locally defined primitive types, is all contained in this directory:

https://github.com/elucideye/drishti/tree/master/src/lib/drishti/drishti

I would consider it a first draft, but it should have the necessary pieces required to instantiate and run face detection + landmarks and eye model regression. You can check the ut folder in that directory for some pointers.

See classes with DRISHTI_EXPORT in that folder. For example:

https://github.com/elucideye/drishti/blob/ea74b892e1f57fc4c6b53dcc42d5d2bebcd38053/src/lib/drishti/drishti/FaceTracker.hpp#L224

As you've noted, this is not the API that is currently used in the facefilter app. I have a separate sample project (not yet public) to test the Hunter integration which does use that API. I'm adding it primarily for testing Hunter packaging, but it will also be a useful reference for using the public API itself. I'll try to make the project available this weekend.

headupinclouds commented 7 years ago

You can generate an iOS framework using polly.py. It seems CMake may have added direct support for this recently. A script like this (untested) should be close to what you need:

cd drishti && ./bin/build-ios-full.sh

#!/bin/bash

. ${DRISHTISDK}/bin/build-common-devel.sh

TOOLCHAIN=ios-10-1-dep-8-0-libcxx-hid-sections

COMMANDS=(
    "--verbose --fwd "
    "${DRISHTI_BUILD_ARGS[*]} "
    "${DRISHTI_BUILD_HIDE[*]} "
    "CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET=8.0 "
    "${DRISHTI_POLLY_ARGS[*]} "    
    "--framework-device "
    "--ios-multiarch --ios-combined --archive drishti"
    "--install "
    "--jobs 8 "
    "--plist ${DRISHTISDK}/cmake/framework/Info.plist "
)

COMMAND+=( $(add_polly_commands "$@") )

polly.py --toolchain ${TOOLCHAIN} ${COMMANDS[*]} --identity "${DRISHTISDK_IOS_IDENTITY}"

You will need to set a few Xcode type variables as discussed in this issue:

https://github.com/elucideye/drishti/issues/574#issuecomment-335522781
headupinclouds commented 7 years ago

If I have generated the XCode project and gotten it to build, can I just take the built libdrishtisdkd.a and libdrishti_worldd.a files and use them in a new project

Not really. Those are the static OpenCV based API libraries (primarily). If you try to link to them without using Hunter, your app will be responsible for managing all of the dependencies. It isn't trivial and there are a few caveats. There is an open issue related to this feature here: https://github.com/ruslo/hunter/issues/274. It will be much easier to use those libs directly once drishti is added to Hunter. For your use case, I recommend using the exported public API layer as a shared library (or framework), so you won't have any dependencies to manage (the build script shown here https://github.com/elucideye/drishti/issues/574#issuecomment-335664959 should be a good starting point). This should all be more ironed out in a month or so, but if the lib seems close enough to what you need in the near term I think it should be manageable.

FWIW, the CMake + polly framework stuff is based on this minimal sample here: https://github.com/forexample/ios-dynamic-framework

mlb5000 commented 7 years ago

@headupinclouds this is extremely helpful, thanks. If I were to try to expose registerFaceMonitorCallback for the public Drishti framework, what all do you think that would entail?

headupinclouds commented 7 years ago

If I were to try to expose registerFaceMonitorCallback for the public Drishti framework

Actually, there is an initial version of this already. This file contains the public API related to face tracking:

https://github.com/elucideye/drishti/blob/master/src/lib/drishti/drishti/FaceTracker.hpp

It is geared towards a minimal extern "C" interface for a small final SDK size.

This unit test more or less demonstrates how to use that API:

https://github.com/elucideye/drishti/blob/master/src/lib/drishti/drishti/ut/test-FaceTracker.cpp

The basic approach is to register a callback to receive face+eye model updates in real time, where a history of corresponding frames (GPU->CPU) can be requested by a return argument that will trigger a second callback with the frames (images and/or textures). In order to simplify things, there is no dynamically allocated memory that crosses that API layer, so the returned images are shallow copies -- you will have to clone any images if you want to keep a hold of them. That code also illustrates how to configure state for the tracking pipeline. The one with the most gotchas is probably the OpenGL context. Drishti uses OpenGL via ogles_gpgpu (kind of a subset of GPUImage in C++) to load frames to textures efficiently and to compute the ACF pyramids in shaders in real time for mobile friendly face detection.

headupinclouds commented 7 years ago

@mlb5000 , @emreaslan : I've refactored the CI build scripts a little to make the local build process a little easier. There are now hunter_env.{cmd, sh} scripts that can be used to replicate the CI environment setup (CMake + Polly) on a local host and bin/drishti_build.{sh, cmd} scripts that can be used to replicate the CI drishti configuration for a specified TOOLCHAIN and CONFIG (Release,Debug,..) on both Linux/OSX and Windows hosts. I've also added an initial "Quick Start" section to the README to provide some initial high level CMake + Hunter notes, and to walk through how one can replicate the CI build process on a local host. Some additional notes regarding end project library integration with and without Hunter will be added at some point. I hope this helps.

emreaslan commented 7 years ago

Dear @ruslo and @headupinclouds,

I really thank you for your help. I achieved to compile library and now I have drishti-acf, drishti-acf-mat2cpb, drishti-eye, drishti-eye-serialize, drishti-eyexml, drishti-face, drishti-facecrop, drishti-facexml, drishti-fddb, drishti-hci, drishti_test_shape_predictor programs in _install/gcc-5-pic-hid-sections-lto/bin/ directory.

Unfortunately, I don't know how to use them. How can I use these programs for eye segmentation or eye detection? Are there any references or examples if there are I would be very grateful if you could share with me.

Kindest regards

headupinclouds commented 7 years ago

@emreaslan : Glad the docs helped. I'll try to add a README for the console apps in the next few days. Thanks for sticking with it while this is still under construction. For now, you can take a look at the individual module unit tests, which should provide some hints for using the command line tools:

https://github.com/elucideye/drishti/blob/master/src/lib/drishti/{eye,face}/ut/*

These will run automatically when you specify --test on the polly.py command line.

headupinclouds commented 6 years ago

UPDATE: Readme added for drishti-hci console app here https://github.com/elucideye/drishti/tree/master/src/app/hci

alexandrakl commented 6 years ago

@mlb5000 Hi Matthew, I am sharing your goal of "I need just the core library (or .framework file if you can generate one) to integrate into a Swift app"...HAVE you had any success with working the public API layer? Could you please provide your steps if so, in order for others to replicate? :) Would be much appreciated!

headupinclouds commented 6 years ago

The drishti_hunter_test project is currently using the drishti package (and the current public API) through hunter, with a sample shown here: https://github.com/elucideye/drishti_hunter_test/blob/master/src/app/face/drishti-face-test.cpp

If you pass a --framework option to polly (and you are installing a single shared library) it will create a framework for you. If you are installing multiple libraries you can use --framework-lib <PATTERN> to select which of the installed libraries you want to build a framework for.

See:

  --framework           Create framework
  --framework-device    Create framework for device (exclude simulator
                        architectures)
  --framework-lib FRAMEWORK_LIB
                        Regular expression for the source library used for
                        --framework

For iOS, you can add --framework-lib libdrishti.* and a framework will be created in the _framework folder, like: drishti/_framework/ios-10-0-arm64/drishti.framework or similar based on our active toolchain.

I'm a little busy this week, but will try to add a some kind of framework specific usage example soon.

alexandrakl commented 6 years ago

So it's the same ENV vars and polly command from before, just with "dash framework"? Would --framework-lib libdrishti.* add all the modules in /lib/drishti/drishti that don't need dependencies and allow me to recreate FaceTracker.hpp with Obj-C++ ? The goal is to have a scrollbar with some images along the bottom of the screen and tap to spread the image as a layover on top of the landmarks detected in realtime by Drishti (mouth for instance).

headupinclouds commented 6 years ago

Would --framework-lib libdrishti.* add all the modules in /lib/drishti/drishti that don't need dependencies and allow me to recreate FaceTracker.hpp with Obj-C++

If you build as a shared library, yes. You could set DRISHTI_BUILD_SHARED_SDK=ON from the command line. In polly it would be another forwarded option--fwd DRISHTI_BUILD_SHARED_SDK=ON. That will create a single target that absorbs all of the dependencies, but you have to set the paths correctly in xcode.

I would recommend experimenting first with this minimal example/tutorial:

https://github.com/forexample/ios-dynamic-framework


I find it is easier just to build the entire iOS application from CMake. That way you can use the automated package management and static libraries (+ transitive dependencies) are linked directly in the app.