From 44c5093e4a6d3204a78fd606d5a3c74e93176665 Mon Sep 17 00:00:00 2001 From: gineshidalgo99 Date: Sat, 13 Jan 2018 12:07:47 -0500 Subject: [PATCH] Cleaner doc & boost leftovers removed --- doc/openpose_3d_reconstruction_demo.md | 2 +- doc/output.md | 75 +++++++++++++++----------- include/openpose/utilities/render.hu | 4 +- src/openpose/CMakeLists.txt | 2 +- src/openpose/utilities/CMakeLists.txt | 5 +- 5 files changed, 49 insertions(+), 39 deletions(-) diff --git a/doc/openpose_3d_reconstruction_demo.md b/doc/openpose_3d_reconstruction_demo.md index 37d50d77..81f63dee 100644 --- a/doc/openpose_3d_reconstruction_demo.md +++ b/doc/openpose_3d_reconstruction_demo.md @@ -106,7 +106,7 @@ LIBS += -L/usr/local/cuda-8.0/lib64 -lcudart -lcublas -lcurand # OpenGL LIBS += -lGLU -lGL -lglut # Other 3rdparty -LIBS += -lcudnn -lglog -lgflags -lboost_system -lboost_filesystem -lm -lboost_thread +LIBS += -lcudnn -lglog -lgflags -lm LIBS += -pthread -fPIC -std=c++11 -fopenmp # Optimization flags LIBS += -DNDEBUG -O3 -march=native diff --git a/doc/output.md b/doc/output.md index 28211722..e61da5d6 100644 --- a/doc/output.md +++ b/doc/output.md @@ -3,6 +3,19 @@ OpenPose Demo - Output +## Contents +1. [Output Format](#output-format) + 1. [Keypoint Ordering](#keypoint-ordering) + 2. [Heatmap Ordering](#heatmap-ordering) + 3. [Face and Hands](#face-and-hands) + 4. [Pose Output Format](#pose-output-format) + 5. [Face Output Format](#face-output-format) + 6. [Hand Output Format](#hand-output-format) +3. [Reading Saved Results](#reading-saved-results) +4. [Keypoint Format in the C++ API](#keypoint-format-in-the-c-api) + + + ## Output Format There are 2 alternatives to save the OpenPose output. @@ -51,7 +64,7 @@ There are 2 alternatives to save the OpenPose output. -## Keypoint Ordering +### Keypoint Ordering The body part mapping order of any body model (e.g. COCO, MPI) can be extracted from the C++ API by using the `getPoseBodyPartMapping(const PoseModel poseModel)` function available in [poseParameters.hpp](../include/openpose/pose/poseParameters.hpp): ``` // C++ API call @@ -85,7 +98,7 @@ const auto& poseBodyPartMappingMpi = getPoseBodyPartMapping(PoseModel::MPI_15); -## Heatmap Ordering +### Heatmap Ordering For the **heat maps storing format**, instead of saving each of the 67 heatmaps (18 body parts + background + 2 x 19 PAFs) individually, the library concatenates them into a huge (width x #heat maps) x (height) matrix (i.e., concatenated by columns). E.g., columns [0, individual heat map width] contains the first heat map, columns [individual heat map width + 1, 2 * individual heat map width] contains the second heat map, etc. Note that some image viewers are not able to display the resulting images due to the size. However, Chrome and Firefox are able to properly open them. The saving order is body parts + background + PAFs. Any of them can be disabled with program flags. If background is disabled, then the final image will be body parts + PAFs. The body parts and background follow the order of `getPoseBodyPartMapping(const PoseModel poseModel)`, while the PAFs follow the order specified on `getPosePartPairs(const PoseModel poseModel)`: @@ -102,13 +115,39 @@ const auto& posePartPairsMpi = getPosePartPairs(PoseModel::MPI_15); -## Face and Hands +### Face and Hands The output format is analogous for hand (`hand_left_keypoints`, `hand_right_keypoints`) and face (`face_keypoints`) JSON files. -## Keypoint Format on the op::Datum Class -There are 3 different keypoint Array elements on this class: +### Pose Output Format +

