zhang-haojie / wesam

[CVPR 2024] Code for "Improving the Generalization of Segmentation Foundation Model under Distribution Shift via Weakly Supervised Adaptation"
MIT License
130 stars 9 forks source link

Why is my Contrast Loss always 0? #31

Open liubaoning111 opened 2 weeks ago

leo-lab-511 commented 1 week ago

我的也是,但不是对比损失 Snipaste_2024-09-18_09-51-13

zhang-haojie commented 1 week ago

In cases with only one target in an image, the absence of negative samples in the contrast loss construction results in a constant 0 loss. We have used a method to treat the background as a special instance. We will update the new version to avoid this problem soon.

liubaoning111 commented 4 days ago

你好,我想问下,咱们的弱监督是可以分割多个目标的吗?我有一个msk有四个目标,背景0,目标1:1,目标2:2,目标3:3,可以直接实现分割吗?

zhang-haojie commented 4 days ago

可以的,SAM原本支持什么样的分割,我们也同样支持。弱监督的格式是SAM接收的prompt格式。