PyTorch Implementations for DeeplabV3 and PSPNet
Branch: master
Clone or download
Latest commit 942e886 Dec 12, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
dataset init repo Nov 7, 2018
libs Update Nov 7, 2018
networks init repo Nov 7, 2018
utils init repo Nov 7, 2018
LICENSE Initial commit Nov 7, 2018 Update Dec 12, 2018 Update Dec 2, 2018 init repo Nov 7, 2018 Update Nov 7, 2018

Pytorch-segmentation-toolbox DOC

Pytorch code for semantic segmentation. This is a minimal code to run PSPnet and Deeplabv3 on Cityscape dataset. Shortly afterwards, the code will be reviewed and reorganized for convenience.

Highlights of Our Implementations

  • Synchronous BN
  • Fewness of Training Time
  • Better Reproduced Performance


To install PyTorch>=0.4.0, please refer to

4 x 12g GPUs (e.g. TITAN XP)

Python 3.6


Some parts of InPlace-ABN have a native CUDA implementation, which must be compiled with the following commands:

cd libs

The script assumes that the nvcc compiler is available in the current system search path. The CUDA kernels are compiled for sm_50, sm_52 and sm_61 by default. To change this (e.g. if you are using a Kepler GPU), please edit the CUDA_GENCODE variable in

Dataset and pretrained model

Plesae download cityscapes dataset and unzip the dataset into YOUR_CS_PATH.

Please download MIT imagenet pretrained resnet101-imagenet.pth, and put it into dataset folder.

Training and Evaluation



Some recent projects have already benefited from our implementations. For example, CCNet: Criss-Cross Attention for semantic segmentation and Object Context Network(OCNet) currently achieve the state-of-the-art resultson Cityscapes and ADE20K. In addition, Our code also make great contributions to Context Embedding with EdgePerceiving (CE2P), which won the 1st places in all human parsing tracks in the 2nd LIP Challange.


If you find this code useful in your research, please consider citing:

  author = {Huang, Zilong and Wei, Yunchao and Wang, Xinggang, and Liu, Wenyu},
  title = {A PyTorch Semantic Segmentation Toolbox},
  howpublished = {\url{}},
  year = {2018}

Thanks to the Third Party Libs

inplace_abn - Pytorch-Deeplab - PyTorch-Encoding