dongzhang89 / CONTA

Implementation for paper: Causal Intervention for Weakly-Supervised Semantic Segmentation
MIT License
185 stars 27 forks source link

MISS of average mask #13

Closed DepueeDome closed 3 years ago

DepueeDome commented 3 years ago

Hi, thanks for your brilliant work. I try to re-run your project, but i can't found the code for calculating the average segmentation mask as well as the usage of m_t.py in irn project, did i missed any information?

dongzhang89 commented 3 years ago

@DepueeDome Thank you for your attention. This part of the script code needs to be prepared by yourself.

DepueeDome commented 3 years ago

@DepueeDome Thank you for your attention. This part of the script code needs to be prepared by yourself.

Thanks for your reply! may i verify some parameters in m_t.py with you here?

1.According to your paper, Eq. 3, X_m denotes the segmentation mask (hw) and c_i is (hw*1), therefore, should both the embedding_size and the representation_size change to 1 in m_t.py?

dongzhang89 commented 3 years ago

@DepueeDome Both segmentation mask and c_i denote hw1, and the embedding size (W_1 and W_2) is nhw.

DepueeDome commented 3 years ago

@DepueeDome Both segmentation mask and c_i denote hw_1, and the embedding size (W_1 and W_2) is n_hw.

So the output of M_t is (hw1), where h and w determine by the feature map M_t concatenate to, and i right?

dongzhang89 commented 3 years ago

@DepueeDome Yes, you are right.

DepueeDome commented 3 years ago

@DepueeDome Yes, you are right.

Thanks a lot!

pkmandke commented 3 years ago

@DepueeDome Both segmentation mask and c_i denote hw1, and the embedding size (W_1 and W_2) is nhw.

@ZHANGDONG-NJUST Could you please elaborate a little further on this. If I understand correctly, both X_m and c_i are of dim hw x 1 and W_1 and W_2 are n x hw. Then, the term inside the softmax (in Eq (3)) would have a dimension of 1 x 1. What exactly is the dimension of alpha_i? Is the term inside the softmax being computed for all n segmentation masks and then the softmax is applied over these n scores?

Thanks!

dongzhang89 commented 3 years ago

@pkmandke 1. alpha_i is a scalar, so it has a dimension of 1 x 1; 2. softmax is only applied over n scores.