-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] Support ISPRS Vaihingen Dataset. (#1171)
* Add Vaihingen * upload models&logs of vaihingen * fix unit test * fix dataset pipeline * fix unit test coverage * fix vaihingen docstring
- Loading branch information
1 parent
6a22c42
commit 4b905cb
Showing
25 changed files
with
609 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# dataset settings | ||
dataset_type = 'ISPRSDataset' | ||
data_root = 'data/vaihingen' | ||
img_norm_cfg = dict( | ||
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) | ||
crop_size = (512, 512) | ||
train_pipeline = [ | ||
dict(type='LoadImageFromFile'), | ||
dict(type='LoadAnnotations', reduce_zero_label=True), | ||
dict(type='Resize', img_scale=(512, 512), ratio_range=(0.5, 2.0)), | ||
dict(type='RandomCrop', crop_size=crop_size, cat_max_ratio=0.75), | ||
dict(type='RandomFlip', prob=0.5), | ||
dict(type='PhotoMetricDistortion'), | ||
dict(type='Normalize', **img_norm_cfg), | ||
dict(type='Pad', size=crop_size, pad_val=0, seg_pad_val=255), | ||
dict(type='DefaultFormatBundle'), | ||
dict(type='Collect', keys=['img', 'gt_semantic_seg']), | ||
] | ||
test_pipeline = [ | ||
dict(type='LoadImageFromFile'), | ||
dict( | ||
type='MultiScaleFlipAug', | ||
img_scale=(512, 512), | ||
# img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75], | ||
flip=False, | ||
transforms=[ | ||
dict(type='Resize', keep_ratio=True), | ||
dict(type='RandomFlip'), | ||
dict(type='Normalize', **img_norm_cfg), | ||
dict(type='ImageToTensor', keys=['img']), | ||
dict(type='Collect', keys=['img']), | ||
]) | ||
] | ||
data = dict( | ||
samples_per_gpu=4, | ||
workers_per_gpu=4, | ||
train=dict( | ||
type=dataset_type, | ||
data_root=data_root, | ||
img_dir='img_dir/train', | ||
ann_dir='ann_dir/train', | ||
pipeline=train_pipeline), | ||
val=dict( | ||
type=dataset_type, | ||
data_root=data_root, | ||
img_dir='img_dir/val', | ||
ann_dir='ann_dir/val', | ||
pipeline=test_pipeline), | ||
test=dict( | ||
type=dataset_type, | ||
data_root=data_root, | ||
img_dir='img_dir/val', | ||
ann_dir='ann_dir/val', | ||
pipeline=test_pipeline)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
configs/deeplabv3plus/deeplabv3plus_r101-d8_4x4_512x512_80k_vaihingen.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
_base_ = './deeplabv3plus_r50-d8_4x4_512x512_80k_vaihingen.py' | ||
model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101)) |
11 changes: 11 additions & 0 deletions
11
configs/deeplabv3plus/deeplabv3plus_r18-d8_4x4_512x512_80k_vaihingen.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
_base_ = './deeplabv3plus_r50-d8_4x4_512x512_80k_vaihingen.py' | ||
model = dict( | ||
pretrained='open-mmlab://resnet18_v1c', | ||
backbone=dict(depth=18), | ||
decode_head=dict( | ||
c1_in_channels=64, | ||
c1_channels=12, | ||
in_channels=512, | ||
channels=128, | ||
), | ||
auxiliary_head=dict(in_channels=256, channels=64)) |
7 changes: 7 additions & 0 deletions
7
configs/deeplabv3plus/deeplabv3plus_r50-d8_4x4_512x512_80k_vaihingen.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
_base_ = [ | ||
'../_base_/models/deeplabv3plus_r50-d8.py', | ||
'../_base_/datasets/vaihingen.py', '../_base_/default_runtime.py', | ||
'../_base_/schedules/schedule_80k.py' | ||
] | ||
model = dict( | ||
decode_head=dict(num_classes=6), auxiliary_head=dict(num_classes=6)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
_base_ = [ | ||
'../_base_/models/fcn_hr18.py', '../_base_/datasets/vaihingen.py', | ||
'../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py' | ||
] | ||
model = dict(decode_head=dict(num_classes=6)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
_base_ = './fcn_hr18_4x4_512x512_80k_vaihingen.py' | ||
model = dict( | ||
pretrained='open-mmlab://msra/hrnetv2_w18_small', | ||
backbone=dict( | ||
extra=dict( | ||
stage1=dict(num_blocks=(2, )), | ||
stage2=dict(num_blocks=(2, 2)), | ||
stage3=dict(num_modules=3, num_blocks=(2, 2, 2)), | ||
stage4=dict(num_modules=2, num_blocks=(2, 2, 2, 2))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
_base_ = './fcn_hr18_4x4_512x512_80k_vaihingen.py' | ||
model = dict( | ||
pretrained='open-mmlab://msra/hrnetv2_w48', | ||
backbone=dict( | ||
extra=dict( | ||
stage2=dict(num_channels=(48, 96)), | ||
stage3=dict(num_channels=(48, 96, 192)), | ||
stage4=dict(num_channels=(48, 96, 192, 384)))), | ||
decode_head=dict( | ||
in_channels=[48, 96, 192, 384], channels=sum([48, 96, 192, 384]))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.