forked from open-mmlab/mmsegmentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Pascal Context to mmsegmentation (open-mmlab#133)
* Add Pascal Context to mmsegmentation * Add benchmark result to Pascal Context * fix mmcv version * fix code syntax * fix code syntax again * Update mmseg/models/segmentors/encoder_decoder.py update hint Co-authored-by: Jerry Jiarui XU <[email protected]> * update comment * fix pascal context model path * fix model path mistake again * fix model path mistake again * fix model path mistakes again Co-authored-by: Jerry Jiarui XU <[email protected]>
- Loading branch information
Showing
34 changed files
with
393 additions
and
5 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,60 @@ | ||
# dataset settings | ||
dataset_type = 'PascalContextDataset' | ||
data_root = 'data/VOCdevkit/VOC2010/' | ||
img_norm_cfg = dict( | ||
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) | ||
|
||
img_scale = (520, 520) | ||
crop_size = (480, 480) | ||
|
||
train_pipeline = [ | ||
dict(type='LoadImageFromFile'), | ||
dict(type='LoadAnnotations'), | ||
dict(type='Resize', img_scale=img_scale, ratio_range=(0.5, 2.0)), | ||
dict(type='RandomCrop', crop_size=crop_size, cat_max_ratio=0.75), | ||
dict(type='RandomFlip', flip_ratio=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=img_scale, | ||
# 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='JPEGImages', | ||
ann_dir='SegmentationClassContext', | ||
split='ImageSets/SegmentationContext/train.txt', | ||
pipeline=train_pipeline), | ||
val=dict( | ||
type=dataset_type, | ||
data_root=data_root, | ||
img_dir='JPEGImages', | ||
ann_dir='SegmentationClassContext', | ||
split='ImageSets/SegmentationContext/val.txt', | ||
pipeline=test_pipeline), | ||
test=dict( | ||
type=dataset_type, | ||
data_root=data_root, | ||
img_dir='JPEGImages', | ||
ann_dir='SegmentationClassContext', | ||
split='ImageSets/SegmentationContext/val.txt', | ||
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
2 changes: 2 additions & 0 deletions
2
configs/deeplabv3/deeplabv3_r101-d8_480x480_40k_pascal_context.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_ = './deeplabv3_r50-d8_480x480_40k_pascal_context.py' | ||
model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101)) |
2 changes: 2 additions & 0 deletions
2
configs/deeplabv3/deeplabv3_r101-d8_480x480_80k_pascal_context.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_ = './deeplabv3_r50-d8_480x480_80k_pascal_context.py' | ||
model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101)) |
9 changes: 9 additions & 0 deletions
9
configs/deeplabv3/deeplabv3_r50-d8_480x480_40k_pascal_context.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,9 @@ | ||
_base_ = [ | ||
'../_base_/models/deeplabv3_r50-d8.py', | ||
'../_base_/datasets/pascal_context.py', '../_base_/default_runtime.py', | ||
'../_base_/schedules/schedule_40k.py' | ||
] | ||
model = dict( | ||
decode_head=dict(num_classes=60), auxiliary_head=dict(num_classes=60)) | ||
test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) | ||
optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) |
9 changes: 9 additions & 0 deletions
9
configs/deeplabv3/deeplabv3_r50-d8_480x480_80k_pascal_context.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,9 @@ | ||
_base_ = [ | ||
'../_base_/models/deeplabv3_r50-d8.py', | ||
'../_base_/datasets/pascal_context.py', '../_base_/default_runtime.py', | ||
'../_base_/schedules/schedule_80k.py' | ||
] | ||
model = dict( | ||
decode_head=dict(num_classes=60), auxiliary_head=dict(num_classes=60)) | ||
test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) | ||
optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) |
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_480x480_40k_pascal_context.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_480x480_40k_pascal_context.py' | ||
model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101)) |
2 changes: 2 additions & 0 deletions
2
configs/deeplabv3plus/deeplabv3plus_r101-d8_480x480_80k_pascal_context.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_480x480_80k_pascal_context.py' | ||
model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101)) |
9 changes: 9 additions & 0 deletions
9
configs/deeplabv3plus/deeplabv3plus_r50-d8_480x480_40k_pascal_context.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,9 @@ | ||
_base_ = [ | ||
'../_base_/models/deeplabv3plus_r50-d8.py', | ||
'../_base_/datasets/pascal_context.py', '../_base_/default_runtime.py', | ||
'../_base_/schedules/schedule_40k.py' | ||
] | ||
model = dict( | ||
decode_head=dict(num_classes=60), auxiliary_head=dict(num_classes=60)) | ||
test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) | ||
optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) |
9 changes: 9 additions & 0 deletions
9
configs/deeplabv3plus/deeplabv3plus_r50-d8_480x480_80k_pascal_context.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,9 @@ | ||
_base_ = [ | ||
'../_base_/models/deeplabv3plus_r50-d8.py', | ||
'../_base_/datasets/pascal_context.py', '../_base_/default_runtime.py', | ||
'../_base_/schedules/schedule_80k.py' | ||
] | ||
model = dict( | ||
decode_head=dict(num_classes=60), auxiliary_head=dict(num_classes=60)) | ||
test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) | ||
optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) |
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,2 @@ | ||
_base_ = './fcn_r50-d8_480x480_40k_pascal_context.py' | ||
model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101)) |
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_ = './fcn_r50-d8_480x480_80k_pascal_context.py' | ||
model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101)) |
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/fcn_r50-d8.py', '../_base_/datasets/pascal_context.py', | ||
'../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py' | ||
] | ||
model = dict(decode_head=dict(num_classes=60)) | ||
test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) | ||
optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) |
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/fcn_r50-d8.py', '../_base_/datasets/pascal_context.py', | ||
'../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py' | ||
] | ||
model = dict(decode_head=dict(num_classes=60)) | ||
test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) | ||
optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) |
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,7 @@ | ||
_base_ = [ | ||
'../_base_/models/fcn_hr18.py', '../_base_/datasets/pascal_context.py', | ||
'../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py' | ||
] | ||
model = dict(decode_head=dict(num_classes=60)) | ||
test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) | ||
optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) |
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/fcn_hr18.py', '../_base_/datasets/pascal_context.py', | ||
'../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py' | ||
] | ||
model = dict(decode_head=dict(num_classes=60)) | ||
test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) | ||
optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) |
Oops, something went wrong.