Is there a method/algorithm to generate instances of objects from image that was segmented by the use of any image segmentation models?
For example, I have an image with one class and it was segmented in a given way, where 1s are objects of the same class and empty fields are of no class:
How can I now generate list of the two objects, where list's elements for example would be positions of all the pixels inside the object (list of list).