Skip to content

Commit

Permalink
OpenPose debug fully working & added some 3rdparty debug libs
Browse files Browse the repository at this point in the history
  • Loading branch information
gineshidalgo99 committed Apr 6, 2020
1 parent eab3210 commit 6b3652b
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 26 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/windows/getCaffe.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SET WGET_EXE=wget\wget.exe
:: Download temporary zip
echo ----- Downloading Caffe -----
SET CAFEE_FOLDER=caffe\
SET ZIP_NAME=caffe_15_2019_05_16.zip
SET ZIP_NAME=caffe_15_2020_04_05.zip
SET ZIP_FULL_PATH=%CAFEE_FOLDER%%ZIP_NAME%
%WGET_EXE% -c http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/%ZIP_NAME% -P %CAFEE_FOLDER%
echo:
Expand Down
57 changes: 35 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ if (WIN32)
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)
# Turn on C++11
add_definitions(-std=c++11)
Expand Down Expand Up @@ -508,6 +504,7 @@ if (UNIX OR APPLE)
if (${GPU_MODE} MATCHES "CUDA")
# Set CUDA Flags
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++11")
set(CUDA_NVCC_FLAGS_DEBUG "${CUDA_NVCC_FLAGS_DEBUG} -D_DEBUG -g")

if (NOT CUDA_FOUND)
message(STATUS "CUDA not found.")
Expand Down Expand Up @@ -563,7 +560,7 @@ if (WIN32)
download_zip("caffe_cpu_2018_05_27.zip" ${OP_WIN_URL} ${FIND_LIB_PREFIX} 87E8401B6DFBAC5B8E909DD20E3B3390)
else (${GPU_MODE} MATCHES "OPENCL")
# download_zip("caffe_2019_03_12.zip" ${OP_WIN_URL} ${FIND_LIB_PREFIX} 859a592310f0928fd4f40da1456a217f)
download_zip("caffe_15_2019_05_16.zip" ${OP_WIN_URL} ${FIND_LIB_PREFIX} 12F7A675A3276CD33C76B37D21C2F421)
download_zip("caffe_15_2020_04_05.zip" ${OP_WIN_URL} ${FIND_LIB_PREFIX} cd4ec4d709a70c94aa6b151d2d040300)
endif (${GPU_MODE} MATCHES "OPENCL")
if (WITH_3D_RENDERER)
download_zip("freeglut_2018_01_14.zip" ${OP_WIN_URL} ${FIND_LIB_PREFIX} BB182187285E06880F0EDE3A39530091)
Expand All @@ -572,7 +569,8 @@ if (WIN32)

