Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added bbox info in save-pose output (JSON) file. #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions deepstream-bodypose-3d/sources/deepstream_pose_estimation_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -969,9 +969,38 @@ void parse_25dpose_from_tensor_meta(NvDsInferTensorMeta *tensor_meta,
fprintf(_pose_file, ", ");
}
fsetpos(_pose_file, &g_fp_25_pos);
fprintf(_pose_file, "]\n");
fprintf(_pose_file, "],\n");

//---Save bounding box coordinates---
{
float left, top, width, height;
if (strcmp(_tracker, "none")) {
left = obj_meta->tracker_bbox_info.org_bbox_coords.left;
top = obj_meta->tracker_bbox_info.org_bbox_coords.top;
width = obj_meta->tracker_bbox_info.org_bbox_coords.width;
height = obj_meta->tracker_bbox_info.org_bbox_coords.height;
}
else {
left = obj_meta->detector_bbox_info.org_bbox_coords.left;
top = obj_meta->detector_bbox_info.org_bbox_coords.top;
width = obj_meta->detector_bbox_info.org_bbox_coords.width;
height = obj_meta->detector_bbox_info.org_bbox_coords.height;
}
// Restore the bbox location due to padding and cropping.
left -= _pad_dim;
top -= _pad_dim;
fprintf(_pose_file,
" \"bbox\": [");
fprintf(_pose_file, "%f, %f, %f, %f",
left,
top,
width,
height);
fprintf(_pose_file, "]\n");
}
//---Save bounding box coordinates---

// Remember the position of "," so that we can remove it on the last entry.
// Remember the position of "," so that we can remove it on the last entry.
fprintf(_pose_file, " }");
fgetpos(_pose_file, &g_fp_25_pos);
fprintf(_pose_file, ", ");
Expand Down