chenqi1126 / SIPE

[CVPR 2022] Self-supervised Image-specific Prototype Exploration for Weakly Supervised Semantic Segmentation
MIT License
75 stars 10 forks source link

The effect of valid_mask? #12

Closed ChunmengLiu1 closed 1 year ago

ChunmengLiu1 commented 1 year ago

Hi! Thanks for the great jod! When I read the code, I was confused about what valid_mask does. From data_voc.py I can see that it is a matrix with partial values of 1 (16, 21, h, w) determined from random cropping. However, in resnet50_SIPE.py, *norm_cam=F.interpolate(norm_cam, side3.shape[2:], mode='bilinear', align_corners=True)valid_mask.** What does this code mean?

chenqi1126 commented 1 year ago

Hi @xinyuaning, Thanks for your attention. Since Random cropping operation introduces extra padding outside the original image extent, we treat these padding areas as invalid. So 'valid_mask' is used to 1) eliminate irrelevant responses in localization maps, and 2) ensure GSC loss actioned on valid areas.

ChunmengLiu1 commented 1 year ago

Thank you for your timely response!