GatedSCNN
GatedSCNN copied to clipboard
A PyTorch implementation of Gated-SCNN based on ICCV 2019 paper "Gated-SCNN: Gated Shape CNNs for Semantic Segmentation"
Gated-SCNN
A PyTorch implementation of Gated-SCNN based on ICCV 2019 paper Gated-SCNN: Gated Shape CNNs for Semantic Segmentation.
Requirements
conda install pytorch torchvision cudatoolkit=11.0 -c pytorch
- timm
pip install timm
- opencv
pip install opencv-python
- cityscapesScripts
pip install cityscapesscripts
Usage
Train model
python train.py --epochs 175 --backbone_type resnet101
optional arguments:
--data_path Data path for cityscapes dataset [default value is 'data']
--backbone_type Backbone type [default value is 'resnet50'](choices=['resnet50', 'resnet101'])
--crop_h Crop height for training images [default value is 512]
--crop_w Crop width for training images [default value is 512]
--batch_size Number of data for each batch to train [default value is 4]
--epochs Number of sweeps over the dataset to train [default value is 60]
--save_path Save path for results [default value is 'results']
Eval model
python viewer.py --model_weight resnet101_800_800_model.pth
optional arguments:
--data_path Data path for cityscapes dataset [default value is 'data']
--model_weight Pretrained model weight [default value is 'results/resnet50_512_512_model.pth']
--input_pic Path to the input picture [default value is 'test/berlin/berlin_000000_000019_leftImg8bit.png']
Results
The experiment is conducted on one NVIDIA TITAN RTX (24G) GPU, and there are some difference between this implementation and official implementation:
-
res2/res3/res4
are used inGCLs
; - The non-differentiable part of
dual task loss
is not implemented; - The model is trained for
60 epochs
withbatch_size 4
on512x512
images.
BackBone | PAval | mPAval | Class mIOUval | Category mIOUval | Class mIOUtest | Category mIOUtest | FPS | Download |
---|---|---|---|---|---|---|---|---|
ResNet50 | 92.6 | 62.4 | 53.1 | 82.3 | 53.5 | 83.3 | 2 | dsjb |
The left is the input image, the middle is ground truth segmentation, and the right is model's predicted segmentation.