Home

Awesome

FastFCN: Rethinking Dilated Convolution in the Backbone for Semantic Segmentation

[Project] [Paper] [arXiv] [Home]

PWC

Official implementation of FastFCN: Rethinking Dilated Convolution in the Backbone for Semantic Segmentation.
A Faster, Stronger and Lighter framework for semantic segmentation, achieving the state-of-the-art performance and more than 3x acceleration.

@inproceedings{wu2019fastfcn,
  title     = {FastFCN: Rethinking Dilated Convolution in the Backbone for Semantic Segmentation},
  author    = {Wu, Huikai and Zhang, Junge and Huang, Kaiqi and Liang, Kongming and Yu Yizhou},
  booktitle = {arXiv preprint arXiv:1903.11816},
  year = {2019}
}

Contact: Hui-Kai Wu (huikaiwu@icloud.com)

Update

2020-04-15: Now support inference on a single image !!!

CUDA_VISIBLE_DEVICES=0,1,2,3 python -m experiments.segmentation.test_single_image --dataset [pcontext|ade20k] \
    --model [encnet|deeplab|psp] --jpu [JPU|JPU_X] \
    --backbone [resnet50|resnet101] [--ms] --resume {MODEL} --input-path {INPUT} --save-path {OUTPUT}

2020-04-15: New joint upsampling module is now available !!!

2020-02-20: FastFCN can now run on every OS with PyTorch>=1.1.0 and Python==3.*.*

Version

  1. Original code, producing the results reported in the arXiv paper. [branch:v1.0.0]
  2. Pure PyTorch code, with torch.nn.DistributedDataParallel and torch.nn.SyncBatchNorm. [branch:latest]
  3. Pure Python code. [branch:master]

Overview

Framework

Joint Pyramid Upsampling (JPU)

Install

  1. PyTorch >= 1.1.0 (Note: The code is test in the environment with python=3.6, cuda=9.0)
  2. Download FastFCN
    git clone https://github.com/wuhuikai/FastFCN.git
    cd FastFCN
    
  3. Install Requirements
    nose
    tqdm
    scipy
    cython
    requests
    

Train and Test

PContext

python -m scripts.prepare_pcontext
MethodBackbonemIoUFPSModelScripts
EncNetResNet-5049.9118.77
EncNet+JPU (ours)ResNet-5051.0537.56GoogleDrivebash
PSPResNet-5050.5818.08
PSP+JPU (ours)ResNet-5050.8928.48GoogleDrivebash
DeepLabV3ResNet-5049.1915.99
DeepLabV3+JPU (ours)ResNet-5050.0720.67GoogleDrivebash
EncNetResNet-10152.60 (MS)10.51
EncNet+JPU (ours)ResNet-10154.03 (MS)32.02GoogleDrivebash

ADE20K

python -m scripts.prepare_ade20k

Training Set

MethodBackbonemIoU (MS)ModelScripts
EncNetResNet-5041.11
EncNet+JPU (ours)ResNet-5042.75GoogleDrivebash
EncNetResNet-10144.65
EncNet+JPU (ours)ResNet-10144.34GoogleDrivebash

Training Set + Val Set

MethodBackboneFinalScore (MS)ModelScripts
EncNet+JPU (ours)ResNet-50GoogleDrivebash
EncNetResNet-10155.67
EncNet+JPU (ours)ResNet-10155.84GoogleDrivebash

Note: EncNet (ResNet-101) is trained with crop_size=576, while EncNet+JPU (ResNet-101) is trained with crop_size=480 for fitting 4 images into a 12G GPU.

Visual Results

DatasetInputGTEncNetOurs
PContext
ADE20K

More Visual Results

Acknowledgement

Code borrows heavily from PyTorch-Encoding.