This repository is a PyTorch implementation of TrSeg. This work is based on semseg.
The codebase mainly uses ResNet50/101/152 as backbone and can be easily adapted to other basic classification structures. Sample experimented dataset is Cityscapes.
Hardware: >= 44G GPU memory
Software: PyTorch>=1.0.0, python3
For installation, follow installation steps below or recommend you to refer to the instructions described here.
If you use multiple GPUs for training, Apex is required for synchronized training (such as Sync-BN).
For its pretrained model, you can download from my drive.
- Clone this repository.
git clone https://github.com/youngsjjn/TrSeg.git
- Install Python dependencies.
pip install -r requirements.txt
-
Download datasets (i.e. Cityscapes) and change the root of data path in config. Download data list and pre-trained backbone models (ResNet50/101/152) here.
-
Train (Evaluation is included at the end of the training)
sh tool/train.sh cityscapes transform101
- Test
sh tool/test.sh cityscapes transform101
Network (ResNet-101) | mIoU |
---|---|
PSPNet | 78.6 |
Deeplab-v3 | 79.3 |
TrSeg | 79.9 |
You may want to cite:
@article{jin2021trseg,
title={TrSeg: Transformer for semantic segmentation},
author={Jin, Youngsaeng and Han, David and Ko, Hanseok},
journal={Pattern Recognition Letters},
volume={148},
pages={29--35},
year={2021},
publisher={Elsevier}
}