This is the official repo of the paper: TransCAM: Transformer Attention-based CAM Refinement for Weakly Supervised Semantic Segmentation
Accepted to Journal of Visual Communication and Image Representation 2023
pip install -r requirements.txt
Download Conformer-S pretrained weights from https://github.com/pengzhiliang/Conformer
Download ResNet-38 pretained weights from https://github.com/YudeWang/SEAM
python train_TransCAM.py --weights {pretrained_conformer_weights}
You can also download our trained weights here
python infer_TransCAM.py --weights {trained_weights}
We provide a notebook for visualizing TransCAM result: visualize.ipynb
python evaluation.py --comment transcam --predict_dir data/transcam/out_cam
python train_aff.py
python infer_aff.py
python evaluation.py --comment transcam_rw --predict_dir data/transcam/out_rw --type png
python train_deeplab.py
python test_deeplab.py
@article{li2023transcam,
title={Transcam: Transformer attention-based cam refinement for weakly supervised semantic segmentation},
author={Li, Ruiwen and Mai, Zheda and Zhang, Zhibo and Jang, Jongseong and Sanner, Scott},
journal={Journal of Visual Communication and Image Representation},
pages={103800},
year={2023},
publisher={Elsevier}
}
This repo is developed based on SEAM [1] and Conformer [2]
[1] Wang, Yude, et al. "Self-supervised equivariant attention mechanism for weakly supervised semantic segmentation." Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2020.
[2] Peng, Zhiliang, et al. "Conformer: Local features coupling global representations for visual recognition." Proceedings of the IEEE/CVF International Conference on Computer Vision. 2021.