By Zilong Huang, Xinggang Wang, Lichao Huang, Chang Huang, Yunchao Wei, Wenyu Liu.
This code is a implementation of the experiments on Cityscapes in the CCNet. We implement our method based on open source pytorch segmentation toolbox.

- GPU memory friendly
- High computational efficiency
- The state-of-the-art performance


CCNet is released under the MIT License (refer to the LICENSE file for details).
If you find CCNet useful in your research, please consider citing:
@article{huang2018ccnet,
title={CCNet: Criss-Cross Attention for Semantic Segmentation},
author={Huang, Zilong and Wang, Xinggang and Huang, Lichao and Huang, Chang and Wei, Yunchao and Liu, Wenyu},
journal = {arXiv preprint arXiv:1811.11721},
year={2018}
}
To install PyTorch>=0.4.0, please refer to https://github.com/pytorch/pytorch#installation.
4 x 12G GPUs (e.g. TITAN XP)
Some parts of InPlace-ABN and Criss-Cross Attention have native CUDA implementations, which must be compiled with the following commands:
cd libs
sh build.sh
python build.py
cd ../cc_attention
sh build.sh
python build.pyThe build.sh 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 build.sh.
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.
./run_local.sh YOUR_CS_PATHThe work was mainly done during an internship at Horizon Robotics.
Self-attention related methods:
Object Context Network
Dual Attention Network
Semantic segmentation toolboxs:
pytorch-segmentation-toolbox
semantic-segmentation-pytorch
PyTorch-Encoding