OpenGVLab / InternImage

[CVPR 2023 Highlight] InternImage: Exploring Large-Scale Vision Foundation Models with Deformable Convolutions
https://arxiv.org/abs/2211.05778
MIT License
2.47k stars 231 forks source link

Confused about the number of classes when segmenting with Mask2Former #298

Open AndreiMihalea opened 2 months ago

AndreiMihalea commented 2 months ago

Hello,

As I see in the file InternImage/segmentation/mmseg_custom/models/decode_heads /mask2former_head.py, there is this line:

self.cls_embed = nn.Linear(feat_channels, self.num_classes + 1)

I am wondering why the +1 is there. As far as I've understood, it's for the background class. But what if my dataset already has a background class? Should I ignore it in the ToMask transform?