Skip to content

Commit

Permalink
Fixed a bug in visualization.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShenhanQian committed Dec 28, 2021
1 parent 3e99ca7 commit f4ac2e1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/utils/vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ def save_batch_image_with_joints(batch_image, batch_joints, batch_joints_vis,
joints_vis = batch_joints_vis[k]

for joint, joint_vis in zip(joints, joints_vis):
joint[0] = x * width + padding + joint[0]
joint[1] = y * height + padding + joint[1]
joint_x = x * width + padding + joint[0]
joint_y = y * height + padding + joint[1]
if joint_vis[0]:
cv2.circle(ndarr, (int(joint[0]), int(joint[1])), 2, [255, 0, 0], 2)
cv2.circle(ndarr, (int(joint_x), int(joint_y)), 2, [255, 0, 0], 2)
k = k + 1
cv2.imwrite(file_name, ndarr)

Expand Down Expand Up @@ -80,18 +80,18 @@ def save_batch_image_with_joints_gt_pred(batch_image,
joints = batch_joints_gt[k]
joints_vis = batch_joints_vis_gt[k]
for joint, joint_vis in zip(joints, joints_vis):
joint[0] = x * width + padding + joint[0]
joint[1] = y * height + padding + joint[1]
joint_x = x * width + padding + joint[0]
joint_y = y * height + padding + joint[1]
if joint_vis[0]:
cv2.circle(ndarr, (int(joint[0]), int(joint[1])), 2, [0, 255, 0], 2)
cv2.circle(ndarr, (int(joint_x), int(joint_y)), 2, [0, 255, 0], 2)

joints = batch_joints_pred[k]
joints_vis = batch_joints_vis_pred[k]
for joint, joint_vis in zip(joints, joints_vis):
joint[0] = x * width + padding + joint[0]
joint[1] = y * height + padding + joint[1]
joint_x = x * width + padding + joint[0]
joint_y = y * height + padding + joint[1]
if joint_vis[0]:
cv2.circle(ndarr, (int(joint[0]), int(joint[1])), 2, [255, 0, 0], 2)
cv2.circle(ndarr, (int(joint_x), int(joint_y)), 2, [255, 0, 0], 2)

k = k + 1
cv2.imwrite(file_name, ndarr)
Expand Down

0 comments on commit f4ac2e1

Please sign in to comment.