Skip to content

Commit b997a13

Browse files
[Feature] Support ISPRS Potsdam Dataset. (open-mmlab#1097)
* add isprs potsdam dataset * add isprs dataset configs * fix lint error * fix potsdam conversion bug * fix error in potsdam class * fix error in potsdam class * add vaihingen dataset * add vaihingen dataset * add vaihingen dataset * fix some description errors. * fix some description errors. * fix some description errors. * upload models & logs of Potsdam * remove vaihingen and add unit test * add chinese readme * add pseudodataset * use mmcv and add class_names * use f-string * add new dataset unittest * add docstring and remove global variables args * fix metafile error in PSPNet * fix pretrained value * Add dataset info * fix typo Co-authored-by: MengzhangLI <[email protected]>
1 parent 0f48c76 commit b997a13

25 files changed

+616
-3
lines changed

configs/_base_/datasets/potsdam.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# dataset settings
2+
dataset_type = 'PotsdamDataset'
3+
data_root = 'data/potsdam'
4+
img_norm_cfg = dict(
5+
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
6+
crop_size = (512, 512)
7+
train_pipeline = [
8+
dict(type='LoadImageFromFile'),
9+
dict(type='LoadAnnotations', reduce_zero_label=True),
10+
dict(type='Resize', img_scale=(512, 512), ratio_range=(0.5, 2.0)),
11+
dict(type='RandomCrop', crop_size=crop_size, cat_max_ratio=0.75),
12+
dict(type='RandomFlip', prob=0.5),
13+
dict(type='PhotoMetricDistortion'),
14+
dict(type='Normalize', **img_norm_cfg),
15+
dict(type='Pad', size=crop_size, pad_val=0, seg_pad_val=255),
16+
dict(type='DefaultFormatBundle'),
17+
dict(type='Collect', keys=['img', 'gt_semantic_seg']),
18+
]
19+
test_pipeline = [
20+
dict(type='LoadImageFromFile'),
21+
dict(
22+
type='MultiScaleFlipAug',
23+
img_scale=(512, 512),
24+
# img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75],
25+
flip=False,
26+
transforms=[
27+
dict(type='Resize', keep_ratio=True),
28+
dict(type='RandomFlip'),
29+
dict(type='Normalize', **img_norm_cfg),
30+
dict(type='ImageToTensor', keys=['img']),
31+
dict(type='Collect', keys=['img']),
32+
])
33+
]
34+
data = dict(
35+
samples_per_gpu=4,
36+
workers_per_gpu=4,
37+
train=dict(
38+
type=dataset_type,
39+
data_root=data_root,
40+
img_dir='img_dir/train',
41+
ann_dir='ann_dir/train',
42+
pipeline=train_pipeline),
43+
val=dict(
44+
type=dataset_type,
45+
data_root=data_root,
46+
img_dir='img_dir/val',
47+
ann_dir='ann_dir/val',
48+
pipeline=test_pipeline),
49+
test=dict(
50+
type=dataset_type,
51+
data_root=data_root,
52+
img_dir='img_dir/val',
53+
ann_dir='ann_dir/val',
54+
pipeline=test_pipeline))

configs/deeplabv3plus/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@ Spatial pyramid pooling module or encode-decoder structure are used in deep neur
104104
| DeepLabV3+ | R-50-D8 | 512x512 | 80000 | 7.37 | 6.00 | 50.99 | 50.65 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/deeplabv3plus/deeplabv3plus_r50-d8_512x512_80k_loveda.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3plus/deeplabv3plus_r50-d8_512x512_80k_loveda/deeplabv3plus_r50-d8_512x512_80k_loveda_20211105_080442-f0720392.pth) &#124; [log](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3plus/deeplabv3plus_r50-d8_512x512_80k_loveda/deeplabv3plus_r50-d8_512x512_80k_loveda_20211105_080442.log.json) |
105105
| DeepLabV3+ | R-101-D8 | 512x512 | 80000 | 10.84 | 4.33 | 51.47 | 51.32 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/deeplabv3plus/deeplabv3plus_r101-d8_512x512_80k_loveda.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3plus/deeplabv3plus_r101-d8_512x512_80k_loveda/deeplabv3plus_r101-d8_512x512_80k_loveda_20211105_110759-4c1f297e.pth) &#124; [log](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3plus/deeplabv3plus_r101-d8_512x512_80k_loveda/deeplabv3plus_r101-d8_512x512_80k_loveda_20211105_110759.log.json) |
106106

