def METHOD_NAME(self, heatmap: Union[np.ndarray, torch.Tensor]):
    """Extract one-dimensional heatmap from two-dimensional heatmap and
    calculate the number of keypoint."""
    size = heatmap.size()
    k = size[0] if size[0] <= 20 else 20
    maps = []
    for _ in range(k):
        xy_dict = {}
        single_heatmap = heatmap[_]
        xy_dict['x'], xy_dict['y'] = self.merge_maps(single_heatmap)
        maps.append(xy_dict)
    return maps, k