def _find_slices(mask):
    """Return slices that tightly bound each unique object in `mask`."""
    relabeled, forward, backward = sks.relabel_sequential(mask)
    slices = spn.find_objects(relabeled)
    return dict((backward[idx + 1], slc) for idx, slc in enumerate(slices))
Return slices that tightly bound each unique object in `mask`.
fiftyone/core/labels.py