Finetune SAM for instance segmentation to output segmenatation masks along with label names

Hello,

It seems the SAM model from the transformers library does not directly support classification tasks out of the box, as it is primarily designed for generating segmentation masks.

Any way or resources to finetune SAM for instance segmentation to output segmenatation masks along with label names please?

from transformers import SamModel

model = SamModel.from_pretrained("facebook/sam-vit-base")
outputs = model(pixel_values=batch["pixel_values"].to(device),
                        multimask_output=True)

Thanks