Skip to content

Commit 4448647

Browse files
authored
[Feature] Support PointRend (open-mmlab#109)
* [Feature] Support PointRend * add previous test * update modelzoo
1 parent 7ec8239 commit 4448647

12 files changed

+554
-4
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Supported methods:
7373
- [x] [OCRNet](configs/ocrnet)
7474
- [x] [Fast-SCNN](configs/fastscnn)
7575
- [x] [Semantic FPN](configs/sem_fpn)
76+
- [x] [PointRend](configs/point_rend)
7677
- [x] [EMANet](configs/emanet)
7778
- [x] [DNLNet](configs/dnlnet)
7879
- [x] [Mixed Precision (FP16) Training](configs/fp16/README.md)
+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# model settings
2+
norm_cfg = dict(type='SyncBN', requires_grad=True)
3+
model = dict(
4+
type='CascadeEncoderDecoder',
5+
num_stages=2,
6+
pretrained='open-mmlab://resnet50_v1c',
7+
backbone=dict(
8+
type='ResNetV1c',
9+
depth=50,
10+
num_stages=4,
11+
out_indices=(0, 1, 2, 3),
12+
dilations=(1, 1, 1, 1),
13+
strides=(1, 2, 2, 2),
14+
norm_cfg=norm_cfg,
15+
norm_eval=False,
16+
style='pytorch',
17+
contract_dilation=True),
18+
neck=dict(
19+
type='FPN',
20+
in_channels=[256, 512, 1024, 2048],
21+
out_channels=256,
22+
num_outs=4),
23+
decode_head=[
24+
dict(
25+
type='FPNHead',
26+
in_channels=[256, 256, 256, 256],
27+
in_index=[0, 1, 2, 3],
28+
feature_strides=[4, 8, 16, 32],
29+
channels=128,
30+
dropout_ratio=-1,
31+
num_classes=19,
32+
norm_cfg=norm_cfg,
33+
align_corners=False,
34+
loss_decode=dict(
35+
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)),
36+
dict(
37+
type='PointHead',
38+
in_channels=[256],
39+
in_index=[0],
40+
channels=256,
41+
num_fcs=3,
42+
coarse_pred_each_layer=True,
43+
dropout_ratio=-1,
44+
num_classes=19,
45+
align_corners=False,
46+
loss_decode=dict(
47+
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0))
48+
])
49+
# model training and testing settings
50+
train_cfg = dict(
51+
num_points=2048, oversample_ratio=3, importance_sample_ratio=0.75)
52+
test_cfg = dict(
53+
mode='whole',
54+
subdivision_steps=2,
55+
subdivision_num_points=8196,
56+
scale_factor=2)

configs/point_rend/README.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# PointRend: Image Segmentation as Rendering
2+
3+
## Introduction
4+
```
5+
@misc{alex2019pointrend,
6+
title={PointRend: Image Segmentation as Rendering},
7+
author={Alexander Kirillov and Yuxin Wu and Kaiming He and Ross Girshick},
8+
year={2019},
9+
eprint={1912.08193},
10+
archivePrefix={arXiv},
11+
primaryClass={cs.CV}
12+
}
13+
```
14+
15+
## Results and models
16+
17+
### Cityscapes
18+
| Method | Backbone | Crop Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | download |
19+
|-----------|----------|-----------|--------:|---------:|----------------|------:|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
20+
| PointRend | R-50 | 512x1024 | 80000 | 3.1 | 8.48 | 76.47 | 78.13 | [model](https://openmmlab.oss-accelerate.aliyuncs.com/mmsegmentation/v0.5/point_rend/pointrend_r50_512x1024_80k_cityscapes/pointrend_r50_512x1024_80k_cityscapes_20200711_015821-bb1ff523.pth) | [log](https://openmmlab.oss-accelerate.aliyuncs.com/mmsegmentation/v0.5/point_rend/pointrend_r50_512x1024_80k_cityscapes/pointrend_r50_512x1024_80k_cityscapes-20200715_214714.log.json) |
21+
| PointRend | R-101 | 512x1024 | 80000 | 4.2 | 7.00 | 78.30 | 79.97 | [model](https://openmmlab.oss-accelerate.aliyuncs.com/mmsegmentation/v0.5/point_rend/pointrend_r101_512x1024_80k_cityscapes/pointrend_r101_512x1024_80k_cityscapes_20200711_170850-d0ca84be.pth) | [log](https://openmmlab.oss-accelerate.aliyuncs.com/mmsegmentation/v0.5/point_rend/pointrend_r101_512x1024_80k_cityscapes/pointrend_r101_512x1024_80k_cityscapes-20200715_214824.log.json) |
22+
23+
### ADE20K
24+
| Method | Backbone | Crop Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | download |
25+
|-----------|----------|-----------|--------:|---------:|----------------|------:|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
26+
| PointRend | R-50 | 512x512 | 160000 | 5.1 | 17.31 | 37.64 | 39.17 | [model](https://openmmlab.oss-accelerate.aliyuncs.com/mmsegmentation/v0.5/point_rend/pointrend_r50_512x512_160k_ade20k/pointrend_r50_512x512_160k_ade20k_20200807_232644-ac3febf2.pth) | [log](https://openmmlab.oss-accelerate.aliyuncs.com/mmsegmentation/v0.5/point_rend/pointrend_r50_512x512_160k_ade20k/pointrend_r50_512x512_160k_ade20k-20200807_232644.log.json) |
27+
| PointRend | R-101 | 512x512 | 160000 | 6.1 | 15.50 | 40.02 | 41.60 | [model](https://openmmlab.oss-accelerate.aliyuncs.com/mmsegmentation/v0.5/point_rend/pointrend_r101_512x512_160k_ade20k/pointrend_r101_512x512_160k_ade20k_20200808_030852-8834902a.pth) | [log](https://openmmlab.oss-accelerate.aliyuncs.com/mmsegmentation/v0.5/point_rend/pointrend_r101_512x512_160k_ade20k/pointrend_r101_512x512_160k_ade20k-20200808_030852.log.json) |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
_base_ = './pointrend_r50_512x1024_80k_cityscapes.py'
2+
model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
_base_ = './pointrend_r50_512x512_160k_ade20k.py'
2+
model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
_base_ = [
2+
'../_base_/models/pointrend_r50.py', '../_base_/datasets/cityscapes.py',
3+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py'
4+
]
5+
lr_config = dict(warmup='linear', warmup_iters=200)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
_base_ = [
2+
'../_base_/models/pointrend_r50.py', '../_base_/datasets/ade20k.py',
3+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py'
4+
]
5+
norm_cfg = dict(type='SyncBN', requires_grad=True)
6+
model = dict(decode_head=[
7+
dict(
8+
type='FPNHead',
9+
in_channels=[256, 256, 256, 256],
10+
in_index=[0, 1, 2, 3],
11+
feature_strides=[4, 8, 16, 32],
12+
channels=128,
13+
dropout_ratio=-1,
14+
num_classes=150,
15+
norm_cfg=norm_cfg,
16+
align_corners=False,
17+
loss_decode=dict(
18+
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)),
19+
dict(
20+
type='PointHead',
21+
in_channels=[256],
22+
in_index=[0],
23+
channels=256,
24+
num_fcs=3,
25+
coarse_pred_each_layer=True,
26+
dropout_ratio=-1,
27+
num_classes=150,
28+
align_corners=False,
29+
loss_decode=dict(
30+
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0))
31+
])
32+
lr_config = dict(warmup='linear', warmup_iters=200)

docs/model_zoo.md

+16
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,22 @@ Please refer to [Fast-SCNN](https://github.com/open-mmlab/mmsegmentation/blob/ma
8989

9090
Please refer to [ResNeSt](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/resnest) for details.
9191

92+
### Semantic FPN
93+
94+
Please refer to [Semantic FPN](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/semfpn) for details.
95+
96+
### PointRend
97+
98+
Please refer to [PointRend](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/point_rend) for details.
99+
100+
### EMANet
101+
102+
Please refer to [EMANet](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/emanet) for details.
103+
104+
### DNLNet
105+
106+
Please refer to [DNLNet](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/dnlnet) for details.
107+
92108
### Mixed Precision (FP16) Training
93109

94110
Please refer [Mixed Precision (FP16) Training](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/fp16/README.md) for details.

mmseg/models/decode_heads/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from .gc_head import GCHead
1111
from .nl_head import NLHead
1212
from .ocr_head import OCRHead
13+
from .point_head import PointHead
1314
from .psa_head import PSAHead
1415
from .psp_head import PSPHead
1516
from .sep_aspp_head import DepthwiseSeparableASPPHead
@@ -19,5 +20,6 @@
1920
__all__ = [
2021
'FCNHead', 'PSPHead', 'ASPPHead', 'PSAHead', 'NLHead', 'GCHead', 'CCHead',
2122
'UPerHead', 'DepthwiseSeparableASPPHead', 'ANNHead', 'DAHead', 'OCRHead',
22-
'EncHead', 'DepthwiseSeparableFCNHead', 'FPNHead', 'EMAHead', 'DNLHead'
23+
'EncHead', 'DepthwiseSeparableFCNHead', 'FPNHead', 'EMAHead', 'DNLHead',
24+
'PointHead'
2325
]

0 commit comments

Comments
 (0)