107+
### Potsdam
108+
109+
| Method | Backbone | Crop Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | config | download |
110+
| ---------- | -------- | --------- | ------: | -------- | -------------- | ----: | ------------: | -------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
111+
| DeepLabV3+ | R-18-D8 | 512x512 | 80000 | 1.91 | 81.68 | 77.09 | 78.44 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/deeplabv3plus/deeplabv3plus_r18-d8_512x512_80k_potsdam.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3plus/deeplabv3plus_r18-d8_512x512_80k_potsdam/deeplabv3plus_r18-d8_512x512_80k_potsdam_20211219_020601-75fd5bc3.pth) &#124; [log](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3plus/deeplabv3plus_r18-d8_512x512_80k_potsdam/deeplabv3plus_r18-d8_512x512_80k_potsdam_20211219_020601.log.json) |
112+
| DeepLabV3+ | R-50-D8 | 512x512 | 80000 | 7.36 | 26.44 | 78.33 | 79.27 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/deeplabv3plus/deeplabv3plus_r50-d8_512x512_80k_potsdam.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3plus/deeplabv3plus_r50-d8_512x512_80k_potsdam/deeplabv3plus_r50-d8_512x512_80k_potsdam_20211219_031508-7e7a2b24.pth) &#124; [log](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3plus/deeplabv3plus_r50-d8_512x512_80k_potsdam/deeplabv3plus_r50-d8_512x512_80k_potsdam_20211219_031508.log.json) |
113+
| DeepLabV3+ | R-101-D8 | 512x512 | 80000 | 10.83 | 17.56 | 78.7 | 79.47 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/deeplabv3plus/deeplabv3plus_r101-d8_512x512_80k_potsdam.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3plus/deeplabv3plus_r101-d8_512x512_80k_potsdam/deeplabv3plus_r101-d8_512x512_80k_potsdam_20211219_031508-8b112708.pth) &#124; [log](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3plus/deeplabv3plus_r101-d8_512x512_80k_potsdam/deeplabv3plus_r101-d8_512x512_80k_potsdam_20211219_031508.log.json) |
114+
107115
Note:
108116

109117
- `FP16` means Mixed Precision (FP16) is adopted in training.

