From 29b6697d4c4afa919ac0b63c1ed80c5020cbe0df Mon Sep 17 00:00:00 2001 From: gineshidalgo99 Date: Wed, 21 Feb 2018 16:46:54 -0500 Subject: [PATCH] Json naming renamed --- doc/output.md | 19 ++++++++++++------- doc/quick_start.md | 2 +- doc/release_notes.md | 1 + .../openpose/filestream/wPeopleJsonSaver.hpp | 8 ++++---- src/openpose/3d/poseTriangulation.cpp | 2 +- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/doc/output.md b/doc/output.md index cefb5126..1e4f246d 100644 --- a/doc/output.md +++ b/doc/output.md @@ -20,18 +20,23 @@ OpenPose Demo - Output There are 2 alternatives to save the OpenPose output. 1. The `write_json` flag saves the people pose data using a custom JSON writer. Each JSON file has a `people` array of objects, where each object has: - 1. An array `pose_keypoints` containing the body part locations and detection confidence formatted as `x1,y1,c1,x2,y2,c2,...`. The coordinates `x` and `y` can be normalized to the range [0,1], [-1,1], [0, source size], [0, output size], etc., depending on the flag `keypoint_scale`, while `c` is the confidence score in the range [0,1]. - 2. The arrays `face_keypoints`, `hand_left_keypoints`, and `hand_right_keypoints`, analogous to `pose_keypoints`. - 3. The body part candidates before being assembled into people (if `--part_candidates` is enabled). + 1. An array `pose_keypoints_2d` containing the body part locations and detection confidence formatted as `x1,y1,c1,x2,y2,c2,...`. The coordinates `x` and `y` can be normalized to the range [0,1], [-1,1], [0, source size], [0, output size], etc., depending on the flag `keypoint_scale`, while `c` is the confidence score in the range [0,1]. + 2. The arrays `face_keypoints_2d`, `hand_left_keypoints_2d`, and `hand_right_keypoints_2d`, analogous to `pose_keypoints_2d`. + 3. The analogous 3-D arrays `body_keypoints_3d`, `face_keypoints_3d`, `hand_left_keypoints_2d`, and `hand_right_keypoints_2d` (if `--3d` is enabled, otherwise they will be empty). + 4. The body part candidates before being assembled into people (if `--part_candidates` is enabled). ``` { "version":1.1, "people":[ { - "pose_keypoints":[582.349,507.866,0.845918,746.975,631.307,0.587007,...], - "face_keypoints":[468.725,715.636,0.189116,554.963,652.863,0.665039,...], - "hand_left_keypoints":[746.975,631.307,0.587007,615.659,617.567,0.377899,...], - "hand_right_keypoints":[617.581,472.65,0.797508,0,0,0,723.431,462.783,0.88765,...] + "pose_keypoints_2d":[582.349,507.866,0.845918,746.975,631.307,0.587007,...], + "face_keypoints_2d":[468.725,715.636,0.189116,554.963,652.863,0.665039,...], + "hand_left_keypoints_2d":[746.975,631.307,0.587007,615.659,617.567,0.377899,...], + "hand_right_keypoints_2d":[617.581,472.65,0.797508,0,0,0,723.431,462.783,0.88765,...] + "pose_keypoints_3d":[582.349,507.866,507.866,0.845918,507.866,746.975,631.307,0.587007,...], + "face_keypoints_3d":[468.725,715.636,715.636,0.189116,715.636,554.963,652.863,0.665039,...], + "hand_left_keypoints_3d":[746.975,631.307,631.307,0.587007,631.307,615.659,617.567,0.377899,...], + "hand_right_keypoints_3d":[617.581,472.65,472.65,0.797508,472.65,0,0,0,723.431,462.783,0.88765,...] } ], // If `--part_candidates` enabled diff --git a/doc/quick_start.md b/doc/quick_start.md index 44d81379..2480d452 100644 --- a/doc/quick_start.md +++ b/doc/quick_start.md @@ -135,7 +135,7 @@ build\x64\Release\OpenPoseDemo.exe --flir_camera --3d --number_people_max 1 --fa ``` # Ubuntu (same flags for Windows version) # Note: saving in PNG rather than JPG will improve image quality, but slow down FPS (depending on hard disk writing speed and camera number) -./build/examples/openpose/openpose.bin --flir_camera --num_gpu 0 --write_images output_folder_path/ +./build/examples/openpose/openpose.bin --flir_camera --num_gpu 0 --write_images output_folder_path/ --write_images_format jpg ``` 4. Reading and processing previouly saved stereo camera images diff --git a/doc/release_notes.md b/doc/release_notes.md index e204947e..7ca25168 100644 --- a/doc/release_notes.md +++ b/doc/release_notes.md @@ -191,6 +191,7 @@ OpenPose Library - Release Notes 2. Functions or parameters renamed: 1. Flag `no_display` renamed as `display`, able to select between `NoDisplay`, `Display2D`, `Display3D`, and `DisplayAll`. 2. 3-D reconstruction demo is now inside the OpenPose demo binary. + 3. Renamed `*_keypoints` by `*_keypoints_2d` to avoid confusion with 3d ones in `--write_json` output file. 3. 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. 2. Fixed core-dumped in PoseRenderer with GUI when changed element to be rendered to something else than skeleton. diff --git a/include/openpose/filestream/wPeopleJsonSaver.hpp b/include/openpose/filestream/wPeopleJsonSaver.hpp index cfe5967e..d513c83b 100644 --- a/include/openpose/filestream/wPeopleJsonSaver.hpp +++ b/include/openpose/filestream/wPeopleJsonSaver.hpp @@ -67,10 +67,10 @@ namespace op const std::vector, std::string>> keypointVector{ // 2D - std::make_pair(tDatum.poseKeypoints, "pose_keypoints"), - std::make_pair(tDatum.faceKeypoints, "face_keypoints"), - std::make_pair(tDatum.handKeypoints[0], "hand_left_keypoints"), - std::make_pair(tDatum.handKeypoints[1], "hand_right_keypoints"), + std::make_pair(tDatum.poseKeypoints, "pose_keypoints_2d"), + std::make_pair(tDatum.faceKeypoints, "face_keypoints_2d"), + std::make_pair(tDatum.handKeypoints[0], "hand_left_keypoints_2d"), + std::make_pair(tDatum.handKeypoints[1], "hand_right_keypoints_2d"), // 3D std::make_pair(tDatum.poseKeypoints3D, "pose_keypoints_3d"), std::make_pair(tDatum.faceKeypoints3D, "face_keypoints_3d"), diff --git a/src/openpose/3d/poseTriangulation.cpp b/src/openpose/3d/poseTriangulation.cpp index ebce68ab..3ea26f04 100644 --- a/src/openpose/3d/poseTriangulation.cpp +++ b/src/openpose/3d/poseTriangulation.cpp @@ -137,6 +137,7 @@ namespace op } } // 3D reconstruction + keypoints3D.reset({ 1, numberBodyParts, 4 }, 0); if (!xyPoints.empty()) { // Do 3D reconstruction @@ -154,7 +155,6 @@ namespace op // cv::Mat reconstructedPoints{4, firstcv::Points.size(), CV_64F}; // cv::triangulatecv::Points(cv::Mat::eye(3,4, CV_64F), M_3_1, firstcv::Points, secondcv::Points, // reconstructedcv::Points); - keypoints3D.reset({ 1, numberBodyParts, 4 }, 0); const auto lastChannelLength = keypoints3D.getSize(2); for (auto index = 0u; index < indexesUsed.size(); index++) { -- GitLab