# set(VS_VERSION "14")
set(VS_VERSION "15") # Note: VS2017 code seems to simply works in VS2015
find_library(OpenCV_LIBS opencv_world420 HINTS ${FIND_LIB_PREFIX}/opencv/x64/vc${VS_VERSION}/lib)
find_library(OpenCV_LIBS_RELEASE opencv_world420 HINTS ${FIND_LIB_PREFIX}/opencv/x64/vc${VS_VERSION}/lib)
find_library(OpenCV_LIBS_DEBUG opencv_world420d HINTS ${FIND_LIB_PREFIX}/opencv/x64/vc${VS_VERSION}/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)
Expand All @@ -581,26 +579,32 @@ if (WIN32)
# If OpenPose builds it
if (BUILD_CAFFE)
unset(Caffe_INCLUDE_DIRS CACHE)
unset(Caffe_LIB CACHE)
unset(Caffe_Proto_LIB CACHE)
unset(Caffe_LIB_RELEASE CACHE)
unset(Caffe_Proto_LIB_RELEASE CACHE)
endif (BUILD_CAFFE)
# OpenCL
if (${GPU_MODE} MATCHES "OPENCL")
set(VCXPROJ_FILE_GPU_MODE "_CL")
find_library(Caffe_LIB caffe HINTS ${FIND_LIB_PREFIX}/caffe_opencl/lib)
find_library(Caffe_Proto_LIB caffeproto HINTS ${FIND_LIB_PREFIX}/caffe_opencl/lib)
find_library(Caffe_LIB_RELEASE caffe HINTS ${FIND_LIB_PREFIX}/caffe_opencl/lib)
find_library(Caffe_Proto_LIB_RELEASE caffeproto HINTS ${FIND_LIB_PREFIX}/caffe_opencl/lib)
find_library(Caffe_LIB_DEBUG caffe-d HINTS ${FIND_LIB_PREFIX}/caffe_opencl/lib)
find_library(Caffe_Proto_LIB_DEBUG caffeproto-d HINTS ${FIND_LIB_PREFIX}/caffe_opencl/lib)
# CPU & CUDA
else (${GPU_MODE} MATCHES "OPENCL")
# CPU
if (${GPU_MODE} MATCHES "CPU_ONLY")
set(VCXPROJ_FILE_GPU_MODE "_CPU")
find_library(Caffe_LIB caffe HINTS ${FIND_LIB_PREFIX}/caffe_cpu/lib)
find_library(Caffe_Proto_LIB caffeproto HINTS ${FIND_LIB_PREFIX}/caffe_cpu/lib)
find_library(Caffe_LIB_RELEASE caffe HINTS ${FIND_LIB_PREFIX}/caffe_cpu/lib)
find_library(Caffe_Proto_LIB_RELEASE caffeproto HINTS ${FIND_LIB_PREFIX}/caffe_cpu/lib)
find_library(Caffe_LIB_DEBUG caffe-d HINTS ${FIND_LIB_PREFIX}/caffe_cpu/lib)
find_library(Caffe_Proto_LIB_DEBUG caffeproto-d HINTS ${FIND_LIB_PREFIX}/caffe_cpu/lib)
# CUDA
else (${GPU_MODE} MATCHES "CPU_ONLY")
set(VCXPROJ_FILE_GPU_MODE "")
find_library(Caffe_LIB caffe HINTS ${FIND_LIB_PREFIX}/caffe/lib)
find_library(Caffe_Proto_LIB caffeproto HINTS ${FIND_LIB_PREFIX}/caffe/lib)
find_library(Caffe_LIB_RELEASE caffe HINTS ${FIND_LIB_PREFIX}/caffe/lib)
find_library(Caffe_Proto_LIB_RELEASE caffeproto HINTS ${FIND_LIB_PREFIX}/caffe/lib)
find_library(Caffe_LIB_DEBUG caffe-d HINTS ${FIND_LIB_PREFIX}/caffe/lib)
find_library(Caffe_Proto_LIB_DEBUG caffeproto-d HINTS ${FIND_LIB_PREFIX}/caffe/lib)
endif (${GPU_MODE} MATCHES "CPU_ONLY")
endif (${GPU_MODE} MATCHES "OPENCL")
# Boost DepCopy over required DLL F
Expand All @@ -622,7 +626,8 @@ if (WIN32)
if (WITH_FLIR_CAMERA)
find_library(SPINNAKER_LIB spinnaker_v140 HINTS ${FIND_LIB_PREFIX}/spinnaker/lib)
endif (WITH_FLIR_CAMERA)
set(Caffe_LIBS ${Caffe_LIB};${Caffe_Proto_LIB})
set(Caffe_LIBS_RELEASE "${Caffe_LIB_RELEASE};${Caffe_Proto_LIB_RELEASE}")
set(Caffe_LIBS_DEBUG "${Caffe_LIB_DEBUG};${Caffe_Proto_LIB_DEBUG}")
set(OpenCV_INCLUDE_DIRS "3rdparty/windows/opencv/include")
# OpenCL
if (${GPU_MODE} MATCHES "OPENCL")
Expand Down Expand Up @@ -691,11 +696,11 @@ endif (WIN32)
if (UNIX OR APPLE)
if (${DL_FRAMEWORK} MATCHES "CAFFE" OR ${DL_FRAMEWORK} MATCHES "NV_CAFFE")
# Check if the user specified caffe paths
if (Caffe_INCLUDE_DIRS AND Caffe_LIBS AND NOT BUILD_CAFFE)
if (Caffe_INCLUDE_DIRS AND Caffe_LIBS_RELEASE 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})
message(STATUS "\${Caffe_LIBS_RELEASE} set by the user to " ${Caffe_LIBS_RELEASE})
set(Caffe_FOUND 1)
endif (Caffe_INCLUDE_DIRS AND Caffe_LIBS AND NOT BUILD_CAFFE)
endif (Caffe_INCLUDE_DIRS AND Caffe_LIBS_RELEASE AND NOT BUILD_CAFFE)

# Else build from scratch
if (BUILD_CAFFE)
Expand Down Expand Up @@ -907,17 +912,26 @@ endif (WIN32)