configs/deeplabv3plus/deeplabv3plus.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Collections:
88
- Pascal Context
99
- Pascal Context 59
1010
- LoveDA
11+
- Potsdam
1112
Paper:
1213
URL: https://arxiv.org/abs/1802.02611
1314
Title: Encoder-Decoder with Atrous Separable Convolution for Semantic Image Segmentation
@@ -669,3 +670,69 @@ Models:
669670
mIoU(ms+flip): 51.32
670671
Config: configs/deeplabv3plus/deeplabv3plus_r101-d8_512x512_80k_loveda.py
671672
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3plus/deeplabv3plus_r101-d8_512x512_80k_loveda/deeplabv3plus_r101-d8_512x512_80k_loveda_20211105_110759-4c1f297e.pth
673+
- Name: deeplabv3plus_r18-d8_512x512_80k_potsdam
674+
In Collection: deeplabv3plus
675+
Metadata:
676+
backbone: R-18-D8
677+
crop size: (512,512)
678+
lr schd: 80000
679+
inference time (ms/im):
680+
- value: 12.24
681+
hardware: V100
682+
backend: PyTorch
683+
batch size: 1
684+
mode: FP32
685+
resolution: (512,512)
686+
Training Memory (GB): 1.91
687+
Results:
688+
- Task: Semantic Segmentation
689+
Dataset: Potsdam
690+
Metrics:
691+
mIoU: 77.09
692+
mIoU(ms+flip): 78.44
693+
Config: configs/deeplabv3plus/deeplabv3plus_r18-d8_512x512_80k_potsdam.py
694+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3plus/deeplabv3plus_r18-d8_512x512_80k_potsdam/deeplabv3plus_r18-d8_512x512_80k_potsdam_20211219_020601-75fd5bc3.pth
695+
- Name: deeplabv3plus_r50-d8_512x512_80k_potsdam
696+
In Collection: deeplabv3plus
697+
Metadata:
698+
backbone: R-50-D8
699+
crop size: (512,512)
700+
lr schd: 80000
701+
inference time (ms/im):
702+
- value: 37.82
703+
hardware: V100
704+
backend: PyTorch
705+
batch size: 1
706+
mode: FP32
707+
resolution: (512,512)
708+
Training Memory (GB): 7.36
709+
Results:
710+
- Task: Semantic Segmentation
711+
Dataset: Potsdam
712+
Metrics:
713+
mIoU: 78.33
714+
mIoU(ms+flip): 79.27
715+
Config: configs/deeplabv3plus/deeplabv3plus_r50-d8_512x512_80k_potsdam.py
716+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3plus/deeplabv3plus_r50-d8_512x512_80k_potsdam/deeplabv3plus_r50-d8_512x512_80k_potsdam_20211219_031508-7e7a2b24.pth
717+
- Name: deeplabv3plus_r101-d8_512x512_80k_potsdam
718+
In Collection: deeplabv3plus
719+
Metadata:
720+
backbone: R-101-D8
721+
crop size: (512,512)
722+
lr schd: 80000
723+
inference time (ms/im):
724+
- value: 56.95
725+
hardware: V100
726+
backend: PyTorch
727+
batch size: 1
728+
mode: FP32
729+
resolution: (512,512)
730+
Training Memory (GB): 10.83
731+
Results:
732+
- Task: Semantic Segmentation
733+
Dataset: Potsdam
734+
Metrics:
735+
mIoU: 78.7
736+
mIoU(ms+flip): 79.47
737+
Config: configs/deeplabv3plus/deeplabv3plus_r101-d8_512x512_80k_potsdam.py
738+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3plus/deeplabv3plus_r101-d8_512x512_80k_potsdam/deeplabv3plus_r101-d8_512x512_80k_potsdam_20211219_031508-8b112708.pth
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
_base_ = './deeplabv3plus_r50-d8_512x512_80k_potsdam.py'
2+
model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101))
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
_base_ = './deeplabv3plus_r50-d8_512x512_80k_potsdam.py'
2+
model = dict(
3+
pretrained='open-mmlab://resnet18_v1c',
4+
backbone=dict(depth=18),
5+
decode_head=dict(
6+
c1_in_channels=64,
7+
c1_channels=12,
8+
in_channels=512,
9+
channels=128,
10+
),
11+
auxiliary_head=dict(in_channels=256, channels=64))
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
_base_ = [
2+
'../_base_/models/deeplabv3plus_r50-d8.py',
3+
'../_base_/datasets/potsdam.py', '../_base_/default_runtime.py',
4+
'../_base_/schedules/schedule_80k.py'
5+
]
6+
model = dict(
7+
decode_head=dict(num_classes=6), auxiliary_head=dict(num_classes=6))

