From fc6d35998da5d2153fc0705f9ee74dd6fd4931cd Mon Sep 17 00:00:00 2001 From: gineshidalgo99 Date: Thu, 10 Jan 2019 20:01:26 -0500 Subject: [PATCH] Renamed openpose_caffe as openpose in CMake --- CMakeLists.txt | 8 +- cmake/Cuda.cmake | 44 ++++++--- doc/installation.md | 2 +- examples/calibration/CMakeLists.txt | 2 +- examples/openpose/CMakeLists.txt | 2 +- examples/tests/CMakeLists.txt | 2 +- examples/tutorial_add_module/CMakeLists.txt | 2 +- examples/tutorial_api_cpp/CMakeLists.txt | 2 +- examples/tutorial_developer/CMakeLists.txt | 2 +- examples/user_code/CMakeLists.txt | 2 +- scripts/travis/run_tests.sh | 2 +- scripts/ubuntu/install_ubuntu_deps.sh | 2 + .../Makefile.config.Ubuntu14_cuda7.example | 2 + .../Makefile.config.Ubuntu16_cuda10.example | 92 +++++++++++++++++++ .../Makefile.config.Ubuntu16_cuda8.example | 15 +-- .../Makefile.config.Ubuntu16_cuda9.example | 91 ++++++++++++++++++ src/openpose/3d/CMakeLists.txt | 2 +- src/openpose/CMakeLists.txt | 30 +++--- src/openpose/calibration/CMakeLists.txt | 2 +- src/openpose/core/CMakeLists.txt | 2 +- src/openpose/face/CMakeLists.txt | 2 +- src/openpose/hand/CMakeLists.txt | 2 +- src/openpose/net/CMakeLists.txt | 2 +- src/openpose/pose/CMakeLists.txt | 2 +- src/openpose/producer/producer.cpp | 5 +- 25 files changed, 261 insertions(+), 60 deletions(-) create mode 100644 scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda10.example create mode 100644 scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda9.example diff --git a/CMakeLists.txt b/CMakeLists.txt index cf81a741..da213048 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -700,7 +700,7 @@ if (UNIX OR APPLE) # One for Intel Branch and one for Master if (USE_MKL) - ExternalProject_Add(openpose_caffe + ExternalProject_Add(openpose SOURCE_DIR ${CAFFE_URL} PREFIX ${CAFFE_PREFIX} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH= @@ -720,7 +720,7 @@ if (UNIX OR APPLE) -DUSE_OPENCV=OFF) # -DOpenCV_DIR=${OpenCV_DIR}) else (USE_MKL) - ExternalProject_Add(openpose_caffe + ExternalProject_Add(openpose SOURCE_DIR ${CAFFE_URL} PREFIX ${CAFFE_PREFIX} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH= @@ -739,10 +739,10 @@ if (UNIX OR APPLE) # -DOpenCV_DIR=${OpenCV_DIR}) endif (USE_MKL) - ExternalProject_Get_Property(openpose_caffe install_dir) + ExternalProject_Get_Property(openpose install_dir) if (NOT Caffe_FOUND) - add_custom_command(TARGET openpose_caffe + add_custom_command(TARGET openpose POST_BUILD COMMAND ${CMAKE_COMMAND} ${CMAKE_SOURCE_DIR} COMMAND $(MAKE) diff --git a/cmake/Cuda.cmake b/cmake/Cuda.cmake index e588ea3b..2575e9c3 100644 --- a/cmake/Cuda.cmake +++ b/cmake/Cuda.cmake @@ -1,5 +1,8 @@ # Copied from Caffe +# More info on available architectures vs. CUDA version: +# http://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/ + if (CPU_ONLY) return() endif () @@ -17,11 +20,24 @@ macro(op_list_unique) endmacro() # This list will be used for CUDA_ARCH = All option +# Fermi (3.2 <= CUDA <= 8) +set(FERMI "20 21(20)") +# Kepler (CUDA >= 5) +set(KEPLER "30 35 37") +# Maxwell (CUDA >= 6) +set(MAXWELL "50 52 53") +# Pascal (CUDA >= 8) +set(PASCAL "60 61 62") +# Volta (CUDA >= 9) +set(VOLTA "70 71 72") +# Turing (CUDA >= 10) +set(TURING "75") if (UNIX AND NOT APPLE) - set(Caffe_known_gpu_archs "30 35 50 52 60 61") + set(Caffe_known_gpu_archs "${KEPLER} ${MAXWELL} ${PASCAL} ${VOLTA} ${TURING}") + # set(Caffe_known_gpu_archs "${FERMI} ${KEPLER} ${MAXWELL} ${PASCAL} ${VOLTA} ${TURING}") # set(Caffe_known_gpu_archs "20 21(20) 30 35 50 52 60 61") elseif (WIN32) - set(Caffe_known_gpu_archs "30 35 50 52 60 61") + set(Caffe_known_gpu_archs "${KEPLER} ${MAXWELL} ${PASCAL} ${VOLTA} ${TURING}") endif () @@ -77,8 +93,8 @@ endfunction() # op_select_nvcc_arch_flags(out_variable) function(op_select_nvcc_arch_flags out_variable) # List of arch names - set(__archs_names "Kepler" "Maxwell" "Pascal" "All" "Manual") - # set(__archs_names "Fermi" "Kepler" "Maxwell" "Pascal" "All" "Manual") + set(__archs_names "Kepler (CUDA >= 5)" "Maxwell (CUDA >= 6)" "Pascal (CUDA >= 8)" "Volta (CUDA >= 9)" "Turing (CUDA >= 10)" "All" "Manual") + # set(__archs_names "Fermi (3.2 <= CUDA <= 8)" "Kepler (CUDA >= 5)" "Maxwell (CUDA >= 6)" "Pascal (CUDA >= 8)" "Volta (CUDA >= 9)" "Turing (CUDA >= 10)" "All" "Manual") set(__archs_name_default "All") if (NOT CMAKE_CROSSCOMPILING) list(APPEND __archs_names "Auto") @@ -105,14 +121,18 @@ function(op_select_nvcc_arch_flags out_variable) unset(CUDA_ARCH_PTX CACHE) endif () - if (${CUDA_ARCH} STREQUAL "Fermi" AND NOT WIN32) - set(__cuda_arch_bin "20 21(20)") - elseif (${CUDA_ARCH} STREQUAL "Kepler") - set(__cuda_arch_bin "30 35") - elseif (${CUDA_ARCH} STREQUAL "Maxwell") - set(__cuda_arch_bin "50 52") - elseif (${CUDA_ARCH} STREQUAL "Pascal") - set(__cuda_arch_bin "60 61") + if (${CUDA_ARCH} STREQUAL "Fermi (3.2 <= CUDA <= 8)" AND NOT WIN32) + set(__cuda_arch_bin ${FERMI}) + elseif (${CUDA_ARCH} STREQUAL "Kepler (CUDA >= 5)") + set(__cuda_arch_bin ${KEPLER}) + elseif (${CUDA_ARCH} STREQUAL "Maxwell (CUDA >= 6)") + set(__cuda_arch_bin ${MAXWELL}) + elseif (${CUDA_ARCH} STREQUAL "Pascal (CUDA >= 8)") + set(__cuda_arch_bin ${PASCAL}) + elseif (${CUDA_ARCH} STREQUAL "Volta (CUDA >= 9)") + set(__cuda_arch_bin ${VOLTA}) + elseif (${CUDA_ARCH} STREQUAL "Turing (CUDA >= 10)") + set(__cuda_arch_bin ${TURING}) elseif (${CUDA_ARCH} STREQUAL "All") set(__cuda_arch_bin ${Caffe_known_gpu_archs}) elseif (${CUDA_ARCH} STREQUAL "Auto") diff --git a/doc/installation.md b/doc/installation.md index 712e43eb..fe224140 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -140,7 +140,7 @@ Any problem installing OpenPose? Check [doc/faq.md](./faq.md) and/or post a GitH 3. Ubuntu only: Install `sudo apt-get install libviennacl-dev`. This comes packaged inside OpenPose for Windows. 4. AMD Drivers have not been tested on OSX. Please email us if you wish to test it. This has only been tested on Vega series cards. 6. Ubuntu - Other prerequisites: - - Caffe prerequisites: By default, OpenPose uses Caffe under the hood. If you have not used Caffe previously, install its dependencies by running `sudo bash ./3rdparty/scripts/ubuntu/install_ubuntu_deps_and_cuda.sh` (if Ubuntu 16 or 14 and for Graphic cards up to 10XX) or run `sudo bash ./3rdparty/scripts/ubuntu/install_ubuntu_deps.sh` after installing your desired CUDA and cuDNN versions. + - Caffe prerequisites: By default, OpenPose uses Caffe under the hood. If you have not used Caffe previously, install its dependencies by running `sudo bash ./scripts/ubuntu/install_ubuntu_deps_and_cuda.sh` (if Ubuntu 16 or 14 and for Graphic cards up to 10XX) or run `sudo bash ./scripts/ubuntu/install_ubuntu_deps.sh` after installing your desired CUDA and cuDNN versions. - OpenCV must be already installed on your machine. It can be installed with `apt-get install libopencv-dev`. You can also use your own compiled OpenCV version. 7. Windows - **Caffe, OpenCV, and Caffe prerequisites**: - CMake automatically downloads all the Windows DLLs. Alternatively, you might prefer to download them manually: diff --git a/examples/calibration/CMakeLists.txt b/examples/calibration/CMakeLists.txt index bb19ea5d..3e634b55 100644 --- a/examples/calibration/CMakeLists.txt +++ b/examples/calibration/CMakeLists.txt @@ -13,7 +13,7 @@ foreach(EXAMPLE_FILE ${EXAMPLE_FILES}) message(STATUS "Adding Example ${EXE_NAME}") add_executable(${EXE_NAME} ${EXAMPLE_FILE}) - target_link_libraries(${EXE_NAME} openpose ${examples_3rdparty_libraries}) + target_link_libraries(${EXE_NAME} openpose_src ${examples_3rdparty_libraries}) if (WIN32) set_property(TARGET ${EXE_NAME} PROPERTY FOLDER "Examples") diff --git a/examples/openpose/CMakeLists.txt b/examples/openpose/CMakeLists.txt index 8f1d87c4..bca54515 100644 --- a/examples/openpose/CMakeLists.txt +++ b/examples/openpose/CMakeLists.txt @@ -13,7 +13,7 @@ foreach(EXAMPLE_FILE ${EXAMPLE_FILES}) message(STATUS "Adding Example ${EXE_NAME}") add_executable(${EXE_NAME} ${EXAMPLE_FILE}) - target_link_libraries(${EXE_NAME} openpose ${examples_3rdparty_libraries}) + target_link_libraries(${EXE_NAME} openpose_src ${examples_3rdparty_libraries}) if (WIN32) set_property(TARGET ${EXE_NAME} PROPERTY FOLDER "Examples") diff --git a/examples/tests/CMakeLists.txt b/examples/tests/CMakeLists.txt index 748b36d3..5ae290ff 100644 --- a/examples/tests/CMakeLists.txt +++ b/examples/tests/CMakeLists.txt @@ -14,7 +14,7 @@ foreach(EXAMPLE_FILE ${EXAMPLE_FILES}) message(STATUS "Adding Example ${EXE_NAME}") add_executable(${EXE_NAME} ${EXAMPLE_FILE}) - target_link_libraries(${EXE_NAME} openpose ${examples_3rdparty_libraries}) + target_link_libraries(${EXE_NAME} openpose_src ${examples_3rdparty_libraries}) if (WIN32) set_property(TARGET ${EXE_NAME} PROPERTY FOLDER "Examples/Tutorial/Tests") diff --git a/examples/tutorial_add_module/CMakeLists.txt b/examples/tutorial_add_module/CMakeLists.txt index 9388ab02..90a62e43 100644 --- a/examples/tutorial_add_module/CMakeLists.txt +++ b/examples/tutorial_add_module/CMakeLists.txt @@ -15,7 +15,7 @@ foreach(EXAMPLE_FILE ${EXAMPLE_FILES}) message(STATUS "Adding Example ${EXE_NAME}") add_executable(${EXE_NAME} ${EXAMPLE_FILE}) - target_link_libraries(${EXE_NAME} openpose ${examples_3rdparty_libraries}) + target_link_libraries(${EXE_NAME} openpose_src ${examples_3rdparty_libraries}) if (WIN32) set_property(TARGET ${EXE_NAME} PROPERTY FOLDER "Examples/Tutorial/AddModule") diff --git a/examples/tutorial_api_cpp/CMakeLists.txt b/examples/tutorial_api_cpp/CMakeLists.txt index 8d9dc191..07cc53ed 100644 --- a/examples/tutorial_api_cpp/CMakeLists.txt +++ b/examples/tutorial_api_cpp/CMakeLists.txt @@ -23,7 +23,7 @@ foreach(EXAMPLE_FILE ${EXAMPLE_FILES}) message(STATUS "Adding Example ${EXE_NAME}") add_executable(${EXE_NAME} ${EXAMPLE_FILE}) - target_link_libraries(${EXE_NAME} openpose ${examples_3rdparty_libraries}) + target_link_libraries(${EXE_NAME} openpose_src ${examples_3rdparty_libraries}) if (WIN32) set_property(TARGET ${EXE_NAME} PROPERTY FOLDER "Examples/Tutorial/C++ API") diff --git a/examples/tutorial_developer/CMakeLists.txt b/examples/tutorial_developer/CMakeLists.txt index 34410920..6b66cd73 100644 --- a/examples/tutorial_developer/CMakeLists.txt +++ b/examples/tutorial_developer/CMakeLists.txt @@ -18,7 +18,7 @@ foreach(EXAMPLE_FILE ${EXAMPLE_FILES}) message(STATUS "Adding Example ${EXE_NAME}") add_executable(${EXE_NAME} ${EXAMPLE_FILE}) - target_link_libraries(${EXE_NAME} openpose ${examples_3rdparty_libraries}) + target_link_libraries(${EXE_NAME} openpose_src ${examples_3rdparty_libraries}) if (WIN32) set_property(TARGET ${EXE_NAME} PROPERTY FOLDER "Examples/Tutorial/Developer Examples") diff --git a/examples/user_code/CMakeLists.txt b/examples/user_code/CMakeLists.txt index 921da368..d17676b5 100644 --- a/examples/user_code/CMakeLists.txt +++ b/examples/user_code/CMakeLists.txt @@ -18,7 +18,7 @@ foreach(USER_CODE_FILE ${USER_CODE_FILES}) message(STATUS "Adding Example ${EXE_NAME}") add_executable(${EXE_NAME} ${USER_CODE_FILE}) - target_link_libraries(${EXE_NAME} openpose ${examples_3rdparty_libraries}) + target_link_libraries(${EXE_NAME} openpose_src ${examples_3rdparty_libraries}) if (WIN32) set_property(TARGET ${EXE_NAME} PROPERTY FOLDER "User Code") diff --git a/scripts/travis/run_tests.sh b/scripts/travis/run_tests.sh index 193c69bb..0c4f989c 100755 --- a/scripts/travis/run_tests.sh +++ b/scripts/travis/run_tests.sh @@ -14,7 +14,7 @@ if [[ $RUN_EXAMPLES == true ]] ; then ./build/examples/openpose/openpose.bin --net_resolution -1x32 --image_dir examples/media/ --write_json output/ --display 0 --render_pose 0 echo " " - echo "Tutorial Add Moduel: Example 1..." + echo "Tutorial Add Module: Example 1..." ./build/examples/tutorial_add_module/1_custom_post_processing.bin --net_resolution -1x32 --image_dir examples/media/ --write_json output/ --display 0 --render_pose 0 echo " " diff --git a/scripts/ubuntu/install_ubuntu_deps.sh b/scripts/ubuntu/install_ubuntu_deps.sh index 3b19422b..fa4ff446 100755 --- a/scripts/ubuntu/install_ubuntu_deps.sh +++ b/scripts/ubuntu/install_ubuntu_deps.sh @@ -11,6 +11,8 @@ sudo apt-get --assume-yes install --no-install-recommends libboost-all-dev # Remaining dependencies, 14.04 sudo apt-get --assume-yes install libgflags-dev libgoogle-glog-dev liblmdb-dev # Python libs +sudo apt-get install python-setuptools python-dev build-essential +sudo easy_install pip sudo -H pip install --upgrade numpy protobuf # OpenCV 2.4 -> Added as option # sudo apt-get --assume-yes install libopencv-dev diff --git a/scripts/ubuntu_deprecated/Makefile.config.Ubuntu14_cuda7.example b/scripts/ubuntu_deprecated/Makefile.config.Ubuntu14_cuda7.example index b583de4a..0003b986 100644 --- a/scripts/ubuntu_deprecated/Makefile.config.Ubuntu14_cuda7.example +++ b/scripts/ubuntu_deprecated/Makefile.config.Ubuntu14_cuda7.example @@ -30,6 +30,8 @@ CUDA_DIR := /usr/local/cuda # CUDA architecture setting: going with all of them. # For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility. # For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility. +# Architectures: +# http://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/ CUDA_ARCH := -gencode arch=compute_30,code=sm_30 \ -gencode arch=compute_35,code=sm_35 \ -gencode arch=compute_50,code=sm_50 \ diff --git a/scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda10.example b/scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda10.example new file mode 100644 index 00000000..2cd6f0ae --- /dev/null +++ b/scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda10.example @@ -0,0 +1,92 @@ +## Refer to http://caffe.berkeleyvision.org/installation.html +# Contributions simplifying and improving our build system are welcome! + +# CPU-only switch (comment to build without GPU support). +USE_CUDA := 1 + +# uncomment to disable IO dependencies and corresponding data layers +# USE_OPENCV := 0 +# USE_LEVELDB := 0 +# USE_LMDB := 0 + +# uncomment to allow MDB_NOLOCK when reading LMDB files (only if necessary) +# You should not set this flag if you will be reading LMDBs with any +# possibility of simultaneous read and write +# ALLOW_LMDB_NOLOCK := 1 + +# Uncomment if you're using OpenCV 3 +# OPENCV_VERSION := 3 + +# To customize your choice of compiler, uncomment and set the following. +# N.B. the default for Linux is g++ and the default for OSX is clang++ +# CUSTOM_CXX := g++ + +# CUDA directory contains bin/ and lib/ directories that we need. +CUDA_DIR := /usr/local/cuda +# On Ubuntu 14.04, if cuda tools are installed via +# "sudo apt-get install nvidia-cuda-toolkit" then use this instead: +# CUDA_DIR := /usr + +# CUDA architecture setting: going with all of them. +# For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility. +# For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility. +# Architectures: +# http://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/ +CUDA_ARCH := -gencode arch=compute_30,code=sm_30 \ + -gencode arch=compute_35,code=sm_35 \ + -gencode arch=compute_50,code=sm_50 \ + -gencode arch=compute_52,code=sm_52 \ + -gencode arch=compute_60,code=sm_60 \ + -gencode arch=compute_61,code=sm_61 \ + -gencode arch=compute_62,code=sm_62 \ + -gencode arch=compute_70,code=sm_70 \ + -gencode arch=compute_71,code=sm_71 \ + -gencode arch=compute_72,code=sm_72 \ + -gencode arch=compute_75,code=sm_75 \ + -gencode arch=compute_75,code=compute_75 + +# Uncomment to enable op::Profiler +# PROFILER_ENABLED := 1 + +# DEEP_NET choice: +# caffe for Caffe (default and only option so far) +DEEP_NET := caffe + +# Caffe directory +CAFFE_DIR := 3rdparty/caffe/distribute + +# Faster GUI display +# WITH_OPENCV_WITH_OPENGL := 1 +# OpenPose 3-D Reconstruction +# WITH_3D_RENDERER := 1 +# WITH_CERES := 1 +# WITH_FLIR_CAMERA := 1 +# Eigen directory (Ceres) +# WITH_EIGEN := 1 +EIGEN_DIR := /usr/include/eigen3/ +# Spinnaker directory +SPINNAKER_DIR := /usr/include/spinnaker + +# Whatever else you find you need goes here. +INCLUDE_DIRS := /usr/local/include /usr/include/hdf5/serial +LIBRARY_DIRS := /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial + +# If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies +# INCLUDE_DIRS += $(shell brew --prefix)/include +# LIBRARY_DIRS += $(shell brew --prefix)/lib + +# Uncomment to use `pkg-config` to specify OpenCV library paths. +# (Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.) +# USE_PKG_CONFIG := 1 + +BUILD_DIR := build +DISTRIBUTE_DIR := distribute + +# Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171 +# DEBUG := 1 + +# The ID of the GPU that 'make runtest' will use to run unit tests. +TEST_GPUID := 0 + +# enable pretty build (comment to see full commands) +Q ?= @ diff --git a/scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda8.example b/scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda8.example index 8c605b57..99807db0 100644 --- a/scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda8.example +++ b/scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda8.example @@ -30,23 +30,16 @@ CUDA_DIR := /usr/local/cuda # CUDA architecture setting: going with all of them. # For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility. # For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility. +# Architectures: +# http://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/ CUDA_ARCH := -gencode arch=compute_30,code=sm_30 \ -gencode arch=compute_35,code=sm_35 \ -gencode arch=compute_50,code=sm_50 \ -gencode arch=compute_52,code=sm_52 \ -gencode arch=compute_60,code=sm_60 \ -gencode arch=compute_61,code=sm_61 \ - -gencode arch=compute_61,code=compute_61 -# Deprecated -# CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \ -# -gencode arch=compute_20,code=sm_21 \ -# -gencode arch=compute_30,code=sm_30 \ -# -gencode arch=compute_35,code=sm_35 \ -# -gencode arch=compute_50,code=sm_50 \ -# -gencode arch=compute_52,code=sm_52 \ -# -gencode arch=compute_60,code=sm_60 \ -# -gencode arch=compute_61,code=sm_61 \ -# -gencode arch=compute_61,code=compute_61 + -gencode arch=compute_62,code=sm_62 \ + -gencode arch=compute_62,code=compute_62 # Uncomment to enable op::Profiler # PROFILER_ENABLED := 1 diff --git a/scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda9.example b/scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda9.example new file mode 100644 index 00000000..c4de79e3 --- /dev/null +++ b/scripts/ubuntu_deprecated/Makefile.config.Ubuntu16_cuda9.example @@ -0,0 +1,91 @@ +## Refer to http://caffe.berkeleyvision.org/installation.html +# Contributions simplifying and improving our build system are welcome! + +# CPU-only switch (comment to build without GPU support). +USE_CUDA := 1 + +# uncomment to disable IO dependencies and corresponding data layers +# USE_OPENCV := 0 +# USE_LEVELDB := 0 +# USE_LMDB := 0 + +# uncomment to allow MDB_NOLOCK when reading LMDB files (only if necessary) +# You should not set this flag if you will be reading LMDBs with any +# possibility of simultaneous read and write +# ALLOW_LMDB_NOLOCK := 1 + +# Uncomment if you're using OpenCV 3 +# OPENCV_VERSION := 3 + +# To customize your choice of compiler, uncomment and set the following. +# N.B. the default for Linux is g++ and the default for OSX is clang++ +# CUSTOM_CXX := g++ + +# CUDA directory contains bin/ and lib/ directories that we need. +CUDA_DIR := /usr/local/cuda +# On Ubuntu 14.04, if cuda tools are installed via +# "sudo apt-get install nvidia-cuda-toolkit" then use this instead: +# CUDA_DIR := /usr + +# CUDA architecture setting: going with all of them. +# For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility. +# For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility. +# Architectures: +# http://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/ +CUDA_ARCH := -gencode arch=compute_30,code=sm_30 \ + -gencode arch=compute_35,code=sm_35 \ + -gencode arch=compute_50,code=sm_50 \ + -gencode arch=compute_52,code=sm_52 \ + -gencode arch=compute_60,code=sm_60 \ + -gencode arch=compute_61,code=sm_61 \ + -gencode arch=compute_62,code=sm_62 \ + -gencode arch=compute_70,code=sm_70 \ + -gencode arch=compute_71,code=sm_71 \ + -gencode arch=compute_72,code=sm_72 \ + -gencode arch=compute_72,code=compute_72 + +# Uncomment to enable op::Profiler +# PROFILER_ENABLED := 1 + +# DEEP_NET choice: +# caffe for Caffe (default and only option so far) +DEEP_NET := caffe + +# Caffe directory +CAFFE_DIR := 3rdparty/caffe/distribute + +# Faster GUI display +# WITH_OPENCV_WITH_OPENGL := 1 +# OpenPose 3-D Reconstruction +# WITH_3D_RENDERER := 1 +# WITH_CERES := 1 +# WITH_FLIR_CAMERA := 1 +# Eigen directory (Ceres) +# WITH_EIGEN := 1 +EIGEN_DIR := /usr/include/eigen3/ +# Spinnaker directory +SPINNAKER_DIR := /usr/include/spinnaker + +# Whatever else you find you need goes here. +INCLUDE_DIRS := /usr/local/include /usr/include/hdf5/serial +LIBRARY_DIRS := /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial + +# If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies +# INCLUDE_DIRS += $(shell brew --prefix)/include +# LIBRARY_DIRS += $(shell brew --prefix)/lib + +# Uncomment to use `pkg-config` to specify OpenCV library paths. +# (Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.) +# USE_PKG_CONFIG := 1 + +BUILD_DIR := build +DISTRIBUTE_DIR := distribute + +# Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171 +# DEBUG := 1 + +# The ID of the GPU that 'make runtest' will use to run unit tests. +TEST_GPUID := 0 + +# enable pretty build (comment to see full commands) +Q ?= @ diff --git a/src/openpose/3d/CMakeLists.txt b/src/openpose/3d/CMakeLists.txt index 6482341e..f06fdb2d 100644 --- a/src/openpose/3d/CMakeLists.txt +++ b/src/openpose/3d/CMakeLists.txt @@ -21,7 +21,7 @@ if (UNIX OR APPLE) target_link_libraries(openpose_3d caffe openpose_core ${MKL_LIBS}) if (BUILD_CAFFE) - add_dependencies(openpose_3d openpose_caffe) + add_dependencies(openpose_3d openpose) endif (BUILD_CAFFE) install(TARGETS openpose_3d diff --git a/src/openpose/CMakeLists.txt b/src/openpose/CMakeLists.txt index bf6bf88e..ca84d2bb 100644 --- a/src/openpose/CMakeLists.txt +++ b/src/openpose/CMakeLists.txt @@ -18,28 +18,28 @@ set(OP_HEADERS "") # endforeach(FILE ${OP_HEADERS_UNFILTERED}) if (${GPU_MODE} MATCHES "CUDA") - cuda_add_library(openpose ${SOURCES_OPENPOSE} ${OP_HEADERS}) + cuda_add_library(openpose_src ${SOURCES_OPENPOSE} ${OP_HEADERS}) else () - add_library(openpose ${SOURCES_OPENPOSE} ${OP_HEADERS}) + add_library(openpose_src ${SOURCES_OPENPOSE} ${OP_HEADERS}) endif () # Ubuntu if (UNIX OR APPLE) - target_link_libraries(openpose ${OpenPose_3rdparty_libraries}) + target_link_libraries(openpose_src ${OpenPose_3rdparty_libraries}) if (CMAKE_COMPILER_IS_GNUCXX) foreach (SUB_DIR ${SUB_DIRS}) set_target_properties(openpose_${SUB_DIR} PROPERTIES COMPILE_FLAGS ${OP_CXX_FLAGS}) endforeach (SUB_DIR ${SUB_DIRS}) - set_target_properties(openpose PROPERTIES COMPILE_FLAGS ${OP_CXX_FLAGS}) + set_target_properties(openpose_src PROPERTIES COMPILE_FLAGS ${OP_CXX_FLAGS}) endif (CMAKE_COMPILER_IS_GNUCXX) # Windows elseif (WIN32) - set_property(TARGET openpose PROPERTY DEBUG_POSTFIX d) - target_link_libraries(openpose ${OpenPose_3rdparty_libraries}) + set_property(TARGET openpose_src PROPERTY DEBUG_POSTFIX d) + target_link_libraries(openpose_src ${OpenPose_3rdparty_libraries}) if (${DL_FRAMEWORK} MATCHES "CAFFE") - target_compile_definitions(openpose PRIVATE BOOST_ALL_NO_LIB) + target_compile_definitions(openpose_src PRIVATE BOOST_ALL_NO_LIB) endif(${DL_FRAMEWORK} MATCHES "CAFFE") - set_property(TARGET openpose PROPERTY FOLDER "OpenPose library") + set_property(TARGET openpose_src PROPERTY FOLDER "OpenPose library") foreach (SUB_DIR ${SUB_DIRS}) string(TOUPPER ${SUB_DIR} SUB_DIR_UPPERCASE) @@ -49,25 +49,25 @@ elseif (WIN32) "${CMAKE_SOURCE_DIR}/include/openpose/${SUB_DIR}/*.hu") source_group("Header Files\\${SUB_DIR}" FILES ${SUB_MOD_HEADERS}) endforeach (SUB_DIR ${SUB_DIRS}) - set_target_properties(openpose PROPERTIES COMPILE_FLAGS -DOP_EXPORTS) + set_target_properties(openpose_src PROPERTIES COMPILE_FLAGS -DOP_EXPORTS) # Properties->General->Output Directory - set_property(TARGET openpose PROPERTY RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_BINARY_DIR}/$(Platform)/$(Configuration)) - set_property(TARGET openpose PROPERTY RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_BINARY_DIR}/$(Platform)/$(Configuration)) + set_property(TARGET openpose_src PROPERTY RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_BINARY_DIR}/$(Platform)/$(Configuration)) + set_property(TARGET openpose_src PROPERTY RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_BINARY_DIR}/$(Platform)/$(Configuration)) endif (UNIX OR APPLE) if (UNIX OR APPLE) add_library(caffe SHARED IMPORTED) set_property(TARGET caffe PROPERTY IMPORTED_LOCATION ${Caffe_LIBS}) - target_link_libraries(openpose caffe ${Boost_SYSTEM_LIBRARY} ${OpenCL_LIBRARIES}) + target_link_libraries(openpose_src caffe ${Boost_SYSTEM_LIBRARY} ${OpenCL_LIBRARIES}) if (BUILD_CAFFE) - add_dependencies(openpose openpose_caffe) + add_dependencies(openpose_src openpose) endif (BUILD_CAFFE) - set_property(TARGET openpose PROPERTY VERSION ${OpenPose_VERSION}) + set_property(TARGET openpose_src PROPERTY VERSION ${OpenPose_VERSION}) - install(TARGETS openpose + install(TARGETS openpose_src EXPORT OpenPose RUNTIME DESTINATION bin LIBRARY DESTINATION lib diff --git a/src/openpose/calibration/CMakeLists.txt b/src/openpose/calibration/CMakeLists.txt index 60322632..55f7eadb 100644 --- a/src/openpose/calibration/CMakeLists.txt +++ b/src/openpose/calibration/CMakeLists.txt @@ -18,7 +18,7 @@ if (UNIX OR APPLE) target_link_libraries(openpose_calibration openpose_core) if (BUILD_CAFFE) - add_dependencies(openpose_calibration openpose_caffe) + add_dependencies(openpose_calibration openpose) endif (BUILD_CAFFE) install(TARGETS openpose_calibration diff --git a/src/openpose/core/CMakeLists.txt b/src/openpose/core/CMakeLists.txt index bcfec4b4..98916c06 100644 --- a/src/openpose/core/CMakeLists.txt +++ b/src/openpose/core/CMakeLists.txt @@ -35,7 +35,7 @@ if (UNIX OR APPLE) endif (APPLE) if (BUILD_CAFFE) - add_dependencies(openpose_core openpose_caffe) + add_dependencies(openpose_core openpose) endif (BUILD_CAFFE) install(TARGETS openpose_core diff --git a/src/openpose/face/CMakeLists.txt b/src/openpose/face/CMakeLists.txt index 86e2c980..e19f3fba 100644 --- a/src/openpose/face/CMakeLists.txt +++ b/src/openpose/face/CMakeLists.txt @@ -25,7 +25,7 @@ if (UNIX OR APPLE) target_link_libraries(openpose_face openpose_core) if (BUILD_CAFFE) - add_dependencies(openpose_face openpose_caffe) + add_dependencies(openpose_face openpose) endif (BUILD_CAFFE) install(TARGETS openpose_face diff --git a/src/openpose/hand/CMakeLists.txt b/src/openpose/hand/CMakeLists.txt index be779291..ab0c793b 100644 --- a/src/openpose/hand/CMakeLists.txt +++ b/src/openpose/hand/CMakeLists.txt @@ -25,7 +25,7 @@ if (UNIX OR APPLE) target_link_libraries(openpose_hand openpose_core) if (BUILD_CAFFE) - add_dependencies(openpose_hand openpose_caffe) + add_dependencies(openpose_hand openpose) endif (BUILD_CAFFE) install(TARGETS openpose_hand diff --git a/src/openpose/net/CMakeLists.txt b/src/openpose/net/CMakeLists.txt index 06d965b6..22c8e859 100644 --- a/src/openpose/net/CMakeLists.txt +++ b/src/openpose/net/CMakeLists.txt @@ -35,7 +35,7 @@ if (UNIX OR APPLE) target_link_libraries(openpose_net caffe ${MKL_LIBS} openpose_core) if (BUILD_CAFFE) - add_dependencies(openpose_net openpose_caffe) + add_dependencies(openpose_net openpose) endif (BUILD_CAFFE) install(TARGETS openpose_net diff --git a/src/openpose/pose/CMakeLists.txt b/src/openpose/pose/CMakeLists.txt index 7b4d0fdc..cbf53bfa 100644 --- a/src/openpose/pose/CMakeLists.txt +++ b/src/openpose/pose/CMakeLists.txt @@ -26,7 +26,7 @@ if (UNIX OR APPLE) target_link_libraries(openpose_pose openpose_core) if (BUILD_CAFFE) - add_dependencies(openpose_pose openpose_caffe) + add_dependencies(openpose_pose openpose) endif (BUILD_CAFFE) install(TARGETS openpose_pose diff --git a/src/openpose/producer/producer.cpp b/src/openpose/producer/producer.cpp index 86a5724a..0d1f499f 100644 --- a/src/openpose/producer/producer.cpp +++ b/src/openpose/producer/producer.cpp @@ -65,10 +65,11 @@ namespace op } // Sanity check if ((int)mCameraParameterReader.getNumberCameras() != mNumberViews) - error("Found different number of camera parameter files than the number indicated by" + error("Found a different number of camera parameter files than the number indicated by" " `--3d_views` (" + std::to_string(mCameraParameterReader.getNumberCameras()) + " vs. " - + std::to_string(mNumberViews) + "). Make sure they are the same number of files.", + + std::to_string(mNumberViews) + "). Make sure they are the same number of files and/or" + + " set `--frame_undistort` to false.", __LINE__, __FUNCTION__, __FILE__); } } -- GitLab