implement segmentation-free labeling