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

(fix) Shape and bbox error #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
13 changes: 11 additions & 2 deletions scripts/pose_cls_e2e_inference/plot_e2e_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,19 @@ def main():
for j in range(num_joints):
image_frame = cv2.circle(image_frame, joints[j], 2, (255, 255, 255), 2)



#Fix bbox, using minmax joints point
x_list,y_list = zip(*joints)
x_min = min(x_list)
x_max = max(x_list)
y_min = min(y_list)
y_max = max(y_list)
bbox = [x_min,y_min,x_max,y_max]

# Plot bounding box
bbox = person["bbox"]
bbox_top_left = [int(bbox[0]), int(bbox[1])]
bbox_bottom_right = [int(bbox[0] + bbox[2] - 1), int(bbox[1] + bbox[3] - 1)]
bbox_bottom_right = [int(bbox[2]), int(bbox[3])]
if bbox_top_left[0] < 0:
bbox_top_left[0] = 0
if bbox_top_left[1] < 0:
Expand Down
5 changes: 3 additions & 2 deletions tao_triton/python/utils/pose_cls_dataset_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ def pose_cls_dataset_convert(pose_data_file, dataset_convert_config):
frame_start += step

# Accumulate data arrays of all objects
data_arrays.append(data_array)
if data_array is not None:
data_arrays.append(data_array)
print(data_array.shape)

# Update pose data for returning (removing pose metadata)
for b in range(len(pose_data)):
Expand All @@ -151,5 +153,4 @@ def pose_cls_dataset_convert(pose_data_file, dataset_convert_config):
pose_data[b]["batches"][f]["objects"][p]["segment_id"] = \
segment_assignments.get((object_id, frame_num), -1)
pose_data[b]["batches"][f]["objects"][p]["action"] = ""

return np.concatenate(data_arrays, axis=0), pose_data