-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add Pascal Context to mmsegmentation #133
Merged
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0999c55
Add Pascal Context to mmsegmentation
yamengxi 1c288b1
Add benchmark result to Pascal Context
yamengxi 1efff53
fix mmcv version
yamengxi ed02391
fix code syntax
yamengxi f549690
fix code syntax again
yamengxi 4ec3d85
Update mmseg/models/segmentors/encoder_decoder.py
yamengxi 496cd83
update comment
yamengxi 3835800
update comment
yamengxi cb4b6b6
fix pascal context model path
yamengxi dd04316
fix model path mistake again
yamengxi 8fed415
fix model path mistake again
yamengxi 042901c
fix model path mistakes again
yamengxi 1e73bf1
Merge branch 'master' into Pascal_Context
yamengxi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,61 @@ | ||
# 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='Pad', size=crop_size, pad_val=(-123.675/58.395, -116.28/57.12, -103.53/57.375), seg_pad_val=255), | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# optimizer | ||
optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) | ||
optimizer_config = dict() | ||
# learning policy | ||
lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False) | ||
# runtime settings | ||
total_iters = 40000 | ||
checkpoint_config = dict(by_epoch=False, interval=4000) | ||
evaluation = dict(interval=4000, metric='mIoU') | ||
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 @@ | ||
# optimizer | ||
optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) | ||
optimizer_config = dict() | ||
# learning policy | ||
lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We may delete this file and modify the corresponding lr directly. |
||
# runtime settings | ||
total_iters = 80000 | ||
checkpoint_config = dict(by_epoch=False, interval=8000) | ||
evaluation = dict(interval=8000, metric='mIoU') |
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)) |
8 changes: 8 additions & 0 deletions
8
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,8 @@ | ||
_base_ = [ | ||
'../_base_/models/deeplabv3_r50-d8.py', | ||
'../_base_/datasets/pascal_context.py', '../_base_/default_runtime.py', | ||
'../_base_/schedules/schedule_40k_lr4e-3.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)) |
8 changes: 8 additions & 0 deletions
8
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,8 @@ | ||
_base_ = [ | ||
'../_base_/models/deeplabv3_r50-d8.py', | ||
'../_base_/datasets/pascal_context.py', '../_base_/default_runtime.py', | ||
'../_base_/schedules/schedule_80k_lr4e-3.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)) |
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)) |
8 changes: 8 additions & 0 deletions
8
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,8 @@ | ||
_base_ = [ | ||
'../_base_/models/deeplabv3plus_r50-d8.py', | ||
'../_base_/datasets/pascal_context.py', '../_base_/default_runtime.py', | ||
'../_base_/schedules/schedule_40k_lr4e-3.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)) |
8 changes: 8 additions & 0 deletions
8
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,8 @@ | ||
_base_ = [ | ||
'../_base_/models/deeplabv3plus_r50-d8.py', | ||
'../_base_/datasets/pascal_context.py', '../_base_/default_runtime.py', | ||
'../_base_/schedules/schedule_80k_lr4e-3.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)) |
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,6 @@ | ||
_base_ = [ | ||
'../_base_/models/fcn_r50-d8.py', '../_base_/datasets/pascal_context.py', | ||
'../_base_/default_runtime.py', '../_base_/schedules/schedule_40k_lr4e-3.py' | ||
] | ||
model = dict(decode_head=dict(num_classes=60)) | ||
test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) |
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,6 @@ | ||
_base_ = [ | ||
'../_base_/models/fcn_r50-d8.py', '../_base_/datasets/pascal_context.py', | ||
'../_base_/default_runtime.py', '../_base_/schedules/schedule_80k_lr4e-3.py' | ||
] | ||
model = dict(decode_head=dict(num_classes=60)) | ||
test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) |
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,6 @@ | ||
_base_ = [ | ||
'../_base_/models/fcn_hr18.py', '../_base_/datasets/pascal_context.py', | ||
'../_base_/default_runtime.py', '../_base_/schedules/schedule_40k_lr4e-3.py' | ||
] | ||
model = dict(decode_head=dict(num_classes=60)) | ||
test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) |
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,6 @@ | ||
_base_ = [ | ||
'../_base_/models/fcn_hr18.py', '../_base_/datasets/pascal_context.py', | ||
'../_base_/default_runtime.py', '../_base_/schedules/schedule_80k_lr4e-3.py' | ||
] | ||
model = dict(decode_head=dict(num_classes=60)) | ||
test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) |
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_480x480_40k_pascal_context.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,9 @@ | ||
_base_ = './fcn_hr18_480x480_80k_pascal_context.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_480x480_40k_pascal_context.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
_base_ = './fcn_hr18_480x480_80k_pascal_context.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
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_ = './pspnet_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_ = './pspnet_r50-d8_480x480_80k_pascal_context.py' | ||
model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101)) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may delete this file and modify the corresponding lr directly.