Home

Awesome

Self-Regulation for Semantic Segmentation

This is the PyTorch implementation for paper Self-Regulation for Semantic Segmentation, ICCV 2021.

SR

Contact

Installation Instructions

git clone git@github.com:dongzhang89/SR-SS.git
cd SR-SS
pip install pytorch==0.4.0

GPU is not necessary, but it will be very slow without GPU.

pip install -r requirements

Tensorflow is necessary for tensorboardX. If you don't want to use tensorboardX for visualization, delete it.

data
  |- VOC2012
    |- SegmentationClassAug_pseudo_label #label path
    |- JPEGImages #image path

Usage

Demo

Test on a single image could be done by running:

python demo.py --img_path path --model path/weight

You can get a similar image as:

input

checkpoint = torch.load(model_path)
net.load_state_dict(checkpoint['model'])

Train

Training your own model could be done by running:

python trainval.py

Test

Testing your trained model could be done by running:

python test.py --model=path/model

TensorboardX

Monitor your training process with tensorboardX. Run:

tensorboard --logdir=$DEEPLAB_V2_PYTORCH/logs/loss_lr/lr --port=7001

Then open your firefox or chrome, and visit localhost:7001.

Acknowledgement

This project heavily relies on the following projects:

Citing SR-SS

You may want to cite:

@article{zhang2021sr,
  title={Self-Regulation for Semantic Segmentation},
  author={Dong, Zhang and Hanwang, Zhang and Jinhui, Tang and Xiansheng, Hua and Qianru, Sun},
  journal={International Conference on Computer Vision (ICCV)},
  year={2021}
}