Having a mask from semantic segmentation I want to split it to list of non-overlapping instances masks(like an output from instance segmentation). Do you know some fast algorithm, approach, tool or library to do this? I have found one python library. But it is very slow. Naive python implementation will also be slow.