YZC-99 / GTA-Seg

Code for GTA-Seg (NeurIPS2022)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GTA-Seg

Code release for [Semi-Supervised Semantic Segmentation via Gentle Teaching Assistant], NeurIPS 2022.

Installation

cd GTA-Seg
conda create -n gta python=3.6.9
conda activate gta
pip install -r requirements.txt
pip install pip install torch==1.8.1+cu102 torchvision==0.9.1+cu102 -f https://download.pytorch.org/whl/torch_stable.html

Prepare Data

For PASCAL VOC 2012

Download "VOCtrainval_11-May-2012.tar" from: http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar.

And unzip the files to folder data and make the dictionary structures as follows:

data/VOC2012
├── Annotations
├── ImageSets
├── JPEGImages
├── SegmentationClass
├── SegmentationClassAug
└── SegmentationObject

Prepare Pretrained Backbone

Before training, please download ResNet101 pretrained on ImageNet-1K from one of the following:

After that, modify model_urls in models/resnet.py to </path/to/resnet101.pth>

Train a Semi-Supervised Model

We can train a model on PASCAL VOC 2012 with 183 labeled data for supervision by:

cd experiments/pascal/183/ours
# use slurm
sh slurm_train.sh <num_gpu> <port> <partition>
# or use torch.distributed.launch
# sh train.sh <num_gpu> <port>

Acknowledgement

We reproduce our work based on U2PL.

Sincere gratitude to their work.

Citation

@inproceedings{jin2022semi,
    title={Semi-Supervised Semantic Segmentation via Gentle Teaching Assistant},
    author={Jin, Ying and Wang, Jiaqi and Lin, Dahua},
    booktitle={Advances in Neural Information Processing Systems},
    year={2022}
}

Contact

About

Code for GTA-Seg (NeurIPS2022)

License:Apache License 2.0


Languages

Language:Python 98.8%Language:Shell 1.2%