Getting blobs of a mask

Hi,
I have a heatmap image like this:
a
What is the best way to get the blobs and the peak of each blob position fully in pytorch?