[Python] How can I remove duplicate masks from segment-anything?

Discussão em 'Python' iniciado por Stack, Março 9, 2025.

  1. Stack

    Stack Membro Participativo

    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:

    [​IMG]

    segmentation outputs that contains duplicates is shown below:

    Correct segmentation:

    [​IMG]

    Duplicate segmentation:

    [​IMG]

    How can I remove duplicate masks from segment anything outputs?

    Continue reading...

Compartilhe esta Página