Skip to content

Commit

Permalink
Merge pull request #8 from NVIDIA-ISAAC-ROS/release-dp-1.1
Browse files Browse the repository at this point in the history
Isaac ROS 0.11.0 (DP1.1)
  • Loading branch information
jaiveersinghNV authored Sep 2, 2022
2 parents 4febbca + 2be7ccc commit 0235d5d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
19 changes: 14 additions & 5 deletions isaac_ros_centerpose/isaac_ros_centerpose/CenterPoseDecoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ def decode_impl(hm, wh, kps, hm_hp, reg, hp_offset, obj_scale, K):
min_dist = np.expand_dims(min_dist, -1)
min_ind = np.broadcast_to(np.reshape(min_ind, (num_joints, K, 1, 1)),
(batch, num_joints, K, 1, 2))

# make hm_kps and min_ind writable
hm_kps.setflags(write=1)
min_ind.setflags(write=1)

hm_kps = torch.gather(torch.from_numpy(hm_kps), dim=3,
index=torch.from_numpy(min_ind)).numpy()
hm_kps = np.reshape(hm_kps, (batch, num_joints, K, 2))
Expand Down Expand Up @@ -319,11 +324,15 @@ def listener_callback(self, msg):


def main(args=None):
rclpy.init(args=args)
node = IsaacROSCenterposeDecoderNode('centerpose_decoder_node')
rclpy.spin(node)
node.destroy_node()
rclpy.shutdown()
try:
rclpy.init(args=args)
node = IsaacROSCenterposeDecoderNode('centerpose_decoder_node')
rclpy.spin(node)
except KeyboardInterrupt:
pass
finally:
node.destroy_node()
rclpy.shutdown()


if __name__ == '__main__':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ def gather_feat(feat, ind, mask=None):
dim = feat.shape[2]
ind = np.broadcast_to(np.expand_dims(
ind, 2), (ind.shape[0], ind.shape[1], dim))
# make ind writable
ind.setflags(write=1)
feat = torch.gather(torch.from_numpy(feat), 1,
torch.from_numpy(ind)).numpy()

Expand Down

0 comments on commit 0235d5d

Please sign in to comment.