fudan-zvg / Semantic-Segment-Anything

Automated dense category annotation engine that serves as the initial semantic labeling for the Segment Anything dataset (SA-1B).
Apache License 2.0
2.1k stars 132 forks source link

Get each segments from output of semantic segmentation #20

Closed gjustin40 closed 1 year ago

gjustin40 commented 1 year ago

Thank you for sharing a wonderful code!

I want to get segments of specific class from result.

Segmentation results have multiple classes, but I only want to see the segmentation results for a specific class. However, the resulting data (json) does not provide information on the coordinates of the segments or the index for each class, making it difficult to access the desired information.

I tried extracting unique the color of segments, but 'unique of color' and 'number of segments' are different....so it failed

for example, I just want mask that pixel's class_name is 'building'.

What can be done? Thanks

Jiaqi-Chen-00 commented 1 year ago

You can refer to https://github.com/fudan-zvg/Semantic-Segment-Anything/issues/35