configs/hrnet/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,11 @@ High-resolution representations are essential for position-sensitive vision prob
9292
| FCN | HRNetV2p-W18-Small | 512x512 | 80000 | 1.59 | 24.87 | 49.28 | 49.42 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/hrnet/fcn_hr18s_512x512_80k_loveda.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/hrnet/fcn_hr18s_512x512_80k_loveda/fcn_hr18s_512x512_80k_loveda_20211210_203228-60a86a7a.pth) &#124; [log](https://download.openmmlab.com/mmsegmentation/v0.5/hrnet/fcn_hr18s_512x512_80k_loveda/fcn_hr18s_512x512_80k_loveda_20211210_203228.log.json) |
9393
| FCN | HRNetV2p-W18 | 512x512 | 80000 | 2.76 | 12.92 | 50.81 | 50.95 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/hrnet/fcn_hr18_512x512_80k_loveda.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/hrnet/fcn_hr18_512x512_80k_loveda/fcn_hr18_512x512_80k_loveda_20211210_203952-93d9c3b3.pth) &#124; [log](https://download.openmmlab.com/mmsegmentation/v0.5/hrnet/fcn_hr18_512x512_80k_loveda/fcn_hr18_512x512_80k_loveda_20211210_203952.log.json) |
9494
| FCN | HRNetV2p-W48 | 512x512 | 80000 | 6.20 | 9.61 | 51.42 | 51.64 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/hrnet/fcn_hr48_512x512_80k_loveda.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/hrnet/fcn_hr48_512x512_80k_loveda/fcn_hr48_512x512_80k_loveda_20211211_044756-67072f55.pth) &#124; [log](https://download.openmmlab.com/mmsegmentation/v0.5/hrnet/fcn_hr48_512x512_80k_loveda/fcn_hr48_512x512_80k_loveda_20211211_044756.log.json) |
95+
96+
### Potsdam
97+
98+
| Method | Backbone | Crop Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | config | download |
99+
| ---------- | -------- | --------- | ------: | -------- | -------------- | ----: | ------------: | -------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
100+
| FCN | HRNetV2p-W18-Small | 512x512 | 80000 | 1.58 | 36.00 | 77.64 | 78.8 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/hrnet/fcn_hr18s_512x512_80k_potsdam.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/hrnet/fcn_hr18s_512x512_80k_potsdam/fcn_hr18s_512x512_80k_potsdam_20211218_205517-ba32af63.pth) &#124; [log](https://download.openmmlab.com/mmsegmentation/v0.5/hrnet/fcn_hr18s_512x512_80k_potsdam/fcn_hr18s_512x512_80k_potsdam_20211218_205517.log.json) |
101+
| FCN | HRNetV2p-W18 | 512x512 | 80000 | 2.76 | 19.25 | 78.26 | 79.24 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/hrnet/fcn_hr18_512x512_80k_potsdam.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/hrnet/fcn_hr18_512x512_80k_potsdam/fcn_hr18_512x512_80k_potsdam_20211218_205517-5d0387ad.pth) &#124; [log](https://download.openmmlab.com/mmsegmentation/v0.5/hrnet/fcn_hr18_512x512_80k_potsdam/fcn_hr18_512x512_80k_potsdam_20211218_205517.log.json) |
102+
| FCN | HRNetV2p-W48 | 512x512 | 80000 | 6.20 | 16.42 | 78.39 | 79.34 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/hrnet/fcn_hr48_512x512_80k_potsdam.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/hrnet/fcn_hr48_512x512_80k_potsdam/fcn_hr48_512x512_80k_potsdam_20211219_020601-97434c78.pth) &#124; [log](https://download.openmmlab.com/mmsegmentation/v0.5/hrnet/fcn_hr48_512x512_80k_potsdam/fcn_hr48_512x512_80k_potsdam_20211219_020601.log.json) |
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
_base_ = [
2+
'../_base_/models/fcn_hr18.py', '../_base_/datasets/potsdam.py',
3+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py'
4+
]
5+
model = dict(decode_head=dict(num_classes=6))
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
_base_ = './fcn_hr18_512x512_80k_potsdam.py'
2+
model = dict(
3+
pretrained='open-mmlab://msra/hrnetv2_w18_small',
4+
backbone=dict(
5+
extra=dict(
6+
stage1=dict(num_blocks=(2, )),
7+
stage2=dict(num_blocks=(2, 2)),
8+
stage3=dict(num_modules=3, num_blocks=(2, 2, 2)),
9+
stage4=dict(num_modules=2, num_blocks=(2, 2, 2, 2)))))
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
_base_ = './fcn_hr18_512x512_80k_potsdam.py'
2+
model = dict(
3+
pretrained='open-mmlab://msra/hrnetv2_w48',
4+
backbone=dict(
5+
extra=dict(
6+
stage2=dict(num_channels=(48, 96)),
7+
stage3=dict(num_channels=(48, 96, 192)),
8+
stage4=dict(num_channels=(48, 96, 192, 384)))),
9+
decode_head=dict(
10+
in_channels=[48, 96, 192, 384], channels=sum([48, 96, 192, 384])))

0 commit comments

Comments
 (0)