+ +

+ + + +### Face Output Format +

+ +

+ + + +### Hand Output Format +

+ +

+ + + +## Reading Saved Results +We use standard formats (JSON, XML, PNG, JPG, ...) to save our results, so there are many open-source libraries to read them in most programming languages. From C++, but you might the functions in [include/openpose/filestream/fileStream.hpp](../include/openpose/filestream/fileStream.hpp). In particular, `loadData` (for JSON, XML and YML files) and `loadImage` (for image formats such as PNG or JPG) to load the data into cv::Mat format. + + + +## Keypoint Format in the C++ API +There are 3 different keypoint `Array` elements in the `Datum` class: 1. Array **poseKeypoints**: In order to access person `person` and body part `part` (where the index matches `POSE_COCO_BODY_PARTS` or `POSE_MPI_BODY_PARTS`), you can simply output: ``` @@ -169,29 +208,3 @@ There are 3 different keypoint Array elements on this class: const auto yR = handKeypoints[1][baseIndex + 1]; const auto scoreR = handKeypoints[1][baseIndex + 2]; ``` - - - -## Reading Saved Results -We use standard formats (JSON, XML, PNG, JPG, ...) to save our results, so there are many open-source libraries to read them in most programming languages. From C++, but you might the functions in [include/openpose/filestream/fileStream.hpp](../include/openpose/filestream/fileStream.hpp). In particular, `loadData` (for JSON, XML and YML files) and `loadImage` (for image formats such as PNG or JPG) to load the data into cv::Mat format. - - - -## Pose Output Format -

- -

- - - -## Face Output Format -

- -

- - - -## Hand Output Format -

- -

diff --git a/include/openpose/utilities/render.hu b/include/openpose/utilities/render.hu index 87750600..8aa07ca1 100644 --- a/include/openpose/utilities/render.hu +++ b/include/openpose/utilities/render.hu @@ -139,8 +139,8 @@ namespace op if (googlyEye1 == part || googlyEye2 == part) { const auto eyeRatio = 2.5f * sqrt(radiusScaled); - const auto minr2 = sharedScaleF[person] - * sharedScaleF[person] * (eyeRatio - 2) * (eyeRatio - 2); + const auto minr2 = sharedScaleF[person] * sharedScaleF[person] + * (eyeRatio - 2) * (eyeRatio - 2); const auto maxr2 = sharedScaleF[person] * sharedScaleF[person] * eyeRatio * eyeRatio; if (dist2 <= maxr2) { diff --git a/src/openpose/CMakeLists.txt b/src/openpose/CMakeLists.txt index 757823b3..47306434 100644 --- a/src/openpose/CMakeLists.txt +++ b/src/openpose/CMakeLists.txt @@ -22,7 +22,7 @@ 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} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} caffe) +target_link_libraries(openpose ${OpenCV_LIBS} caffe) if (BUILD_CAFFE) add_dependencies(openpose openpose_caffe) endif (BUILD_CAFFE) diff --git a/src/openpose/utilities/CMakeLists.txt b/src/openpose/utilities/CMakeLists.txt index 85d38a07..33222554 100644 --- a/src/openpose/utilities/CMakeLists.txt +++ b/src/openpose/utilities/CMakeLists.txt @@ -8,11 +8,8 @@ set(SOURCES profiler.cpp string.cpp) -find_package(Boost COMPONENTS system filesystem REQUIRED) - cuda_add_library(openpose_utilities ${SOURCES}) -target_link_libraries(openpose_utilities openpose_filestream openpose_producer - ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) +target_link_libraries(openpose_utilities openpose_filestream openpose_producer) install(TARGETS openpose_utilities EXPORT OpenPose -- GitLab