jbeomlee93 / AdvCAM

Anti-Adversarially Manipulated Attributions for Weakly and Semi-Supervised Semantic Segmentation (CVPR 2021)
MIT License
128 stars 16 forks source link

regarding run_sample.py #6

Closed seyeeet closed 3 years ago

seyeeet commented 3 years ago

can you please tell me what is the goal of run_sample.py ?

jbeomlee93 commented 3 years ago

After obtaining an initial seed by obtain_CAM_masking.py, we refine the initial seed by IRN, which is realized by run_sample.py. Please refer to IRN for more details.

seyeeet commented 3 years ago

Thanks

seyeeet commented 3 years ago

@jbeomlee93 I am really enjoying your work. can you please clarify the following concepts as well for me? can you please tell me what the following funtions do and what is their purposes? in misc/torchutils.py I see thre functions gap2d,gap2d_pos, and gsp2d. but I dont understand what is the goal of them. Thanks a lot

jbeomlee93 commented 3 years ago

'gap' and 'gsp' denote global average pooling and global sum pooling respectively.

They are used for computing logit values:

https://github.com/jbeomlee93/AdvCAM/blob/fa08f0ad4c1f764f3ccaf36883c0ae43342d34c5/net/resnet50_cam.py#L37

or, computing CAMs:

https://github.com/jbeomlee93/AdvCAM/blob/fa08f0ad4c1f764f3ccaf36883c0ae43342d34c5/gradCAM.py#L90

For more details, please refer to the formulation of CAM and Grad-CAM.

Thanks