提交 911fd16a 编写于 作者: B Bikramjot Hanzra 提交者: Gines

CMake support for Windows added (#379)

* basic version working -- need to remove hacks.

* source groups added and removing hacks.

* Executables placed in subfolders.

* boost error fixed and neater folder view in VS.

* basic version working -- need to remove hacks.

* source groups added and removing hacks.

* Executables placed in subfolders.

* boost error fixed and neater folder view in VS.

* Code updated to make it run with Ubuntu.

* Updated New Module

* More VS options added to CMake.

* CMake now downloads Windows dependencies if needed.

* Replicating Manual VS settings.

* more flags added.

* works -- but now crashes alot.

* Optimization flags added. Need to figure out why /GL doesn't work.

* most of the options working.

* removed caffe

* works on windows

* windows running everytime.

* Sh scripts to 775

* Updated release_notes.md

* Boost removed

* Added max optimization (O3) in Ubuntu

* Fixed minor flag bugs

* Added download link for freeglut

* openpose3d added, works for any binary dir, debug version works.
上级 a87b0b6d
......@@ -71,7 +71,7 @@ tags
*.opendb
*.pdb
######################### Windows (Visual Studio) Folders #########################
######################### Windows (Visual Studio) Folders and Compressed files #########################
*.vs/
*x64/
3rdparty/windows/caffe/
......@@ -79,6 +79,7 @@ tags
3rdparty/windows/opencv/
3rdparty/windows/freeglut/
3rdparty/windows/spinnaker/
3rdparty/windows/*zip
# Allowing this file (removed *.user for Qt)
!*.vcxproj.user
......
......@@ -9,6 +9,10 @@ Windows:
- Version 1.0.0, extracted from GitHub on 07/11/2017 from the current master branch.
- Link: https://github.com/BVLC/caffe/tree/windows
- FreeGLUT (only for the 3-D reconstruction demo):
- Version 3.0.0-2 (MSVC), extracted from their oficial website.
- Link: https://www.transmissionzero.co.uk/software/freeglut-devel/
- OpenCV:
- Version 3.1.0, extracted from their oficial website, section releases/3.1.0/Win pack.
- Link: http://opencv.org/releases.html
......
project(OpenPose)
cmake_minimum_required(VERSION 2.8.7 FATAL_ERROR) # min. cmake version recommended by Caffe
### VERSION INFO
set(OpenPose_VERSION_MAJOR 1)
set(OpenPose_VERSION_MINOR 1)
set(OpenPose_VERSION_PATCH 0)
set(OpenPose_VERSION_MINOR 2)
set(OpenPose_VERSION_PATCH 1)
set(OpenPose_VERSION ${OpenPose_VERSION_MAJOR}.${OpenPose_VERSION_MINOR}.${OpenPose_VERSION_PATCH})
### CMAKE HEADERS
cmake_policy(SET CMP0048 NEW)
project(OpenPose VERSION ${OpenPose_VERSION})
cmake_minimum_required(VERSION 2.8.7 FATAL_ERROR) # min. cmake version recommended by Caffe
### FIND THE OS
if (WIN32) # OS is Windows
message(FATAL_ERROR "Windows OS is not currently supported.")
message(STATUS "Windows OS support currently is experimental.")
message(STATUS "Feel free to send us any suggestion or bug you encounter.")
elseif (APPLE) # OS is Apple
message(FATAL_ERROR "Apple OS is not currently supported.")
elseif (UNIX AND NOT APPLE) # OS is a Linux distribution (it assumes Ubuntu)
......@@ -21,7 +26,7 @@ elseif (UNIX AND NOT APPLE) # OS is a Linux distribution (it assumes Ubuntu)
if (${UBUNTU_MAJOR_VERSION} MATCHES "16") # if 16
set(IS_UBUNTU_16 TRUE)
set(IS_UBUNTU_14_OR_LESS FALSE)
else (${UBUNTU_MAJOR_VERSION MATCHES "16") # if 14 or less
else (${UBUNTU_MAJOR_VERSION} MATCHES "16") # if 14 or less
set(IS_UBUNTU_16 FALSE)
set(IS_UBUNTU_14_OR_LESS TRUE)
endif (${UBUNTU_MAJOR_VERSION} MATCHES "16")
......@@ -29,11 +34,43 @@ endif ()
### FLAGS
# Turn on C++11
add_definitions(-std=c++11)
if (WIN32)
# TODO -- Makeshift solution -- This prevents rerunning build again
# https://gitlab.kitware.com/cmake/cmake/issues/16783
set(CMAKE_SUPPRESS_REGENERATION ON)
string (REPLACE "/D_WINDOWS" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
string (REPLACE "/DWIN32" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
# /GL option causes the code to crash -- fix this
# sdl flags causes error -- error : unknown attribute \"guard\"
set(CMAKE_CONFIGURATION_TYPES Debug Release CACHE TYPE INTERNAL FORCE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
string(REPLACE "/W3" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE "/O2" "/Ox" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
string(REPLACE "/Ob2" "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Ot /Oi /Gy /Z7")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /LTCG:incremental /OPT:REF /OPT:ICF")
string(REPLACE "/MDd" "/MD" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
string(REPLACE "/RTC1" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
elseif (UNIX AND NOT APPLE)
# Turn on C++11
add_definitions(-std=c++11)
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
endif (WIN32)
# C++ additional flags
set(OP_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -Wpedantic -Wall -Wextra -Wfatal-errors")
if(CMAKE_COMPILER_IS_GNUCXX)
message(STATUS "GCC detected, adding compile flags")
set(OP_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -Wpedantic -Wall -Wextra -Wfatal-errors")
endif(CMAKE_COMPILER_IS_GNUCXX)
### PROJECT OPTIONS
......@@ -51,6 +88,25 @@ if (${DL_FRAMEWORK} MATCHES "CAFFE")
add_definitions(-DUSE_CAFFE)
endif (${DL_FRAMEWORK} MATCHES "CAFFE")
if (WIN32)
# Select the Enhanced Instruction Set
set(INSTRUCTION_SET NONE CACHE STRING "Enable Enhanced Instruction Set")
set_property(CACHE INSTRUCTION_SET PROPERTY STRINGS NONE SSE SSE2 AVX AVX2 IA32)
# Suboptions for Enhanced Instruction Set
if (${INSTRUCTION_SET} MATCHES "SSE")
add_definitions("/arch:SSE")
elseif (${INSTRUCTION_SET} MATCHES "SSE2")
add_definitions("/arch:SSE2")
elseif (${INSTRUCTION_SET} MATCHES "AVX")
add_definitions("/arch:AVX")
elseif (${INSTRUCTION_SET} MATCHES "AVX2")
add_definitions("/arch:AVX2")
elseif (${INSTRUCTION_SET} MATCHES "IA32")
add_definitions("/arch:IA32")
endif (${INSTRUCTION_SET} MATCHES "SSE")
endif (WIN32)
# Set the acceleration library
set(GPU_MODE CUDA CACHE STRING "Select the acceleration GPU library or CPU otherwise.")
set_property(CACHE GPU_MODE PROPERTY STRINGS CUDA)
......@@ -73,6 +129,12 @@ endif (${GPU_MODE} MATCHES "CUDA")
if (${GPU_MODE} MATCHES "CUDA")
option(USE_CUDNN "Build OpenPose with cuDNN library support." ON)
endif (${GPU_MODE} MATCHES "CUDA")
# Suboptions for OpenPose 3D Reconstruction demo
if (WIN32)
option(WITH_3D "Build OpenPose 3D Reconstruction demo." OFF)
endif (WIN32)
# Download the models
option(DOWNLOAD_COCO_MODEL "Download COCO model." ON)
......@@ -93,197 +155,256 @@ option(PROFILER_ENABLED "If enabled, OpenPose will be able to print out speed in
### FIND REQUIRED PACKAGES
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
include(cmake/Cuda.cmake)
# find_package(CUDA)
find_package(CuDNN)
find_package(GFlags)
find_package(Glog)
find_package(OpenCV)
if (NOT CUDA_FOUND)
message(STATUS "CUDA not found.")
execute_process(COMMAND cat install_cuda.sh WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/ubuntu)
message(FATAL_ERROR "Install CUDA using the above commands.")
endif (NOT CUDA_FOUND)
if (USE_CUDNN AND NOT CUDNN_FOUND)
message(STATUS "cuDNN not found.")
execute_process(COMMAND cat install_cudnn.sh WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/ubuntu)
message(FATAL_ERROR "Install cuDNN using the above commands. or turn off cuDNN by setting USE_CUDNN to OFF.")
endif (USE_CUDNN AND NOT CUDNN_FOUND)
if (NOT GLOG_FOUND)
message(FATAL_ERROR "Glog not found. Install Glog from the command line using the command(s) -\
sudo apt-get install libgoogle-glog-dev")
endif (NOT GLOG_FOUND)
if (NOT GFLAGS_FOUND)
message(FATAL_ERROR "GFlags not found. Install GFlags from the command line using the command(s) --\
sudo apt-get install libgflags-dev")
endif (NOT GFLAGS_FOUND)
if (NOT OpenCV_FOUND)
message(FATAL_ERROR "OpenCV not found. Install OpenCV from the command line using the command(s) --\
sudo apt-get install libopencv-dev")
endif (NOT OpenCV_FOUND)
# Set CUDA Flags
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++11")
find_package(CUDA)
if (UNIX AND NOT APPLE)
include(cmake/Cuda.cmake)
find_package(CuDNN)
find_package(GFlags)
find_package(Glog)
find_package(OpenCV)
# Set CUDA Flags
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++11")
if (NOT CUDA_FOUND)
message(STATUS "CUDA not found.")
execute_process(COMMAND cat install_cuda.sh WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/ubuntu)
message(FATAL_ERROR "Install CUDA using the above commands.")
endif (NOT CUDA_FOUND)
if (USE_CUDNN AND NOT CUDNN_FOUND)
message(STATUS "cuDNN not found.")
execute_process(COMMAND cat install_cudnn.sh WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/ubuntu)
message(FATAL_ERROR "Install cuDNN using the above commands. or turn off cuDNN by setting USE_CUDNN to OFF.")
endif (USE_CUDNN AND NOT CUDNN_FOUND)
if (NOT GLOG_FOUND)
message(FATAL_ERROR "Glog not found. Install Glog from the command line using the command(s) -\
sudo apt-get install libgoogle-glog-dev")
endif (NOT GLOG_FOUND)
if (NOT GFLAGS_FOUND)
message(FATAL_ERROR "GFlags not found. Install GFlags from the command line using the command(s) --\
sudo apt-get install libgflags-dev")
endif (NOT GFLAGS_FOUND)
if (NOT OpenCV_FOUND)
message(FATAL_ERROR "OpenCV not found. Install OpenCV from the command line using the command(s) --\
sudo apt-get install libopencv-dev")
endif (NOT OpenCV_FOUND)
endif (UNIX AND NOT APPLE)
include(cmake/Utils.cmake)
if (WIN32)
if("${CMAKE_VERSION}" VERSION_GREATER 3.6.3)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT OpenPoseDemo)
endif("${CMAKE_VERSION}" VERSION_GREATER 3.6.3)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(FIND_LIB_PREFIX ${CMAKE_SOURCE_DIR}/3rdparty/windows)
# Download Windows 3rd party
message(STATUS "Downloading windows dependencies...")
set(OP_WIN_URL "http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows")
set(OP_WIN_DIR "${CMAKE_SOURCE_DIR}/3rdparty/windows")
#TODO Add hashes
download_zip("opencv_310.zip" ${OP_WIN_URL} ${FIND_LIB_PREFIX} 1e5240a64b814b3c0b822f136be78ad7)
download_zip("caffe3rdparty_2017_07_14.zip" ${OP_WIN_URL} ${FIND_LIB_PREFIX} ec0f800c8fb337e33304f3375bd06a80)
download_zip("caffe_2017_07_11.zip" ${OP_WIN_URL} ${FIND_LIB_PREFIX} 0302edc8843529f8ded1da74eae8e061)
if (WITH_3D)
download_zip("freeglut_2018_01_14.zip" ${OP_WIN_URL} ${FIND_LIB_PREFIX} BB182187285E06880F0EDE3A39530091)
endif (WITH_3D)
message(STATUS "Windows dependencies downloaded.")
find_library(OpenCV_LIBS opencv_world310 HINTS ${FIND_LIB_PREFIX}/opencv/x64/vc14/lib)
find_library(GFLAGS_LIBRARY_RELEASE gflags HINTS ${FIND_LIB_PREFIX}/caffe3rdparty/lib)
find_library(GFLAGS_LIBRARY_DEBUG gflagsd HINTS ${FIND_LIB_PREFIX}/caffe3rdparty/lib)
find_library(GLOG_LIBRARY_RELEASE glog HINTS ${FIND_LIB_PREFIX}/caffe3rdparty/lib)
find_library(GLOG_LIBRARY_DEBUG glogd HINTS ${FIND_LIB_PREFIX}/caffe3rdparty/lib)
find_library(OpenCV_LIBS opencv_world310 HINTS ${FIND_LIB_PREFIX}/opencv/x64/vc14/lib)
find_library(Caffe_LIB caffe HINTS ${FIND_LIB_PREFIX}/caffe/lib)
find_library(Caffe_Proto_LIB caffeproto HINTS ${FIND_LIB_PREFIX}/caffe/lib)
if (WITH_3D)
find_library(Spinnaker_LIB spinnaker_v140 HINTS ${FIND_LIB_PREFIX}/spinnaker/lib)
find_library(Freeglut_LIB freeglut HINTS ${FIND_LIB_PREFIX}/freeglut/lib)
message(STATUS "\${Freeglut_LIB} = ${Freeglut_LIB}")
endif (WITH_3D)
set(Caffe_LIBS ${Caffe_LIB};${Caffe_Proto_LIB})
set(OpenCV_INCLUDE_DIRS "3rdparty/windows/opencv/include")
set(Caffe_INCLUDE_DIRS "3rdparty/windows/caffe/include;3rdparty/windows/caffe/include2")
set(Boost_INCLUDE_DIRS "3rdparty/windows/caffe3rdparty/include/boost-1_61")
set(WINDOWS_INCLUDE_DIRS "3rdparty/windows/caffe3rdparty/include")
if (WITH_3D)
set(SPINNAKER_INCLUDE_DIRS "3rdparty/windows/spinnaker/include")
set(FREEGLUT_INCLUDE_DIRS "3rdparty/windows/freeglut/include")
endif (WITH_3D)
endif (WIN32)
### CAFFE
if (${DL_FRAMEWORK} MATCHES "CAFFE")
if (UNIX AND NOT APPLE)
# Check if the user specified caffe paths
if (Caffe_INCLUDE_DIRS AND Caffe_LIBS AND NOT BUILD_CAFFE)
message(STATUS "\${Caffe_INCLUDE_DIRS} set by the user to " ${Caffe_INCLUDE_DIRS})
message(STATUS "\${Caffe_LIBS} set by the user to " ${Caffe_LIBS})
set(Caffe_FOUND 1)
endif (Caffe_INCLUDE_DIRS AND Caffe_LIBS AND NOT BUILD_CAFFE)
if (${DL_FRAMEWORK} MATCHES "CAFFE")
# Check if caffe is installed in known paths
if (NOT Caffe_FOUND AND NOT BUILD_CAFFE)
message(STATUS "Looking for caffe around in expected paths.")
find_package(Caffe)
endif (NOT Caffe_FOUND AND NOT BUILD_CAFFE)
# Check if the user specified caffe paths
if (Caffe_INCLUDE_DIRS AND Caffe_LIBS AND NOT BUILD_CAFFE)
message(STATUS "\${Caffe_INCLUDE_DIRS} set by the user to " ${Caffe_INCLUDE_DIRS})
message(STATUS "\${Caffe_LIBS} set by the user to " ${Caffe_LIBS})
set(Caffe_FOUND 1)
endif (Caffe_INCLUDE_DIRS AND Caffe_LIBS AND NOT BUILD_CAFFE)
# Else build from scratch
if (BUILD_CAFFE)
# Check if caffe is installed in known paths
if (NOT Caffe_FOUND AND NOT BUILD_CAFFE)
message(STATUS "Looking for caffe around in expected paths.")
find_package(Caffe)
endif (NOT Caffe_FOUND AND NOT BUILD_CAFFE)
# Download Caffe
message(STATUS "Caffe will be downloaded from source now. NOTE: This process might take several minutes depending
on your internet connection.")
execute_process(COMMAND git submodule update --init --recursive)
# Build Caffe
message(STATUS "Caffe will be built from source now.")
include(ExternalProject)
set(CAFFE_PREFIX caffe)
set(CAFFE_URL ${CMAKE_SOURCE_DIR}/3rdparty/caffe)
ExternalProject_Add(openpose_caffe
SOURCE_DIR ${CAFFE_URL}
PREFIX ${CAFFE_PREFIX}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DUSE_CUDNN=${USE_CUDNN}
-DBUILD_python=OFF
-DOpenCV_DIR=${OpenCV_DIR})
ExternalProject_Get_Property(openpose_caffe install_dir)
set(Caffe_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/caffe/include)
# TODO -- Find a better soln.
set(Caffe_LIBS ${CMAKE_BINARY_DIR}/caffe/lib/libcaffe.so)
# Else build from scratch
if (BUILD_CAFFE)
endif (BUILD_CAFFE)
# Download Caffe
message(STATUS "Caffe will be downloaded from source now. NOTE: This process might take several minutes depending
on your internet connection.")
execute_process(COMMAND git submodule update --init --recursive)
# Build Caffe
message(STATUS "Caffe will be built from source now.")
include(ExternalProject)
set(CAFFE_PREFIX caffe)
set(CAFFE_URL ${CMAKE_SOURCE_DIR}/3rdparty/caffe)
if (NOT Caffe_FOUND AND NOT BUILD_CAFFE)
message(FATAL_ERROR "Caffe not found. Either turn on the BUILD_CAFFE option or specify the path of Caffe includes
and libs using -DCaffe_INCLUDE_DIRS and -DCaffe_LIBS")
endif (NOT Caffe_FOUND AND NOT BUILD_CAFFE)
ExternalProject_Add(openpose_caffe
SOURCE_DIR ${CAFFE_URL}
PREFIX ${CAFFE_PREFIX}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DUSE_CUDNN=${USE_CUDNN}
-DBUILD_python=OFF
-DOpenCV_DIR=${OpenCV_DIR})
endif (${DL_FRAMEWORK} MATCHES "CAFFE")
ExternalProject_Get_Property(openpose_caffe install_dir)
set(Caffe_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/caffe/include)
# TODO -- Find a better soln.
set(Caffe_LIBS ${CMAKE_BINARY_DIR}/caffe/lib/libcaffe.so)
endif (BUILD_CAFFE)
if (NOT Caffe_FOUND AND NOT BUILD_CAFFE)
message(FATAL_ERROR "Caffe not found. Either turn on the BUILD_CAFFE option or specify the path of Caffe includes
and libs using -DCaffe_INCLUDE_DIRS and -DCaffe_LIBS")
endif (NOT Caffe_FOUND AND NOT BUILD_CAFFE)
endif (${DL_FRAMEWORK} MATCHES "CAFFE")
endif (UNIX AND NOT APPLE)
### PROJECT INCLUDES
# Specify the include directories
include_directories(
${CMAKE_SOURCE_DIR}/include
include
${CUDA_INCLUDE_DIRS}
${GFLAGS_INCLUDE_DIR}
${GLOG_INCLUDE_DIR}
${Caffe_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS})
if (WIN32)
include_directories(
${Boost_INCLUDE_DIRS}
${WINDOWS_INCLUDE_DIRS})
if (WITH_3D)
include_directories(
${SPINNAKER_INCLUDE_DIRS}
${FREEGLUT_INCLUDE_DIRS})
endif (WITH_3D)
endif (WIN32)
### ADD SUBDIRECTORIES
add_subdirectory(src)
if (BUILD_EXAMPLES)
add_subdirectory(examples)
if (WITH_3D)
add_subdirectory(examples_beta)
endif (WITH_3D)
endif (BUILD_EXAMPLES)
### GENERATE DOCUMENTATION
if (BUILD_DOCS)
find_package(Doxygen)
if (DOXYGEN_FOUND)
# Set input and output files
set(DOXYGEN_FILE ${CMAKE_SOURCE_DIR}/doc/doc_autogeneration.doxygen)
# Custom target to build the documentation
add_custom_target(doc_doxygen ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_FILE}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/doc
COMMENT "Generating API documentation with Doxygen"
VERBATIM )
else (DOXYGEN_FOUND)
message("Doxygen need to be installed to generate the doxygen documentation")
endif (DOXYGEN_FOUND)
endif (BUILD_DOCS)
### DOWNLOAD MODELS
# Download the models if flag is set
# TODO -- remove hardcoded ubuntu paths
include(cmake/Utils.cmake)
message(STATUS "Download the models.")
# URL to the models
set(OPENPOSE_URL "http://posefs1.perception.cs.cmu.edu/OpenPose/models/")
# Body (COCO)
if (DOWNLOAD_COCO_MODEL)
download_model("body (COCO)" ${DOWNLOAD_COCO_MODEL} pose/coco/pose_iter_440000.caffemodel
5156d31f670511fce9b4e28b403f2939)
endif (DOWNLOAD_COCO_MODEL)
# Body (MPI)
if (DOWNLOAD_MPI_MODEL)
download_model("body (MPI)" ${DOWNLOAD_MPI_MODEL} pose/mpi/pose_iter_160000.caffemodel
2ca0990c7562bd7ae03f3f54afa96e00)
endif (DOWNLOAD_MPI_MODEL)
# Face
if (DOWNLOAD_FACE_MODEL)
download_model("face" ${DOWNLOAD_FACE_MODEL} face/pose_iter_116000.caffemodel
e747180d728fa4e4418c465828384333)
endif (DOWNLOAD_FACE_MODEL)
# Hand
if (DOWNLOAD_HAND_MODEL)
download_model("hand" ${DOWNLOAD_HAND_MODEL} hand/pose_iter_102000.caffemodel
a82cfc3fea7c62f159e11bd3674c1531)
endif (DOWNLOAD_HAND_MODEL)
download_model("body (COCO)" ${DOWNLOAD_COCO_MODEL} pose/coco/pose_iter_440000.caffemodel
5156d31f670511fce9b4e28b403f2939) # Body (COCO)
download_model("body (MPI)" ${DOWNLOAD_MPI_MODEL} pose/mpi/pose_iter_160000.caffemodel
2ca0990c7562bd7ae03f3f54afa96e00) # Body (MPI)
download_model("face" ${DOWNLOAD_FACE_MODEL} face/pose_iter_116000.caffemodel
e747180d728fa4e4418c465828384333) # Face
download_model("hand" ${DOWNLOAD_HAND_MODEL} hand/pose_iter_102000.caffemodel
a82cfc3fea7c62f159e11bd3674c1531) # Hand
message(STATUS "Models Downloaded.")
### GENERATE DOCUMENTATION
if (UNIX AND NOT APPLE)
if (BUILD_DOCS)
find_package(Doxygen)
if (DOXYGEN_FOUND)
# Set input and output files
set(DOXYGEN_FILE ${CMAKE_SOURCE_DIR}/doc/doc_autogeneration.doxygen)
# Custom target to build the documentation
add_custom_target(doc_doxygen ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_FILE}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/doc
COMMENT "Generating API documentation with Doxygen"
VERBATIM)
else (DOXYGEN_FOUND)
message("Doxygen need to be installed to generate the doxygen documentation")
endif (DOXYGEN_FOUND)
endif (BUILD_DOCS)
endif (UNIX AND NOT APPLE)
### INSTALL
# Install the headers
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/openpose DESTINATION include)
install(EXPORT OpenPose DESTINATION lib/OpenPose)
if (BUILD_CAFFE)
install(DIRECTORY ${CMAKE_BINARY_DIR}/caffe/include/caffe DESTINATION include)
install(DIRECTORY ${CMAKE_BINARY_DIR}/caffe/lib/ DESTINATION lib)
endif (BUILD_CAFFE)
# Compute installation prefix relative to this file
configure_file(
${CMAKE_SOURCE_DIR}/cmake/OpenPoseConfig.cmake.in
${CMAKE_BINARY_DIR}/cmake/OpenPoseConfig.cmake @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/cmake/OpenPoseConfig.cmake
DESTINATION lib/OpenPose)
# Uninstall target
configure_file(
"${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
if (UNIX AND NOT APPLE)
# Install the headers
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/openpose DESTINATION include)
install(EXPORT OpenPose DESTINATION lib/OpenPose)
if (BUILD_CAFFE)
install(DIRECTORY ${CMAKE_BINARY_DIR}/caffe/include/caffe DESTINATION include)
install(DIRECTORY ${CMAKE_BINARY_DIR}/caffe/lib/ DESTINATION lib)
endif (BUILD_CAFFE)
# Compute installation prefix relative to this file
configure_file(
${CMAKE_SOURCE_DIR}/cmake/OpenPoseConfig.cmake.in
${CMAKE_BINARY_DIR}/cmake/OpenPoseConfig.cmake @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/cmake/OpenPoseConfig.cmake
DESTINATION lib/OpenPose)
# Uninstall target
configure_file(
"${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif (UNIX AND NOT APPLE)
### OPENPOSE FLAGS
......
......@@ -17,7 +17,12 @@ macro(op_list_unique)
endmacro()
# This list will be used for CUDA_ARCH = All option
set(Caffe_known_gpu_archs "20 21(20) 30 35 50 52 60 61")
if (UNIX AND NOT APPLE)
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")
endif ()
################################################################################################
# A function for automatic detection of GPUs installed (if autodetection is enabled)
......@@ -49,7 +54,9 @@ function(op_detect_installed_gpus out_variable)
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(__nvcc_res EQUAL 0)
string(REPLACE "2.1" "2.1(2.0)" __nvcc_out "${__nvcc_out}")
if (NOT WIN32)
string(REPLACE "2.1" "2.1(2.0)" __nvcc_out "${__nvcc_out}")
endif (NOT WIN32)
set(CUDA_gpu_detect_output ${__nvcc_out} CACHE INTERNAL "Returned GPU architetures from op_detect_gpus tool" FORCE)
endif()
endif()
......@@ -96,7 +103,7 @@ function(op_select_nvcc_arch_flags out_variable)
unset(CUDA_ARCH_PTX CACHE)
endif()
if(${CUDA_ARCH} STREQUAL "Fermi")
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")
......@@ -302,4 +309,4 @@ if(APPLE)
# enabled by default if and only if CUDA version is less than 7.0
op_option(USE_libstdcpp "Use libstdc++ instead of libc++" (CUDA_VERSION VERSION_LESS 7.0))
endif()
endif()
endif()
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LocalDebuggerEnvironment>PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\opencv\x64\vc14\bin;@CMAKE_BINARY_DIR@\src\openpose\Release</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerWorkingDirectory>..\..\..</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LocalDebuggerEnvironment>PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\opencv\x64\vc14\bin;@CMAKE_BINARY_DIR@\src\openpose\Debug</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerWorkingDirectory>..\..\..</LocalDebuggerWorkingDirectory>
</PropertyGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LocalDebuggerEnvironment>PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\freeglut\bin\;3rdparty\windows\spinnaker\bin\;;3rdparty\windows\opencv\x64\vc14\bin;@CMAKE_BINARY_DIR@\src\openpose\Release</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerWorkingDirectory>..\..\..</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LocalDebuggerEnvironment>PATH=%PATH%;3rdparty\windows\caffe\bin\;3rdparty\windows\freeglut\bin\;3rdparty\windows\spinnaker\bin\;;3rdparty\windows\opencv\x64\vc14\bin;@CMAKE_BINARY_DIR@\src\openpose\Debug</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerWorkingDirectory>..\..\..</LocalDebuggerWorkingDirectory>
</PropertyGroup>
</Project>
\ No newline at end of file
......@@ -10,7 +10,42 @@ function (download_model MODEL_NAME MODEL_DOWNLOAD_FLAG MODEL_RELATIVE_PATH CHEC
else (NOT EXISTS ${MODEL_FILENAME})
message(STATUS "Model already exists.")
endif (NOT EXISTS ${MODEL_FILENAME})
else (DOWNLOAD_MPI_MODEL)
else (MODEL_DOWNLOAD_FLAG)
message(STATUS "Not downloading ${MODEL_NAME} model")
endif (MODEL_DOWNLOAD_FLAG)
endfunction (download_model)
# Function to download zip files, then extracting them and then deleting them
function(download_zip FILE_NAME URL DOWNLOAD_PATH CHECKSUM)
set(FULL_FILE_PATH "${DOWNLOAD_PATH}/${FILE_NAME}")
if (NOT EXISTS ${FULL_FILE_PATH})
message(STATUS "Downloading ${URL}...")
file(DOWNLOAD "${URL}/${FILE_NAME}" "${DOWNLOAD_PATH}/${FILE_NAME}"
EXPECTED_MD5 ${CHECKSUM})
message(STATUS "Extracting ${FULL_FILE_PATH}...")
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf ${FILE_NAME} WORKING_DIRECTORY ${DOWNLOAD_PATH})
else (NOT EXISTS ${FULL_FILE_PATH})
message(STATUS "${FILE_NAME} already exists.")
endif (NOT EXISTS ${FULL_FILE_PATH})
endfunction(download_zip)
# Function to prepend filenames with common path
function(prepend var prefix)
set(listVar "")
foreach (f ${ARGN})
list(APPEND listVar "${prefix}/${f}")
endforeach (f)
set(${var} "${listVar}" PARENT_SCOPE)
endfunction(prepend)
# Get names of subdirectories in directory
macro(subdirlist result curdir)
FILE(GLOB children RELATIVE ${curdir} ${curdir}/*)
SET(dirlist "")
foreach (child ${children})
if (IS_DIRECTORY ${curdir}/${child})
list(APPEND dirlist ${child})
endif()
endforeach ()
set(${result} ${dirlist})
endmacro()
\ No newline at end of file
......@@ -50,11 +50,11 @@ OpenPose can be easily updated by clicking the `synchronization` button at the t
## Ubuntu
### Installation - CMake
Recommended installation method. It is simpler and it offers many more customization settings. See [doc/installation_cmake.md](installation_cmake.md). Note that it is a beta version, if it fails, please post in GitHub and use [Installation - Script Compilation](#installation---script-compilation) meanwhile.
Recommended installation method, it is simpler and offers more customization settings. See [doc/installation_cmake.md](installation_cmake.md).
### Prerequisites
### Prerequisites (Script Compilation or Manual Compilation)
CUDA, cuDNN, OpenCV and Atlas must be already installed on your machine:
1. [CUDA](https://developer.nvidia.com/cuda-80-ga2-download-archive) must be installed. You should reboot your machine after installing CUDA.
......@@ -134,7 +134,7 @@ You just need to remove the OpenPose folder, by default called `openpose/`. E.g.
## Windows
### Installation - Demo and Binaries
1. Download and unzip the latest `openpose-X.X.X-win64-binaries.zip` Windows binary zip file from the [releases section](https://github.com/CMU-Perceptual-Computing-Lab/openpose/releases).
Download and unzip the latest `openpose-X.X.X-win64-binaries.zip` Windows binary zip file from the [Releases section](https://github.com/CMU-Perceptual-Computing-Lab/openpose/releases).
......@@ -145,7 +145,15 @@ You just need to remove the OpenPose folder, by default called `openpose/`. E.g.
- VS 2015 Enterprise Update 1 will give some compiler errors and VS 2015 Community has not been tested.
2. [**CUDA 8**](https://developer.nvidia.com/cuda-80-ga2-download-archive): Install it on the default location, `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0`. Otherwise, modify the Visual Studio project solution accordingly. Install CUDA 8.0 after Visual Studio 2015 is installed to assure that the CUDA installation will generate all necessary files for VS. If CUDA was already installed, re-install it after installing VS!
3. [**cuDNN 5.1**](https://developer.nvidia.com/cudnn): Once you have downloaded it, just unzip it and copy (merge) the contents on the CUDA folder, `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0`.
2. Download the OpenPose dependencies and models (body, face and hand models) by double-clicking on `{openpose_path}\windows\download_3rdparty_and_models.bat`. Alternatively, you might prefer to download them manually:
#### CMake Installer
Recommended installation method, it is simpler and offers more customization settings. See [doc/installation_cmake.md](installation_cmake.md). Note that it is a beta version, post in GitHub any issue you find.
#### Deprecated Windows Installer
Note: This installer will not incorporate any new features, we recommend to use the CMake installer.
1. Download the OpenPose dependencies and models (body, face and hand models) by double-clicking on `{openpose_path}\windows\download_3rdparty_and_models.bat`. Alternatively, you might prefer to download them manually:
- Models:
- [COCO model](http://posefs1.perception.cs.cmu.edu/OpenPose/models/pose/coco/pose_iter_440000.caffemodel): download in `models/pose/coco/`.
- [MPI model](http://posefs1.perception.cs.cmu.edu/OpenPose/models/pose/mpi/pose_iter_160000.caffemodel): download in `models/pose/mpi/`.
......@@ -155,19 +163,19 @@ You just need to remove the OpenPose folder, by default called `openpose/`. E.g.
- [Caffe](http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/caffe_2017_07_11.zip): Unzip as `3rdparty/windows/caffe/`.
- [Caffe dependencies](http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/caffe3rdparty_2017_07_14.zip): Unzip as `3rdparty/windows/caffe3rdparty/`.
- [OpenCV 3.1](http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/opencv_310.zip): Unzip as `3rdparty/windows/opencv/`.
3. Open the Visual Studio project sln file by double-cliking on `{openpose_path}\windows\OpenPose.sln`.
4. In order to verify OpenPose is working, try compiling and executing the demo:
2. Open the Visual Studio project sln file by double-cliking on `{openpose_path}\windows\OpenPose.sln`.
3. In order to verify OpenPose is working, try compiling and executing the demo:
1. Right click on `OpenPoseDemo` --> `Set as StartUp Project`.
2. Change `Debug` by `Release` mode.
3. Compile it and run it with F5 or the green play icon.
5. If you have a webcam connected, OpenPose will automatically start after being compiled.
6. In order to use the created exe file from the command line (i.e. outside Visual Studio), you have to:
3. Compile it and run it with <kbd>F5</kbd> or the green play icon.
4. If you have a webcam connected, OpenPose will automatically start after being compiled.
5. In order to use the created exe file from the command line (i.e. outside Visual Studio), you have to:
1. Copy all the DLLs located on `{openpose_folder}\3rdparty\windows\caffe\bin\` on the exe folder: `{openpose_folder}\windows\x64\Release`.
2. Copy all the DLLs located on `{openpose_folder}\3rdparty\windows\opencv\x64\vc14\bin\` on the exe folder: `{openpose_folder}\windows\x64\Release`.
3. Open the Windows cmd (Windows button + X, then A).
3. Open the Windows cmd (Windows button + <kbd>X</kbd>, then <kbd>A</kbd>).
4. Go to the OpenPose directory, assuming OpenPose has been downloaded on `C:\openpose`: `cd C:\openpose\`.
5. Run the tutorial commands.
7. Check OpenPose was properly installed by running it on the default images, video or webcam: [doc/quick_start.md#quick-start](./quick_start.md#quick-start).
6. Check OpenPose was properly installed by running it on the default images, video or webcam: [doc/quick_start.md#quick-start](./quick_start.md#quick-start).
......@@ -180,7 +188,7 @@ You just need to remove the OpenPose or portable demo folder.
If you updated some software that our library or 3rdparty use, or you simply want to reinstall it:
1. Open the Visual Studio project sln file by double-cliking on `{openpose_path}\windows\OpenPose.sln`.
2. Clean the OpenPose project by right-click on `Solution 'OpenPose'` and `Clean Solution`.
3. Compile it and run it with F5 or the green play icon.
3. Compile it and run it with <kbd>F5</kbd> or the green play icon.
......
......@@ -6,24 +6,21 @@ OpenPose - Installation using CMake
2. [Requirements](#requirements)
3. [Clone and Update the Repository](#clone-and-update-the-repository)
4. [Installation](#installation)
1. [Caffe Prerequisites (Ubuntu Only)](#caffe-prerequisites-ubuntu-only)
2. [Configuration](#openpose-configuration)
3. [Building](#openpose-building)
4. [OpenPose from other Projects](#openpose-from-other-projects)
5. [Run OpenPose](#run-openpose)
5. [Reinstallation](#reinstallation)
6. [Uninstallation](#uninstallation)
7. [Optional Settings](#optional-settings)
1. [Doxygen Documentation Autogeneration](#doxygen-documentation-autogeneration)
2. [Custom Caffe](#custom-caffe)
3. [Custom OpenCV](#custom-opencv)
4. [MPI Model](#mpi-model)
5. [CMake Command Line Configuration](#cmake-command-line-configuration)
1. [MPI Model](#mpi-model)
2. [Custom Caffe (Ubuntu Only)](#custom-caffe-ubuntu-only)
3. [Custom OpenCV (Ubuntu Only)](#custom-opencv-ubuntu-only)
4. [OpenPose 3D Reconstruction Demo (Windows Only)](#openpose-3d-reconstruction-demo-windows-only)
5. [Doxygen Documentation Autogeneration (Ubuntu Only)](#doxygen-documentation-autogeneration-ubuntu-only)
6. [CMake Command Line Configuration (Ubuntu Only)](#cmake-command-line-configuration-ubuntu-only)
## Operating Systems
- **Ubuntu** 14 and 16.
- **Windows** 8 and 10.
......@@ -44,6 +41,8 @@ The instructions in this section describe the steps to build OpenPose using CMak
2. [Caffe Prerequisites (Ubuntu Only)](#caffe-prerequisites-ubuntu-only)
3. [OpenPose Configuration](#openpose-configuration)
4. [OpenPose Building](#openpose-building)
5. [OpenPose from other Projects (Ubuntu Only)](#openpose-from-other-projects-ubuntu-only)
6. [Run OpenPose](#run-openpose)
......@@ -61,47 +60,48 @@ bash ./ubuntu/install_cmake.sh
### OpenPose Configuration
Note: If you prefer to use CMake through the command line, see [Cmake Command Line Build](#cmake-command-line-build).
1. Download and install CMake GUI.
- Ubuntu: runn the command `sudo apt-get install cmake-qt-gui`. Note: If you prefer to use CMake through the command line, see [Cmake Command Line Build](#cmake-command-line-build-ubuntu-only).
- Windows: download and install the latest CMake win64-x64 msi installer from the [CMake website](https://cmake.org/download/), called `cmake-X.X.X-win64-x64.msi`.
1. Install CMake GUI.
1. Ubuntu: run `sudo apt-get install cmake-qt-gui`.
2. Windows: download and install the latest Windows win64-x64 msi installer from the [CMake website](https://cmake.org/download/).
2. Open CMake GUI and select the project source directory and a sub-directory where the Makefiles will
be generated. We will first select the openpose directory and then we will select a `build` directory in the project root directory as shown in the image below (See the red rectangle). If the `build` directory does not exists, CMake will create it.
2. Open CMake GUI and select the OpenPose directory as project source directory, and a non-existing or empty sub-directory (e.g., `build`) where the Makefile files (Ubuntu) or Visual Studio solution (Windows) will be generated. If `build` does not exist, it will ask you whether to create it. Press `Yes`.
<p align="center">
<img src="media/cmake_installation/im_1.png", width="480">
<img src="media/cmake_installation/im_1_windows.png", width="480">
</p>
3. Next press the `Configure` button in the GUI. It will first ask you to create the `build` directory, if it already did not exist. Press `Yes`.
3. Press the `Configure` button, keep the generator in `Unix Makefile` (Ubuntu) or set it to `Visual Studio 14 2015 Win64` (Windows), and press `Finish`.
<p align="center">
<img src="media/cmake_installation/im_2.png", width="240">
<img src="media/cmake_installation/im_2_windows.png", width="240">
</p>
4. Next a new dialog box will appear, press the `Finish` button here.
4. If this step is successful, the `Configuring done` text will appear in the bottom box in the last line. Otherwise, some red text will appear in that same bottom box.
<p align="center">
<img src="media/cmake_installation/im_3.png", width="240">
<img src="media/cmake_installation/im_3.png", width="480">
<img src="media/cmake_installation/im_3_windows.png", width="480">
</p>
5. If this step is successful, in the bottom box it will show "Configuring done" (in the last line) as shown below.
<p align="center">
<img src="media/cmake_installation/im_4.png", width="480">
</p>
6. Press the `Generate` button and proceed to [OpenPose Building](#openpose-building).
5. Press the `Generate` button and proceed to [OpenPose Building](#openpose-building). You can now close CMake.
Note: If you prefer to use your own custom Caffe or OpenCV versions, see [Custom Caffe](#custom-caffe) or [Custom OpenCV](#custom-opencv) respectively.
### OpenPose Building
#### Ubuntu
Finally, build the project by running the following commands.
```
cd build/
make -j`nproc`
```
### OpenPose from other Projects
#### Windows
In order to build the project, open the Visual Studio solution (Windows), called `build/OpenPose.sln`. Then, set the configuration from `Debug` to `Release` and press the green triangle icon (alternatively press <kbd>F5</kbd>).
### OpenPose from other Projects (Ubuntu Only)
If you only intend to use the OpenPose demo, you might skip this step. This step is only recommended if you plan to use the OpenPose API from other projects.
To install the OpenPose headers and libraries into the system environment path (e.g. `/usr/local/` or `/usr/`), run the following command.
......@@ -136,13 +136,13 @@ link_directories(<path_to_caffe_installation>/caffe/build/install/lib)
```
### Run OpenPose
Check OpenPose was properly installed by running it on the default images, video or webcam: [doc/quick_start.md#quick-start](./quick_start.md#quick-start).
Check OpenPose was properly installed by running it on the default images, video, or webcam: [doc/quick_start.md#quick-start](./quick_start.md#quick-start).
## Reinstallation
In order to re-install OpenPose:
1. If you ran `sudo make install`, then run `sudo make uninstall` in `build/`.
1. (Ubuntu only) If you ran `sudo make install`, then run `sudo make uninstall` in `build/`.
2. Delete the `build/` folder.
3. In CMake GUI, click on `File` --> `Delete Cache`.
4. Follow the [Installation](#installation) steps again.
......@@ -150,22 +150,19 @@ In order to re-install OpenPose:
## Uninstallation
If you used `sudo make install`, simply use the command below in the `build` directory and later remove the OpenPose folder.
```
cd build/
sudo make uninstall
```
If you did not use `sudo make install`, simply remove the OpenPose folder.
In order to uninstall OpenPose:
1. (Ubuntu only) If you ran `sudo make install`, then run `sudo make uninstall` in `build/`.
2. Remove the OpenPose folder.
### Optional Settings
#### Doxygen Documentation Autogeneration
You can generate the documentation by setting the `BUILD_DOCS` flag.
#### MPI Model
By default, the body MPI model is not downloaded. You can download it by turning on the `DOWNLOAD_MPI_MODEL`. It's slightly faster but less accurate and has less keypoints than the COCO body model.
#### Custom Caffe
#### Custom Caffe (Ubuntu Only)
We only modified some Caffe compilation flags and minor details. You can use your own Caffe distribution, simply specify the Caffe include path and the library as shown below. You will also need to turn off the `BUILD_CAFFE` variable.
<p align="center">
<img src="media/cmake_installation/im_5.png", width="480">
......@@ -173,20 +170,25 @@ We only modified some Caffe compilation flags and minor details. You can use you
#### Custom OpenCV
#### Custom OpenCV (Ubuntu Only)
If you have built OpenCV from source and OpenPose cannot find it automatically, you can set the `OPENCV_DIR` variable to the directory where you build OpenCV.
#### MPI Model
By default, the body MPI model is not downloaded. You can download it by turning on the `DOWNLOAD_MPI_MODEL`.
#### OpenPose 3D Reconstruction Demo (Windows Only)
You can include the 3D Reconstruction Demo by setting the `WITH_3D` option. After installation, check the [doc/openpose_3d_reconstruction_demo.md](./openpose_3d_reconstruction_demo.md) instructions.
#### Doxygen Documentation Autogeneration (Ubuntu Only)
You can generate the documentation by setting the `BUILD_DOCS` flag.
#### CMake Command Line Configuration
#### CMake Command Line Configuration (Ubuntu Only)
Note that this step is unnecessary if you already used the CMake GUI alternative.
Create a `build` folder in the root openpose folder, where you will build the library --
Create a `build` folder in the root OpenPose folder, where you will build the library --
```bash
cd openpose
mkdir build
......
doc/media/cmake_installation/im_3.png

38.8 KB | W: | H:

doc/media/cmake_installation/im_3.png

129.7 KB | W: | H:

doc/media/cmake_installation/im_3.png
doc/media/cmake_installation/im_3.png
doc/media/cmake_installation/im_3.png
doc/media/cmake_installation/im_3.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -48,23 +48,27 @@ The program uses 3 cameras by default, but cameras can be added or removed from
### Windows
1. [Install the OpenPose library](installation.md#installation---library) and make sure the [OpenPose demo runs](quick_start.md#quick-start), so that the required OpenPose library was properly compiled.
2. Open the OpenPose visual studio solution `windows\openpose.sln`.
3. Right-click on `Solution 'OpenPose'` of the `Solution Explorer` window, usually placed at the top-right part of the VS screen.
4. Click on `Properties`. Go to `Configuration Properties` -> `Configuration` and check `Build` for the `OpenPose3DReconstruction` project.
5. Get the last Spinnaker SKD version, i.e. the FLIR camera driver and software:
1. Get the last Spinnaker SKD version, i.e. the FLIR camera driver and software:
- Download last Spinnaker SDK: [https://www.ptgrey.com/support/downloads](https://www.ptgrey.com/support/downloads).
- Copy `{PointGreyParentDirectory}\Point Grey Research\Spinnaker\bin64\vs2015\` as `{OpenPoseDirectory}\3rdparty\windows\spinnaker\bin\`. You can remove all the *.exe files.
- Copy `{PointGreyParentDirectory}\Point Grey Research\Spinnaker\include\` as `{OpenPoseDirectory}\3rdparty\windows\spinnaker\include\`.
- Copy `Spinnaker_v140.lib` and `Spinnakerd_v140.lib` from `{PointGreyParentDirectory}\Point Grey Research\Spinnaker\lib64\vs2015\` into `{OpenPoseDirectory}\3rdparty\windows\spinnaker\lib\`.
- (Optional) Spinnaker SDK overview: [https://www.ptgrey.com/spinnaker-sdk](https://www.ptgrey.com/spinnaker-sdk).
6. Get the last OpenGL Glut library version for the rendering:
1. Option a) Double click on `3rdparty\windows\getFreeglut.bat`.
2. Option b)
- Download the latest `MSVC Package` from [http://www.transmissionzero.co.uk/software/freeglut-devel/](http://www.transmissionzero.co.uk/software/freeglut-devel/).
- Copy `{freeglutParentDirectory}\freeglut\bin\x64\` as `{OpenPoseDirectory}\3rdparty\windows\freeglut\bin\`.
- Copy `{freeglutParentDirectory}\freeglut\include\` as `{OpenPoseDirectory}\3rdparty\windows\freeglut\include\`.
- Copy `{freeglutParentDirectory}\freeglut\lib\x64\` as `{OpenPoseDirectory}\3rdparty\windows\freeglut\lib\`.
2. Get the last OpenGL Glut library version for the rendering:
1. CMake installer version: Nothing to download, it is automatically downloaded.
2. Deprecated Windows installer:
1. Option a) Double click on `3rdparty\windows\getFreeglut.bat`.
2. Option b)
- Download the latest `MSVC Package` from [http://www.transmissionzero.co.uk/software/freeglut-devel/](http://www.transmissionzero.co.uk/software/freeglut-devel/).
- Copy `{freeglutParentDirectory}\freeglut\bin\x64\` as `{OpenPoseDirectory}\3rdparty\windows\freeglut\bin\`.
- Copy `{freeglutParentDirectory}\freeglut\include\` as `{OpenPoseDirectory}\3rdparty\windows\freeglut\include\`.
- Copy `{freeglutParentDirectory}\freeglut\lib\x64\` as `{OpenPoseDirectory}\3rdparty\windows\freeglut\lib\`.
3. [Install the OpenPose library](installation.md#installation---library) and make sure the [OpenPose demo runs](quick_start.md#quick-start), so that the required OpenPose library was properly compiled. If you are using CMake installer, enable the `WITH_3D` option.
4. Open the OpenPose visual studio solution:
1. CMake installer version: `build\openpose.sln`.
2. Deprecated Windows installer: `windows\openpose.sln`.
5. Right-click on `Solution 'OpenPose'` of the `Solution Explorer` window, usually placed at the top-right part of the VS screen.
6. Click on `Properties`. Go to `Configuration Properties` -> `Configuration` and check `Build` for the `OpenPose3DReconstruction` project.
......
......@@ -173,7 +173,8 @@ OpenPose Library - Release Notes
1. Output of `--write_json` uses less hard disk space (enters and tabs removed).
2. Removed Boost dependencies.
3. Caffe added as submodule.
4. Added freeglut download script (3-D reconstruction demo for Windows).
4. CMake installer compatible with Windows.
5. Added freeglut download script (3-D reconstruction demo for Windows).
2. Main bugs fixed:
1. Slight speed up (~1%) for performing the non-maximum suppression stage only in the body part heatmaps channels, and not also in the PAF channels.
......
add_subdirectory(openpose)
add_subdirectory(tests)
add_subdirectory(tutorial_add_module)
add_subdirectory(tutorial_pose)
add_subdirectory(tutorial_thread)
add_subdirectory(tutorial_wrapper)
if (UNIX AND NOT APPLE)
add_subdirectory(tests)
endif (UNIX AND NOT APPLE)
\ No newline at end of file
......@@ -4,10 +4,21 @@ set(EXAMPLE_FILES
foreach(EXAMPLE_FILE ${EXAMPLE_FILES})
get_filename_component(SOURCE_NAME ${EXAMPLE_FILE} NAME_WE)
message(STATUS "Adding Example ${SOURCE_NAME}")
add_executable(${SOURCE_NAME}.bin ${EXAMPLE_FILE})
target_link_libraries( ${SOURCE_NAME}.bin
openpose ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${Caffe_LIBS}
)
if (UNIX AND NOT APPLE)
set(EXE_NAME "${SOURCE_NAME}_bin")
elseif (WIN32)
set(EXE_NAME "OpenPoseDemo")
endif ()
endforeach()
message(STATUS "Adding Example ${EXE_NAME}")
add_executable(${EXE_NAME} ${EXAMPLE_FILE})
target_link_libraries( ${EXE_NAME} openpose ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${Caffe_LIBS})
if (WIN32)
set_property(TARGET ${EXE_NAME} PROPERTY FOLDER "Examples")
configure_file(${CMAKE_SOURCE_DIR}/cmake/OpenPose.vcxproj.user
${CMAKE_CURRENT_BINARY_DIR}/${EXE_NAME}.vcxproj.user @ONLY)
endif (WIN32)
endforeach()
\ No newline at end of file
......@@ -4,11 +4,21 @@ set(EXAMPLE_FILES
foreach(EXAMPLE_FILE ${EXAMPLE_FILES})
get_filename_component(SOURCE_NAME ${EXAMPLE_FILE} NAME_WE)
message(STATUS "Adding Example ${SOURCE_NAME}")
add_executable(${SOURCE_NAME}.bin ${EXAMPLE_FILE})
target_link_libraries( ${SOURCE_NAME}.bin
openpose ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${Caffe_LIBS}
)
if (UNIX AND NOT APPLE)
set(EXE_NAME "${SOURCE_NAME}_bin")
elseif (WIN32)
set(EXE_NAME "${SOURCE_NAME}")
endif ()
endforeach()
message(STATUS "Adding Example ${EXE_NAME}")
add_executable(${EXE_NAME} ${EXAMPLE_FILE})
target_link_libraries( ${EXE_NAME} openpose ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${Caffe_LIBS})
if (WIN32)
set_property(TARGET ${EXE_NAME} PROPERTY FOLDER "Examples/Tutorial/Tests")
configure_file(${CMAKE_SOURCE_DIR}/cmake/OpenPose.vcxproj.user
${CMAKE_CURRENT_BINARY_DIR}/${EXE_NAME}.vcxproj.user @ONLY)
endif (WIN32)
endforeach()
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
set(EXAMPLE_FILES
1_custom_post_processing.cpp)
foreach(EXAMPLE_FILE ${EXAMPLE_FILES})
get_filename_component(SOURCE_NAME ${EXAMPLE_FILE} NAME_WE)
message(STATUS "Adding Example ${SOURCE_NAME}")
add_executable(${SOURCE_NAME}.bin ${EXAMPLE_FILE})
target_link_libraries( ${SOURCE_NAME}.bin
openpose ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${Caffe_LIBS}
)
endforeach()
set(EXAMPLE_FILES
1_custom_post_processing.cpp)
include(${CMAKE_SOURCE_DIR}/cmake/Utils.cmake)
foreach(EXAMPLE_FILE ${EXAMPLE_FILES})
get_filename_component(SOURCE_NAME ${EXAMPLE_FILE} NAME_WE)
if (UNIX AND NOT APPLE)
set(EXE_NAME "${SOURCE_NAME}_bin")
elseif (WIN32)
set(EXE_NAME "${SOURCE_NAME}")
endif ()
message(STATUS "Adding Example ${EXE_NAME}")
add_executable(${EXE_NAME} ${EXAMPLE_FILE})
target_link_libraries( ${EXE_NAME} openpose ${GLOG_LIBRARY} ${GFLAGS_LIBRARY}
${Caffe_LIBS})
if (WIN32)
set_property(TARGET ${EXE_NAME} PROPERTY FOLDER "Examples/Tutorial/AddModule")
configure_file(${CMAKE_SOURCE_DIR}/cmake/OpenPose.vcxproj.user
${CMAKE_CURRENT_BINARY_DIR}/${EXE_NAME}.vcxproj.user @ONLY)
endif (WIN32)
endforeach()
\ No newline at end of file
......@@ -5,10 +5,21 @@ set(EXAMPLE_FILES
foreach(EXAMPLE_FILE ${EXAMPLE_FILES})
get_filename_component(SOURCE_NAME ${EXAMPLE_FILE} NAME_WE)
message(STATUS "Adding Example ${SOURCE_NAME}")
add_executable(${SOURCE_NAME}.bin ${EXAMPLE_FILE})
target_link_libraries( ${SOURCE_NAME}.bin
openpose ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${Caffe_LIBS}
)
if (UNIX AND NOT APPLE)
set(EXE_NAME "${SOURCE_NAME}_bin")
elseif (WIN32)
set(EXE_NAME "${SOURCE_NAME}")
endif ()
endforeach()
message(STATUS "Adding Example ${EXE_NAME}")
add_executable(${EXE_NAME} ${EXAMPLE_FILE})
target_link_libraries(${EXE_NAME} openpose ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${Caffe_LIBS})
if (WIN32)
set_property(TARGET ${EXE_NAME} PROPERTY FOLDER "Examples/Tutorial/Pose")
configure_file(${CMAKE_SOURCE_DIR}/cmake/OpenPose.vcxproj.user
${CMAKE_CURRENT_BINARY_DIR}/${EXE_NAME}.vcxproj.user @ONLY)
endif (WIN32)
endforeach()
\ No newline at end of file
......@@ -7,10 +7,21 @@ set(EXAMPLE_FILES
foreach(EXAMPLE_FILE ${EXAMPLE_FILES})
get_filename_component(SOURCE_NAME ${EXAMPLE_FILE} NAME_WE)
message(STATUS "Adding Example ${SOURCE_NAME}")
add_executable(${SOURCE_NAME}.bin ${EXAMPLE_FILE})
target_link_libraries( ${SOURCE_NAME}.bin
openpose ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${Caffe_LIBS}
)
if (UNIX AND NOT APPLE)
set(EXE_NAME "${SOURCE_NAME}_bin")
elseif (WIN32)
set(EXE_NAME "${SOURCE_NAME}")
endif ()
endforeach()
message(STATUS "Adding Example ${EXE_NAME}")
add_executable(${EXE_NAME} ${EXAMPLE_FILE})
target_link_libraries( ${EXE_NAME} openpose ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${Caffe_LIBS})
if (WIN32)
set_property(TARGET ${EXE_NAME} PROPERTY FOLDER "Examples/Tutorial/Thread")
configure_file(${CMAKE_SOURCE_DIR}/cmake/OpenPose.vcxproj.user
${CMAKE_CURRENT_BINARY_DIR}/${EXE_NAME}.vcxproj.user @ONLY)
endif (WIN32)
endforeach()
\ No newline at end of file
......@@ -3,13 +3,26 @@ set(EXAMPLE_FILES
2_user_synchronous.cpp
3_user_asynchronous.cpp)
include(${CMAKE_SOURCE_DIR}/cmake/Utils.cmake)
foreach(EXAMPLE_FILE ${EXAMPLE_FILES})
get_filename_component(SOURCE_NAME ${EXAMPLE_FILE} NAME_WE)
message(STATUS "Adding Example ${SOURCE_NAME}")
add_executable(${SOURCE_NAME}.bin ${EXAMPLE_FILE})
target_link_libraries( ${SOURCE_NAME}.bin
openpose ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${Caffe_LIBS}
)
if (UNIX AND NOT APPLE)
set(EXE_NAME "${SOURCE_NAME}_bin")
elseif (WIN32)
set(EXE_NAME "${SOURCE_NAME}")
endif ()
message(STATUS "Adding Example ${EXE_NAME}")
add_executable(${EXE_NAME} ${EXAMPLE_FILE})
target_link_libraries( ${EXE_NAME} openpose ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${Caffe_LIBS})
if (WIN32)
set_property(TARGET ${EXE_NAME} PROPERTY FOLDER "Examples/Tutorial/Wrapper")
configure_file(${CMAKE_SOURCE_DIR}/cmake/OpenPose.vcxproj.user
${CMAKE_CURRENT_BINARY_DIR}/${EXE_NAME}.vcxproj.user @ONLY)
endif (WIN32)
endforeach()
endforeach()
\ No newline at end of file
add_subdirectory(openpose3d)
\ No newline at end of file
if (WIN32)
set(OPENPOSE_3D_INCLUDES include)
file(GLOB_RECURSE OPENPOSE_3D_SOURCES "*.cpp")
set(EXAMPLE_FILES openpose3d.cpp)
include(${CMAKE_SOURCE_DIR}/cmake/Utils.cmake)
foreach (EXAMPLE_FILE ${EXAMPLE_FILES})
get_filename_component(SOURCE_NAME ${EXAMPLE_FILE} NAME_WE)
set(EXE_NAME "${SOURCE_NAME}")
message(STATUS "Adding Example ${EXE_NAME}")
add_executable(${EXE_NAME} ${EXAMPLE_FILE} ${OPENPOSE_3D_SOURCES})
target_include_directories(${EXE_NAME} PUBLIC ${OPENPOSE_3D_INCLUDES})
target_link_libraries(${EXE_NAME} openpose ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${Caffe_LIBS}
${Freeglut_LIB} ${Spinnaker_LIB})
set_property(TARGET ${EXE_NAME} PROPERTY FOLDER "Examples/Tutorial/OpenPose3DReconstruction")
configure_file(${CMAKE_SOURCE_DIR}/cmake/OpenPose3D.vcxproj.user
${CMAKE_CURRENT_BINARY_DIR}/${EXE_NAME}.vcxproj.user @ONLY)
endforeach ()
endif (WIN32)
\ No newline at end of file
add_subdirectory(openpose)
add_subdirectory(openpose)
\ No newline at end of file
add_subdirectory(core)
add_subdirectory(experimental)
add_subdirectory(filestream)
add_subdirectory(gui)
add_subdirectory(pose)
add_subdirectory(utilities)
add_subdirectory(producer)
add_subdirectory(thread)
add_subdirectory(face)
add_subdirectory(hand)
add_subdirectory(wrapper)
set_target_properties(openpose_core openpose_face openpose_filestream
openpose_gui openpose_hand openpose_pose openpose_producer
openpose_utilities openpose_thread openpose_tracking openpose_wrapper
PROPERTIES COMPILE_FLAGS ${OP_CXX_FLAGS})
# make the openpose.so
add_library(caffe SHARED IMPORTED)
set_property(TARGET caffe PROPERTY IMPORTED_LOCATION ${Caffe_LIBS})
file(GLOB_RECURSE SOURCES "*.cu" "*.cpp") # It's better not to hardcode here.
cuda_add_library(openpose ${SOURCES})
target_link_libraries(openpose ${OpenCV_LIBS} caffe)
if (BUILD_CAFFE)
include(${CMAKE_SOURCE_DIR}/cmake/Utils.cmake)
subdirlist(SUB_DIRS ${CMAKE_CURRENT_SOURCE_DIR})
foreach (SUB_DIR ${SUB_DIRS})
add_subdirectory(${SUB_DIR})
endforeach (SUB_DIR ${SUB_DIRS})
# make the openpose.so/dll
file(GLOB_RECURSE OP_HEADERS_UNFILTERED "${CMAKE_SOURCE_DIR}/include/openpose/*.h"
"${CMAKE_SOURCE_DIR}/include/openpose/*.hpp"
"${CMAKE_SOURCE_DIR}/include/openpose/*.hu")
set(OP_HEADERS "")
foreach (FILE ${OP_HEADERS_UNFILTERED})
if (NOT FILE MATCHES "${CMAKE_SOURCE_DIR}/include/openpose/experimental/*")
list(APPEND OP_HEADERS ${FILE})
endif ()
endforeach(FILE ${OP_HEADERS_UNFILTERED})
cuda_add_library(openpose ${SOURCES_OPENPOSE} ${OP_HEADERS})
# Ubuntu
if(UNIX AND NOT APPLE)
target_link_libraries(openpose ${OpenCV_LIBS} ${Caffe_LIBS}
${GFLAGS_LIBRARY} ${GLOG_LIBRARY})
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})
endif (CMAKE_COMPILER_IS_GNUCXX)
# Windows
elseif (WIN32)
target_link_libraries(openpose ${OpenCV_LIBS} ${Caffe_LIBS}
debug ${GFLAGS_LIBRARY_DEBUG} optimized ${GFLAGS_LIBRARY_RELEASE}
debug ${GLOG_LIBRARY_DEBUG} optimized ${GLOG_LIBRARY_RELEASE})
if (${DL_FRAMEWORK} MATCHES "CAFFE")
target_compile_definitions(openpose PRIVATE BOOST_ALL_NO_LIB)
endif(${DL_FRAMEWORK} MATCHES "CAFFE")
# source_group("Header Files" FILES ${CMAKE_SOURCE_DIR}/include)
set_property(TARGET openpose PROPERTY FOLDER "OpenPose library")
foreach (SUB_DIR ${SUB_DIRS})
string(TOUPPER ${SUB_DIR} SUB_DIR_UPPERCASE)
source_group("Source Files\\${SUB_DIR}" FILES ${SOURCES_OP_${SUB_DIR_UPPERCASE}_WITH_CP} "*")
file(GLOB_RECURSE SUB_MOD_HEADERS "${CMAKE_SOURCE_DIR}/include/openpose/${SUB_DIR}/*.h"
"${CMAKE_SOURCE_DIR}/include/openpose/${SUB_DIR}/*.hpp"
"${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)
endif (UNIX AND NOT APPLE)
if (UNIX AND NOT APPLE)
add_library(caffe SHARED IMPORTED)
set_property(TARGET caffe PROPERTY IMPORTED_LOCATION ${Caffe_LIBS})
target_link_libraries(openpose caffe)
if (BUILD_CAFFE)
add_dependencies(openpose openpose_caffe)
endif (BUILD_CAFFE)
endif (BUILD_CAFFE)
set_property(TARGET openpose PROPERTY VERSION ${OpenPose_VERSION})
set_property(TARGET openpose PROPERTY VERSION ${OpenPose_VERSION})
install(TARGETS openpose
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
install(TARGETS openpose
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
endif (UNIX AND NOT APPLE)
cuda_add_library(openpose_core
set(SOURCES_OP_CORE
array.cpp
cvMatToOpInput.cpp
cvMatToOpOutput.cpp
......@@ -22,17 +22,24 @@ cuda_add_library(openpose_core
resizeAndMergeCaffe.cpp
scaleAndSizeExtractor.cpp)
add_library(caffe SHARED IMPORTED)
set_property(TARGET caffe PROPERTY IMPORTED_LOCATION ${Caffe_LIBS})
include(${CMAKE_SOURCE_DIR}/cmake/Utils.cmake)
prepend(SOURCES_OP_CORE_WITH_CP ${CMAKE_CURRENT_SOURCE_DIR} ${SOURCES_OP_CORE})
set(SOURCES_OP_CORE_WITH_CP ${SOURCES_OP_CORE_WITH_CP} PARENT_SCOPE)
set(SOURCES_OPENPOSE ${SOURCES_OPENPOSE} ${SOURCES_OP_CORE_WITH_CP} PARENT_SCOPE)
target_link_libraries(openpose_core caffe)
if (UNIX AND NOT APPLE)
cuda_add_library(openpose_core ${SOURCES_OP_CORE})
add_library(caffe SHARED IMPORTED)
set_property(TARGET caffe PROPERTY IMPORTED_LOCATION ${Caffe_LIBS})
target_link_libraries(openpose_core caffe)
if (BUILD_CAFFE)
add_dependencies(openpose_core openpose_caffe)
endif (BUILD_CAFFE)
if (BUILD_CAFFE)
add_dependencies(openpose_core openpose_caffe)
endif (BUILD_CAFFE)
install(TARGETS openpose_core
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
install(TARGETS openpose_core
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
endif (UNIX AND NOT APPLE)
add_subdirectory(tracking)
if (UNIX AND NOT APPLE)
add_custom_target(openpose_experimental)
add_dependencies(openpose_experimental openpose_tracking)
endif (UNIX AND NOT APPLE)
set(SOURCES_OPENPOSE ${SOURCES_OPENPOSE} PARENT_SCOPE)
\ No newline at end of file
set(SOURCES
set(SOURCES_OP_TRACKING
defineTemplates.cpp
personIdExtractor.cpp)
add_library(openpose_tracking ${SOURCES})
include(${CMAKE_SOURCE_DIR}/cmake/Utils.cmake)
prepend(SOURCES_OP_TRACKING_WITH_CP ${CMAKE_CURRENT_SOURCE_DIR} ${SOURCES_OP_TRACKING})
set(SOURCES_OP_TRACKING_WITH_CP ${SOURCES_OP_TRACKING_WITH_CP} PARENT_SCOPE)
set(SOURCES_OPENPOSE ${SOURCES_OPENPOSE} ${SOURCES_OP_TRACKING_WITH_CP} PARENT_SCOPE)
install(TARGETS openpose_tracking
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
if (UNIX AND NOT APPLE)
add_library(openpose_tracking ${SOURCES_OP_TRACKING})
set_target_properties(openpose_tracking PROPERTIES COMPILE_FLAGS ${OP_CXX_FLAGS})
install(TARGETS openpose_tracking
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
endif (UNIX AND NOT APPLE)
\ No newline at end of file
set(SOURCES
set(SOURCES_OP_FACE
defineTemplates.cpp
faceDetector.cpp
faceDetectorOpenCV.cpp
......@@ -7,16 +7,23 @@ set(SOURCES
faceCpuRenderer.cpp
faceGpuRenderer.cpp
renderFace.cpp
renderFace.cu
)
renderFace.cu)
cuda_add_library(openpose_face ${SOURCES})
if (BUILD_CAFFE)
add_dependencies(openpose_face openpose_caffe)
endif (BUILD_CAFFE)
include(${CMAKE_SOURCE_DIR}/cmake/Utils.cmake)
prepend(SOURCES_OP_FACE_WITH_CP ${CMAKE_CURRENT_SOURCE_DIR} ${SOURCES_OP_FACE})
set(SOURCES_OP_FACE_WITH_CP ${SOURCES_OP_FACE_WITH_CP} PARENT_SCOPE)
set(SOURCES_OPENPOSE ${SOURCES_OPENPOSE} ${SOURCES_OP_FACE_WITH_CP} PARENT_SCOPE)
install(TARGETS openpose_face
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
if (UNIX AND NOT APPLE)
cuda_add_library(openpose_face ${SOURCES_OP_FACE})
if (BUILD_CAFFE)
add_dependencies(openpose_face openpose_caffe)
endif (BUILD_CAFFE)
install(TARGETS openpose_face
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
endif (UNIX AND NOT APPLE)
set(SOURCES cocoJsonSaver.cpp
set(SOURCES_OP_FILESTREAM cocoJsonSaver.cpp
defineTemplates.cpp
fileSaver.cpp
fileStream.cpp
......@@ -9,10 +9,17 @@ set(SOURCES cocoJsonSaver.cpp
peopleJsonSaver.cpp
videoSaver.cpp)
add_library(openpose_filestream ${SOURCES})
include(${CMAKE_SOURCE_DIR}/cmake/Utils.cmake)
prepend(SOURCES_OP_FILESTREAM_WITH_CP ${CMAKE_CURRENT_SOURCE_DIR} ${SOURCES_OP_FILESTREAM})
set(SOURCES_OP_FILESTREAM_WITH_CP ${SOURCES_OP_FILESTREAM_WITH_CP} PARENT_SCOPE)
set(SOURCES_OPENPOSE ${SOURCES_OPENPOSE} ${SOURCES_OP_FILESTREAM_WITH_CP} PARENT_SCOPE)
install(TARGETS openpose_filestream
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
if (UNIX AND NOT APPLE)
add_library(openpose_filestream ${SOURCES_OP_FILESTREAM})
install(TARGETS openpose_filestream
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
endif (UNIX AND NOT APPLE)
set(SOURCES
CMakeLists.txt
set(SOURCES_OP_GUI
defineTemplates.cpp
frameDisplayer.cpp
gui.cpp
guiInfoAdder.cpp
)
add_library(openpose_gui ${SOURCES})
target_link_libraries(openpose_gui openpose_pose ${OpenCV_LIBS})
include(${CMAKE_SOURCE_DIR}/cmake/Utils.cmake)
set(SOURCES_OP_GUI_WITH_CP "" PARENT_SCOPE)
prepend(SOURCES_OP_GUI_WITH_CP ${CMAKE_CURRENT_SOURCE_DIR} ${SOURCES_OP_GUI})
set(SOURCES_OP_GUI_WITH_CP ${SOURCES_OP_GUI_WITH_CP} PARENT_SCOPE)
set(SOURCES_OP_FILESTREAM_WITH_CP ${SOURCES_OP_FILESTREAM_WITH_CP} PARENT_SCOPE)
set(SOURCES_OPENPOSE ${SOURCES_OPENPOSE} ${SOURCES_OP_GUI_WITH_CP} PARENT_SCOPE)
install(TARGETS openpose_gui
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
if (UNIX AND NOT APPLE)
add_library(openpose_gui ${SOURCES_OP_GUI})
target_link_libraries(openpose_gui openpose_pose ${OpenCV_LIBS})
install(TARGETS openpose_gui
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
endif (UNIX AND NOT APPLE)
set(SOURCES
set(SOURCES_OP_HAND
defineTemplates.cpp
handDetector.cpp
handDetectorFromTxt.cpp
......@@ -9,13 +9,21 @@ set(SOURCES
renderHand.cpp
renderHand.cu)
cuda_add_library(openpose_hand ${SOURCES})
if (BUILD_CAFFE)
add_dependencies(openpose_hand openpose_caffe)
endif (BUILD_CAFFE)
include(${CMAKE_SOURCE_DIR}/cmake/Utils.cmake)
prepend(SOURCES_OP_HAND_WITH_CP ${CMAKE_CURRENT_SOURCE_DIR} ${SOURCES_OP_HAND})
set(SOURCES_OP_HAND_WITH_CP ${SOURCES_OP_HAND_WITH_CP} PARENT_SCOPE)
set(SOURCES_OPENPOSE ${SOURCES_OPENPOSE} ${SOURCES_OP_HAND_WITH_CP} PARENT_SCOPE)
install(TARGETS openpose_hand
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
if (UNIX AND NOT APPLE)
cuda_add_library(openpose_hand ${SOURCES_OP_HAND})
if (BUILD_CAFFE)
add_dependencies(openpose_hand openpose_caffe)
endif (BUILD_CAFFE)
install(TARGETS openpose_hand
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
endif (UNIX AND NOT APPLE)
set(SOURCES
set(SOURCES_OP_POSE
bodyPartConnectorBase.cpp
bodyPartConnectorBase.cu
bodyPartConnectorCaffe.cpp
......@@ -13,13 +13,21 @@ set(SOURCES
renderPose.cpp
renderPose.cu)
cuda_add_library(openpose_pose ${SOURCES})
if (BUILD_CAFFE)
add_dependencies(openpose_pose openpose_caffe)
endif (BUILD_CAFFE)
include(${CMAKE_SOURCE_DIR}/cmake/Utils.cmake)
prepend(SOURCES_OP_POSE_WITH_CP ${CMAKE_CURRENT_SOURCE_DIR} ${SOURCES_OP_POSE})
set(SOURCES_OP_POSE_WITH_CP ${SOURCES_OP_POSE_WITH_CP} PARENT_SCOPE)
set(SOURCES_OPENPOSE ${SOURCES_OPENPOSE} ${SOURCES_OP_POSE_WITH_CP} PARENT_SCOPE)
install(TARGETS openpose_pose
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
if (UNIX AND NOT APPLE)
cuda_add_library(openpose_pose ${SOURCES_OP_POSE})
if (BUILD_CAFFE)
add_dependencies(openpose_pose openpose_caffe)
endif (BUILD_CAFFE)
install(TARGETS openpose_pose
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
endif (UNIX AND NOT APPLE)
set(SOURCES
set(SOURCES_OP_PRODUCER
defineTemplates.cpp
imageDirectoryReader.cpp
ipCameraReader.cpp
......@@ -7,12 +7,19 @@ set(SOURCES
videoReader.cpp
webcamReader.cpp)
add_library(openpose_producer ${SOURCES})
target_link_libraries(openpose_producer ${OpenCV_LIBS} openpose_core
openpose_filestream openpose_thread)
include(${CMAKE_SOURCE_DIR}/cmake/Utils.cmake)
prepend(SOURCES_OP_PRODUCER_WITH_CP ${CMAKE_CURRENT_SOURCE_DIR} ${SOURCES_OP_PRODUCER})
set(SOURCES_OP_PRODUCER_WITH_CP ${SOURCES_OP_PRODUCER_WITH_CP} PARENT_SCOPE)
set(SOURCES_OPENPOSE ${SOURCES_OPENPOSE} ${SOURCES_OP_PRODUCER_WITH_CP} PARENT_SCOPE)
install(TARGETS openpose_producer
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
if (UNIX AND NOT APPLE)
add_library(openpose_producer ${SOURCES_OP_PRODUCER})
target_link_libraries(openpose_producer ${OpenCV_LIBS} openpose_core
openpose_thread openpose_filestream)
install(TARGETS openpose_producer
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
endif (UNIX AND NOT APPLE)
set(SOURCES
set(SOURCES_OP_THREAD
defineTemplates.cpp)
add_library(openpose_thread ${SOURCES})
include(${CMAKE_SOURCE_DIR}/cmake/Utils.cmake)
prepend(SOURCES_OP_THREAD_WITH_CP ${CMAKE_CURRENT_SOURCE_DIR} ${SOURCES_OP_THREAD})
set(SOURCES_OP_THREAD_WITH_CP ${SOURCES_OP_THREAD_WITH_CP} PARENT_SCOPE)
set(SOURCES_OPENPOSE ${SOURCES_OPENPOSE} ${SOURCES_OP_THREAD_WITH_CP} PARENT_SCOPE)
install(TARGETS openpose_thread
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
if (UNIX AND NOT APPLE)
add_library(openpose_thread ${SOURCES_OP_THREAD})
install(TARGETS openpose_thread
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
endif (UNIX AND NOT APPLE)
set(SOURCES
set(SOURCES_OP_UTILITIES
cuda.cpp
errorAndLog.cpp
fileSystem.cpp
......@@ -8,11 +8,18 @@ set(SOURCES
profiler.cpp
string.cpp)
cuda_add_library(openpose_utilities ${SOURCES})
target_link_libraries(openpose_utilities openpose_filestream openpose_producer)
include(${CMAKE_SOURCE_DIR}/cmake/Utils.cmake)
prepend(SOURCES_OP_UTILITIES_WITH_CP ${CMAKE_CURRENT_SOURCE_DIR} ${SOURCES_OP_UTILITIES})
set(SOURCES_OP_UTILITIES_WITH_CP ${SOURCES_OP_UTILITIES_WITH_CP} PARENT_SCOPE)
set(SOURCES_OPENPOSE ${SOURCES_OPENPOSE} ${SOURCES_OP_UTILITIES_WITH_CP} PARENT_SCOPE)
install(TARGETS openpose_utilities
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
if (UNIX AND NOT APPLE)
cuda_add_library(openpose_utilities ${SOURCES_OP_UTILITIES})
target_link_libraries(openpose_utilities openpose_producer openpose_filestream)
install(TARGETS openpose_utilities
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
endif (UNIX AND NOT APPLE)
set(SOURCES
set(SOURCES_OP_WRAPPER
defineTemplates.cpp
wrapperStructFace.cpp
wrapperStructHand.cpp
......@@ -6,13 +6,20 @@ set(SOURCES
wrapperStructOutput.cpp
wrapperStructPose.cpp)
add_library(openpose_wrapper ${SOURCES})
target_link_libraries(openpose_wrapper openpose_core openpose_face openpose_filestream
openpose_gui openpose_hand openpose_pose openpose_producer openpose_thread
openpose_tracking openpose_utilities)
include(${CMAKE_SOURCE_DIR}/cmake/Utils.cmake)
prepend(SOURCES_OP_WRAPPER_WITH_CP ${CMAKE_CURRENT_SOURCE_DIR} ${SOURCES_OP_WRAPPER})
set(SOURCES_OP_WRAPPER_WITH_CP ${SOURCES_OP_WRAPPER_WITH_CP} PARENT_SCOPE)
set(SOURCES_OPENPOSE ${SOURCES_OPENPOSE} ${SOURCES_OP_WRAPPER_WITH_CP} PARENT_SCOPE)
install(TARGETS openpose_wrapper
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
if (UNIX AND NOT APPLE)
add_library(openpose_wrapper ${SOURCES_OP_WRAPPER})
target_link_libraries(openpose_wrapper openpose_thread openpose_pose openpose_hand
openpose_core openpose_face openpose_filestream openpose_gui openpose_producer
openpose_utilities)
install(TARGETS openpose_wrapper
EXPORT OpenPose
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/openpose)
endif (UNIX AND NOT APPLE)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册