diff --git a/doc/openpose_3d_reconstruction_demo.md b/doc/openpose_3d_reconstruction_demo.md index 37d50d77759864cd97c1c661557ee93adb34991e..81f63dee2e8767618d0de59fc66d5b2340812b42 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 2821172233f64e3ab4b59f5117b2049a3aabad63..e61da5d6ee64b2731dff9423f680b1900dbc4780 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 877506002f54795bc11fc281b758b633c71021c1..8aa07ca1b9e6c3566eda1f455570bdc01cfd2ee9 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 757823b3bca8ba01809957937ee0507d875c2e4f..473064340f99bf6dfa205a9f162d9faa63f43bfa 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 85d38a07a53e05f720c5857061ef51ae40619b80..33222554308804c94a71d2c7c8e4e7c05d7c1711 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