heatmap = heatmap.squeeze()
# print("heatmap sq:", heatmap.shape)
H, W = heatmap.shape[0], heatmap.shape[1]
xs, ys = np.where(heatmap >= self.conf_thresh) # Confidence threshold.
# print('======>>>np.where(heatmap >= self.conf_thresh)')
self.sparsemap = (heatmap >= self.conf_thresh)
if len(xs) == 0:
return np.zeros((3, 0))
pts = np.zeros((3, len(xs))) # Populate point data sized 3xN.
pts[0, :] = ys # abuse of ys, xs
pts[1, :] = xs
pts[2, :] = heatmap[xs, ys] # check the (x, y) here
(2,H,W)数组生成(3,H,W)数组
最新推荐文章于 2024-08-24 11:00:49 发布