### COLLECT ALL 3RD-PARTY LIBRARIES TO BE LINKED AGAINST
set(OpenPose_3rdparty_libraries ${OpenCV_LIBS} ${GLOG_LIBRARY})
if (UNIX OR APPLE)
set(OpenPose_3rdparty_libraries ${OpenPose_3rdparty_libraries} ${GLOG_LIBRARY})
set(OpenPose_3rdparty_libraries ${OpenPose_3rdparty_libraries} ${OpenCV_LIBS} ${GLOG_LIBRARY})
elseif (WIN32)
set(OpenPose_3rdparty_libraries ${OpenPose_3rdparty_libraries}
debug ${OpenCV_LIBS_DEBUG} optimized ${OpenCV_LIBS_RELEASE}
debug ${GFLAGS_LIBRARY_DEBUG} optimized ${GFLAGS_LIBRARY_RELEASE}
debug ${GLOG_LIBRARY_DEBUG} optimized ${GLOG_LIBRARY_RELEASE})
endif (UNIX OR APPLE)
# G Flags (for demos)
if (UNIX OR APPLE)
set(examples_3rdparty_libraries ${OpenPose_3rdparty_libraries} ${GFLAGS_LIBRARY})
endif (UNIX OR APPLE)
# Deep net Framework
if (${DL_FRAMEWORK} MATCHES "CAFFE" OR ${DL_FRAMEWORK} MATCHES "NV_CAFFE")
set(OpenPose_3rdparty_libraries ${OpenPose_3rdparty_libraries} ${Caffe_LIBS} ${GFLAGS_LIBRARY})
if (UNIX OR APPLE)
set(OpenPose_3rdparty_libraries ${OpenPose_3rdparty_libraries} ${Caffe_LIBS})
elseif (WIN32)
set(OpenPose_3rdparty_libraries ${OpenPose_3rdparty_libraries}
debug ${Caffe_LIBS_DEBUG} optimized ${Caffe_LIBS_RELEASE})
endif (UNIX OR APPLE)
endif (${DL_FRAMEWORK} MATCHES "CAFFE" OR ${DL_FRAMEWORK} MATCHES "NV_CAFFE")
# CPU vs. GPU
if (USE_MKL)
Expand Down Expand Up @@ -954,7 +968,6 @@ if (UNIX OR APPLE)
set(OpenPose_3rdparty_libraries ${OpenPose_3rdparty_libraries} pthread)
endif (UNIX OR APPLE)

set(examples_3rdparty_libraries ${OpenPose_3rdparty_libraries} ${GFLAGS_LIBRARY})


### ADD SUBDIRECTORIES
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Just comment on GitHub or make a pull request and we will answer as soon as poss


## Citation
Please cite these papers in your publications if it helps your research. For standard OpenPose, cite `[8765346]`. If you also use the hand and face keypoint detectors, then cite `[8765346]` and `[Simon et al. 2017]` (the face detector was trained using the same procedure than the hand detector).
Please cite these papers in your publications if it helps your research. Most of OpenPose is based on `[8765346]`. In addition, the hand and face keypoint detectors are a combination of `[8765346]` and `[Simon et al. 2017]` (the face detector was trained using the same procedure than the hand detector).

@article{8765346,
author = {Z. {Cao} and G. {Hidalgo Martinez} and T. {Simon} and S. {Wei} and Y. A. {Sheikh}},
Expand Down
2 changes: 1 addition & 1 deletion doc/installation_deprecated.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Note: This installer will not incorporate any new features, we recommend to use
- [Face model](http://posefs1.perception.cs.cmu.edu/OpenPose/models/face/pose_iter_116000.caffemodel): download in `models/face/`.
- [Hands model](http://posefs1.perception.cs.cmu.edu/OpenPose/models/hand/pose_iter_102000.caffemodel): download in `models/hand/`.
- Dependencies:
- [Caffe](http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/caffe_15_2019_05_16.zip): Unzip as `3rdparty/windows/caffe/`.
- [Caffe](http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/caffe_15_2020_04_05.zip): Unzip as `3rdparty/windows/caffe/`.
- [Caffe dependencies](http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/caffe3rdparty_15_2019_03_14.zip): Unzip as `3rdparty/windows/caffe3rdparty/`.
- [OpenCV 4.2.0](http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/opencv_420_v14_15_2020_04_04.zip): Unzip as `3rdparty/windows/opencv/`.
2. Open the Visual Studio project sln file by double-cliking on `{openpose_path}\windows\OpenPose.sln`.
Expand Down
2 changes: 1 addition & 1 deletion doc/prerequisites.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ NOTE: These instructions are only required when compiling OpenPose brom source.
- Dependencies:
- Note: Leave the zip files in `3rdparty/windows/` so that CMake does not try to download them again.
- Caffe (if you are not sure which one you need, donwload the default one):
- [CUDA Caffe (Default)](http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/caffe_15_2019_05_16.zip): Unzip as `3rdparty/windows/caffe/`.
- [CUDA Caffe (Default)](http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/caffe_15_2020_04_05.zip): Unzip as `3rdparty/windows/caffe/`.
- [CPU Caffe](http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/caffe_cpu_2018_05_27.zip): Unzip as `3rdparty/windows/caffe_cpu/`.
- [OpenCL Caffe](http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/caffe_opencl_2018_02_13.zip): Unzip as `3rdparty/windows/caffe_opencl/`.
- [Caffe dependencies](http://posefs1.perception.cs.cmu.edu/OpenPose/3rdparty/windows/caffe3rdparty_15_2019_03_14.zip): Unzip as `3rdparty/windows/caffe3rdparty/`.
Expand Down

0 comments on commit 6b3652b

Please sign in to comment.