I have a microscobic image dataset and I want to segment each texture of that image. I have used segment-anything model to segment these textures and strictly speaking it provides very good results for my dataset. But in detail review I found there are some duplicate masks. I want to remove this duplicates. I go through the automatic_mask_generator.py and tried to fine tune the value crop_nms_thresh. But it did not work. How can I remove these duplicates? My image that I want to segment: segmentation outputs that contains duplicates is shown below: Correct segmentation: Duplicate segmentation: How can I remove duplicate masks from segment anything outputs? Continue reading...