Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fast-SCNN implemented #58

Merged
merged 66 commits into from
Aug 18, 2020
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
6435e3e
init commit: fast_scnn
Jul 31, 2020
a5f1095
247917iters
Aug 2, 2020
06db844
4x8_80k
Aug 4, 2020
9f236f3
configs placed in configs_unify. 4x8_80k exp.running.
Aug 4, 2020
e059136
mmseg/utils/collect_env.py modified to support Windows
johnzja Aug 4, 2020
2e43bae
Merge branch 'add_fast_scnn' of github.com:johnzja/mmsegmentation int…
johnzja Aug 4, 2020
2b1f359
study on lr
johnzja Aug 4, 2020
dc6e781
bug in configs_unify/***/cityscapes.py fixed.
johnzja Aug 4, 2020
2bf70c5
lr0.08_100k
johnzja Aug 6, 2020
e7f6b9e
lr_power changed to 1.2
johnzja Aug 6, 2020
795fb20
log_config by_epoch set to False.
johnzja Aug 6, 2020
d3a5342
lr1.2
johnzja Aug 6, 2020
2c77085
doc strings added
johnzja Aug 7, 2020
c16940c
add fast_scnn backbone test
johnzja Aug 7, 2020
3d4db48
80k 0.08,0.12
johnzja Aug 7, 2020
8df067e
add 450k
johnzja Aug 7, 2020
54ae2ee
fast_scnn test: fix BN bug.
johnzja Aug 8, 2020
dce6ec4
Add different config files into configs/
johnzja Aug 9, 2020
0dd1ae5
.gitignore recovered.
johnzja Aug 9, 2020
94913d1
configs_unify del
johnzja Aug 9, 2020
4102ed3
.gitignore recovered.
johnzja Aug 9, 2020
daf93c6
delete sub-optimal config files of fast-scnn
johnzja Aug 9, 2020
e35f9ac
Code style improved.
johnzja Aug 9, 2020
d8cba3d
add docstrings to component modules of fast-scnn
johnzja Aug 10, 2020
e1986a5
relevant files modified according to Jerry's instructions
johnzja Aug 11, 2020
164e038
Merge pull request #1 from open-mmlab/master
johnzja Aug 11, 2020
1456a48
relevant files modified according to Jerry's instructions
johnzja Aug 11, 2020
70456bb
lint problems fixed.
johnzja Aug 11, 2020
8baea98
fast_scnn config extremely simplified.
johnzja Aug 11, 2020
9c6b0b1
InvertedResidual
johnzja Aug 11, 2020
8c553e0
fixed padding problems
johnzja Aug 11, 2020
ae85850
add unit test for inverted_residual
johnzja Aug 11, 2020
0d0641b
add unit test for inverted_residual: debug 0
johnzja Aug 11, 2020
b3bd282
add unit test for inverted_residual: debug 1
johnzja Aug 11, 2020
db364ef
add unit test for inverted_residual: debug 2
johnzja Aug 11, 2020
66224e9
add unit test for inverted_residual: debug 3
johnzja Aug 11, 2020
36228f5
add unit test for sep_fcn_head: debug 0
johnzja Aug 12, 2020
2162e7f
add unit test for sep_fcn_head: debug 1
johnzja Aug 12, 2020
0466908
add unit test for sep_fcn_head: debug 2
johnzja Aug 12, 2020
03ca449
add unit test for sep_fcn_head: debug 3
johnzja Aug 12, 2020
c89674d
add unit test for sep_fcn_head: debug 4
johnzja Aug 12, 2020
ed3a6d0
add unit test for sep_fcn_head: debug 5
johnzja Aug 12, 2020
b08e1d4
FastSCNN type(dwchannels) changed to tuple.
johnzja Aug 12, 2020
80fd7f6
t changed to expand_ratio.
johnzja Aug 12, 2020
887aec2
Spaces fixed.
johnzja Aug 12, 2020
1988f09
Update mmseg/models/backbones/fast_scnn.py
johnzja Aug 12, 2020
95d1a8d
Update mmseg/models/decode_heads/sep_fcn_head.py
johnzja Aug 12, 2020
568106c
Update mmseg/models/decode_heads/sep_fcn_head.py
johnzja Aug 12, 2020
a3fb9b1
Docstrings fixed.
johnzja Aug 12, 2020
18cb257
Docstrings fixed.
johnzja Aug 12, 2020
3bc95a4
Inverted Residual kept coherent with mmcl.
johnzja Aug 12, 2020
661ef92
Inverted Residual kept coherent with mmcl. Debug 0
johnzja Aug 12, 2020
12d0090
_make_layer parameters renamed.
johnzja Aug 13, 2020
a8a5ff8
final commit
johnzja Aug 13, 2020
88a123d
Arg scale_factor deleted.
johnzja Aug 14, 2020
a9ac0d8
Expand_ratio docstrings updated.
johnzja Aug 14, 2020
e7458e5
final commit
johnzja Aug 14, 2020
b3eaf8a
Readme for Fast-SCNN added.
johnzja Aug 14, 2020
cc5cb7d
model-zoo.md modified.
johnzja Aug 14, 2020
4e7cdf9
fast_scnn README updated.
johnzja Aug 16, 2020
9f128f9
Move InvertedResidual module into mmseg/utils.
johnzja Aug 17, 2020
3cbfbf6
Merge branch 'master' of https://github.com/open-mmlab/mmsegmentation…
johnzja Aug 17, 2020
89dcce4
test_inverted_residual module corrected.
johnzja Aug 17, 2020
adb1f0d
test_inverted_residual.py moved.
johnzja Aug 18, 2020
dd0aadf
encoder_decoder modified to avoid bugs when running PSPNet.
johnzja Aug 18, 2020
4a35807
Revert "encoder_decoder modified to avoid bugs when running PSPNet. "
johnzja Aug 18, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions configs/_base_/models/fast_scnn.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# model settings
norm_cfg = dict(type='SyncBN', requires_grad=True, momentum=0.01)
model = dict(
type='EncoderDecoder',
backbone=dict(
type='FastSCNN',
downsample_dw_channels=(32, 48),
global_in_channels=64,
global_block_channels=(64, 96, 128),
global_block_strides=(2, 2, 1),
global_out_channels=128,
higher_in_channels=64,
lower_in_channels=128,
fusion_out_channels=128,
out_indices=(0, 1, 2),
norm_cfg=norm_cfg,
align_corners=False),
decode_head=dict(
type='DepthwiseSeparableFCNHead',
in_channels=128,
channels=128,
concat_input=False,
num_classes=19,
in_index=-1,
norm_cfg=norm_cfg,
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.)),
auxiliary_head=[
dict(
type='FCNHead',
in_channels=128,
channels=32,
num_convs=1,
num_classes=19,
in_index=-2,
norm_cfg=norm_cfg,
concat_input=False,
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
dict(
type='FCNHead',
in_channels=64,
channels=32,
num_convs=1,
num_classes=19,
in_index=-3,
norm_cfg=norm_cfg,
concat_input=False,
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
])

# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='whole')
27 changes: 27 additions & 0 deletions configs/fastscnn/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Fast-SCNN for Semantic Segmentation

## Introduction
```
@article{DBLP:journals/corr/abs-1902-04502,
author = {Rudra P. K. Poudel and
Stephan Liwicki and
Roberto Cipolla},
title = {Fast-SCNN: Fast Semantic Segmentation Network},
journal = {CoRR},
volume = {abs/1902.04502},
year = {2019},
url = {http://arxiv.org/abs/1902.04502},
archivePrefix = {arXiv},
eprint = {1902.04502},
timestamp = {Tue, 21 May 2019 18:03:38 +0200},
biburl = {https://dblp.org/rec/journals/corr/abs-1902-04502.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@article{poudel2019fast,
  title={Fast-scnn: Fast semantic segmentation network},
  author={Poudel, Rudra PK and Liwicki, Stephan and Cipolla, Roberto},
  journal={arXiv preprint arXiv:1902.04502},
  year={2019}
}


## Results and models

### Cityscapes
| Method | Backbone | Crop Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | download |
|------------|-----------|-----------|--------:|----------|----------------|------:|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Fast-SCNN | Fast-SCNN | 512x1024 | 80000 | 8.4 | 63.61 | 69.06 | - | [model](https://openmmlab.oss-cn-hangzhou.aliyuncs.com/mmsegmentation/v0.5/fast_scnn/fast_scnn_4x8_80k_lr0.12_cityscapes-cae6c46a.pth) | [log](https://openmmlab.oss-cn-hangzhou.aliyuncs.com/mmsegmentation/v0.5/fast_scnn/fast_scnn_4x8_80k_lr0.12_cityscapes-20200807_165744.log.json) |
10 changes: 10 additions & 0 deletions configs/fastscnn/fast_scnn_4x8_80k_lr0.12_cityscapes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
_base_ = [
'../_base_/models/fast_scnn.py', '../_base_/datasets/cityscapes.py',
'../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py'
]

# Re-config the data sampler.
data = dict(samples_per_gpu=8, workers_per_gpu=4)

# Re-config the optimizer.
optimizer = dict(type='SGD', lr=0.12, momentum=0.9, weight_decay=4e-5)
3 changes: 3 additions & 0 deletions docs/model_zoo.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ Please refer to [ANN](https://github.com/open-mmlab/mmsegmentation/blob/master/c

Please refer to [OCRNet](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/ocrnet) for details.

### Fast-SCNN

Please refer to [Fast-SCNN](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/fastscnn) for details.

### Mixed Precision (FP16) Training

Expand Down
3 changes: 2 additions & 1 deletion mmseg/models/backbones/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from .fast_scnn import FastSCNN
from .hrnet import HRNet
from .resnet import ResNet, ResNetV1c, ResNetV1d
from .resnext import ResNeXt

__all__ = ['ResNet', 'ResNetV1c', 'ResNetV1d', 'ResNeXt', 'HRNet']
__all__ = ['ResNet', 'ResNetV1c', 'ResNetV1d', 'ResNeXt', 'HRNet', 'FastSCNN']
Loading