YudeWang / SEAM

Self-supervised Equivariant Attention Mechanism for Weakly Supervised Semantic Segmentation, CVPR 2020 (Oral)
MIT License
539 stars 97 forks source link

cam_full_arr[k+1] = v out of bounds #44

Closed shifan-Z closed 1 year ago

shifan-Z commented 1 year ago

Thanks for posting your excellent code! I met some problems when using the code. In line95, the npy files store the information of classes in a training sample. The max k in line 98 is 21 for the VOC dataset, because the VOC dataset contains 21 categories. In line 99, the index will out of the bound, because k+1 can vbe 22 But cam_full_arr's size is 21. How can I do to solve the error? And what does the line 100 mean? What is filled in the cam_full_arr[0]? I am confused. https://github.com/YudeWang/SEAM/blob/3212261b9d008581576b8b5429e32413d892c10b/infer_aff.py#L95-L100 Looking forward to your reply.

YudeWang commented 1 year ago

Hi @shifan-Z , The channel number of saved CAM is 20 instead of 21. https://github.com/YudeWang/SEAM/blob/3212261b9d008581576b8b5429e32413d892c10b/infer_SEAM.py#L79-L85

shifan-Z commented 1 year ago

Thank you so much! So is the cam_full_arr[0] for the background?