Skip to content

Commit

Permalink
🚀 feat : Release evaluation code and weights for Pascal Context dataset.
Browse files Browse the repository at this point in the history
# |<----  Using a Maximum Of 50 Characters  ---->|


# Explain why this change is being made
# |<----   Try To Limit Each Line to a Maximum Of 72 Characters   ---->|

# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23

# --- COMMIT END ---
# Type can be 
#    🔬 exp	 (new experiment)
#    🚀 feat     (new feature)
#    🧐 fix      (bug fix)
#    🏗️ refactor (refactoring production code)
#    🍻 style    (formatting, missing semi colons, etc; no code change)
#    📝 docs     (changes to documentation)
#    ✅ test     (adding or refactoring tests; no production code change)
#    💚 chore    (updating grunt tasks etc; no production code change)
# --------------------
  • Loading branch information
AkideLiu committed Jul 17, 2023
1 parent b99cc05 commit fbba941
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 91 deletions.
60 changes: 32 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,41 +130,45 @@ python tools/test.py {config.py} {checkpoint.pth} --eval mIoU



### Pascal Context 59
### Pascal Context 59 480*480 80k

| Methods | FLOPs(G) | Parameters(M) | mIoU(%) | mAcc(%) | Config | ckpt |
| ------------------ | -------- | ------------- | ------- | ------- | ------ | ---------- |
| T: PSPNet-R101 | 256\.89 | 68\.07 | 52\.47 | 63\.15 |||
| S:PSPnet-R18 | 54\.53 | 12\.82 | 43\.79 | 54\.46 |||
| SKDS | 54\.53 | 12\.82 | 45\.08 | 55\.56 |||
| IFVD | 54\.53 | 12\.82 | 45\.97 | 56\.6 |||
| CIRKD | 54\.53 | 12\.82 | 45\.62 | 56\.15 |||
| CWD | 54\.53 | 12\.82 | 45\.99 | 55\.56 |||
| **BPKD(Ours)** | 54\.53 | 12\.82 | **46\.82** | **56\.29** |||
| T: PSPNet-R101 | 256\.89 | 68\.07 | 52\.47 | 63\.15 |[Config](https://github.com/open-mmlab/mmsegmentation/blob/main/configs/pspnet/pspnet_r101-d8_4xb4-80k_pascal-context-59-480x480.py)|[Model](https://download.openmmlab.com/mmsegmentation/v0.5/pspnet/pspnet_r101-d8_480x480_80k_pascal_context_59/pspnet_r101-d8_480x480_80k_pascal_context_59_20210416_114418-fa6caaa2.pth)|
| S:PSPnet-R18 | 54\.53 | 12\.82 | 43\.79 | 54\.46 |[Config](eval/configs/baseline/pspnet/pspnet_r18-d8_480x480_80k_pascal_context_59.py)||
| SKDS | 54\.53 | 12\.82 | 45\.08 | 55\.56 |[Config](eval/configs/baseline/pspnet/pspnet_r18-d8_480x480_80k_pascal_context_59.py)||
| IFVD | 54\.53 | 12\.82 | 45\.97 | 56\.6 |[Config](eval/configs/baseline/pspnet/pspnet_r18-d8_480x480_80k_pascal_context_59.py)||
| CIRKD | 54\.53 | 12\.82 | 45\.62 | 56\.15 |[Config](eval/configs/baseline/pspnet/pspnet_r18-d8_480x480_80k_pascal_context_59.py)||
| CWD | 54\.53 | 12\.82 | 45\.99 | 55\.56 |[Config](eval/configs/baseline/pspnet/pspnet_r18-d8_480x480_80k_pascal_context_59.py)||
| **BPKD(Ours)** | 54\.53 | 12\.82 | **46\.82** | **56\.29** |[Config](eval/configs/baseline/pspnet/pspnet_r18-d8_480x480_80k_pascal_context_59.py)||
| | | | | |||
| T: HRNetV2P-W48 | 95\.64 | 65\.95 | 51\.12 | 61\.39 |||
| T: HRNetV2P-W48 | 95\.64 | 65\.95 | 51\.12 | 61\.39 |[Config](https://github.com/open-mmlab/mmsegmentation/blob/main/configs/hrnet/fcn_hr48_4xb4-80k_pascal-context-59-480x480.py)|[Model](https://download.openmmlab.com/mmsegmentation/v0.5/hrnet/fcn_hr48_480x480_80k_pascal_context_59/fcn_hr48_480x480_80k_pascal_context_59_20210411_003240-3ae7081e.pth)|
| S:HRNetV2P-W18S | 10\.49 | 3\.97 | 40\.62 | 51\.43 |||
| SKDS | 10\.49 | 3\.97 | 41\.54 | 52\.18 |||
| IFVD | 10\.49 | 3\.97 | 41\.55 | 52\.24 |||
| CIRKD | 10\.49 | 3\.97 | 42\.02 | 52\.88 |||
| CWD | 10\.49 | 3\.97 | 42\.89 | 53\.37 |||
| **BPKD(Ours)** | 10\.49 | 3\.97 | **43\.96** | **54\.51** |||
| SKDS | 10\.49 | 3\.97 | 41\.54 | 52\.18 |[Config](eval/configs/baseline/hrnet/fcn_hr18s_480x480_80k_pascal_context_59.py)||
| IFVD | 10\.49 | 3\.97 | 41\.55 | 52\.24 |[Config](eval/configs/baseline/hrnet/fcn_hr18s_480x480_80k_pascal_context_59.py)||
| CIRKD | 10\.49 | 3\.97 | 42\.02 | 52\.88 |[Config](eval/configs/baseline/hrnet/fcn_hr18s_480x480_80k_pascal_context_59.py)||
| CWD | 10\.49 | 3\.97 | 42\.89 | 53\.37 |[Config](eval/configs/baseline/hrnet/fcn_hr18s_480x480_80k_pascal_context_59.py)||
| **BPKD(Ours)** | 10\.49 | 3\.97 | **43\.96** | **54\.51** |[Config](eval/configs/baseline/hrnet/fcn_hr18s_480x480_80k_pascal_context_59.py)||
| | | | | |||
| T:DeeplabV3P-R101 | 255\.67 | 62\.68 | 53\.20 | 64\.04 |||
| S:DeeplabV3P+MV2 | 69\.60 | 15\.35 | 41\.01 | 52\.92 |||
| SKDS | 69\.60 | 15\.35 | 42\.07 | 55\.06 |||
| IFVD | 69\.60 | 15\.35 | 41\.73 | 54\.34 |||
| CIRKD | 69\.60 | 15\.35 | 42\.25 | 55\.12 |||
| CWD | 69\.60 | 15\.35 | 43\.74 | 56\.37 |||
| **BPKD(Ours)** | 69\.60 | 15\.35 | **46\.23** | **58\.12** |||
| T:DeeplabV3P-R101 | 255\.67 | 62\.68 | 53\.20 | 64\.04 |[Config](https://github.com/open-mmlab/mmsegmentation/blob/main/configs/deeplabv3plus/deeplabv3plus_r101-d8_4xb4-80k_pascal-context-59-480x480.py)|[Model](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3plus/deeplabv3plus_r101-d8_480x480_80k_pascal_context_59/deeplabv3plus_r101-d8_480x480_80k_pascal_context_59_20210416_111127-7ca0331d.pth)|
| S:DeeplabV3P+MV2 | 69\.60 | 15\.35 | 41\.01 | 52\.92 |[Config](eval/configs/baseline/deeplabv3plus/deeplabv3plus_m-v2-d8_480x480_80k_pascal_context_59.py)||
| SKDS | 69\.60 | 15\.35 | 42\.07 | 55\.06 |[Config](eval/configs/baseline/deeplabv3plus/deeplabv3plus_m-v2-d8_480x480_80k_pascal_context_59.py)||
| IFVD | 69\.60 | 15\.35 | 41\.73 | 54\.34 |[Config](eval/configs/baseline/deeplabv3plus/deeplabv3plus_m-v2-d8_480x480_80k_pascal_context_59.py)||
| CIRKD | 69\.60 | 15\.35 | 42\.25 | 55\.12 |[Config](eval/configs/baseline/deeplabv3plus/deeplabv3plus_m-v2-d8_480x480_80k_pascal_context_59.py)||
| CWD | 69\.60 | 15\.35 | 43\.74 | 56\.37 |[Config](eval/configs/baseline/deeplabv3plus/deeplabv3plus_m-v2-d8_480x480_80k_pascal_context_59.py)||
| **BPKD(Ours)** | 69\.60 | 15\.35 | **46\.23** | **58\.12** |[Config](eval/configs/baseline/deeplabv3plus/deeplabv3plus_m-v2-d8_480x480_80k_pascal_context_59.py)||
| | | | | |||
| T:ISANet-R101 | 228\.21 | 56\.80 | 53\.41 | 64\.04 |||
| S: ISANet-R18 | 54\.33 | 12\.46 | 44\.05 | 54\.67 |||
| SKDS | 54\.33 | 12\.46 | 45\.69 | 56\.27 |||
| IFVD | 54\.33 | 12\.46 | 46\.75 | 56\.4 |||
| CIRKD | 54\.33 | 12\.46 | 45\.83 | 56\.11 |||
| CWD | 54\.33 | 12\.46 | 46\.76 | 56\.48 |||
| **BPKD(Ours)** | 54\.33 | 12\.46 | **47\.25** | **56\.81** |||
| T:ISANet-R101 | 228\.21 | 56\.80 | 53\.41 | 64\.04 |[Config](eval/configs/baseline/isanet/isanet_r101-d8_512x512_80k_context.py)||
| S: ISANet-R18 | 54\.33 | 12\.46 | 44\.05 | 54\.67 |[Config](eval/configs/baseline/isanet/isanet_r18-d8_480x480_80k_context.py)||
| SKDS | 54\.33 | 12\.46 | 45\.69 | 56\.27 |[Config](eval/configs/baseline/isanet/isanet_r18-d8_480x480_80k_context.py)||
| IFVD | 54\.33 | 12\.46 | 46\.75 | 56\.4 |[Config](eval/configs/baseline/isanet/isanet_r18-d8_480x480_80k_context.py)||
| CIRKD | 54\.33 | 12\.46 | 45\.83 | 56\.11 |[Config](eval/configs/baseline/isanet/isanet_r18-d8_480x480_80k_context.py)||
| CWD | 54\.33 | 12\.46 | 46\.76 | 56\.48 |[Config](eval/configs/baseline/isanet/isanet_r18-d8_480x480_80k_context.py)||
| **BPKD(Ours)** | 54\.33 | 12\.46 | **47\.25** | **56\.81** |[Config](eval/configs/baseline/isanet/isanet_r18-d8_480x480_80k_context.py)||





## License

Expand Down
60 changes: 0 additions & 60 deletions eval/configs/_base_/datasets/mmseg/pascal_context_59_512x512.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
_base_ = [
'../../_base_/models/deeplabv3plus_r50-d8.py',
'../../_base_/datasets/mmseg/pascal_context_59.py',
'../../_base_/mmseg_runtime.py',
'../../_base_/schedules/mmseg/schedule_80k.py',
]

model = dict(
pretrained='mmcls://mobilenet_v2',
backbone=dict(
_delete_=True,
type='MobileNetV2',
widen_factor=1.,
strides=(1, 2, 2, 1, 1, 1, 1),
dilations=(1, 1, 1, 2, 2, 4, 4),
out_indices=(1, 2, 4, 6)),
decode_head=dict(in_channels=320, c1_in_channels=24,num_classes=59, channels=512),
auxiliary_head=dict(in_channels=96, num_classes=59,channels=256)
)

optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=1e-4)
optimizer_config = dict()
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
_base_ = [
'../../_base_/models/fcn_hr18.py',
'../../_base_/datasets/mmseg/pascal_context_59.py',
'../../_base_/mmseg_runtime.py',
'../../_base_/schedules/mmseg/schedule_80k.py',
]

model = dict(
pretrained='open-mmlab://msra/hrnetv2_w18_small',
decode_head=dict(num_classes=59),
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)))),
test_cfg=dict(mode='slide', crop_size=(512, 512), stride=(320, 320))
)

optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=1e-4)
optimizer_config = dict()
19 changes: 19 additions & 0 deletions eval/configs/baseline/isanet/isanet_r101-d8_512x512_80k_context.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
_base_ = [
'../../_base_/models/isanet_r50-d8.py',
'../../_base_/datasets/mmseg/pascal_context_59_512x512.py',
'../../_base_/mmseg_runtime.py',
'../../_base_/schedules/mmseg/schedule_80k.py',
]

model = dict(
pretrained='open-mmlab://resnet101_v1c',
backbone=dict(depth=101),
decode_head=dict(
num_classes=59,
),
auxiliary_head=dict(
num_classes=59,
)
)

optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001)
14 changes: 14 additions & 0 deletions eval/configs/baseline/isanet/isanet_r18-d8_480x480_80k_context.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
_base_ = [
'../../_base_/models/isanet_r50-d8.py',
'../../_base_/datasets/mmseg/pascal_context_59.py',
'../../_base_/mmseg_runtime.py',
'../../_base_/schedules/mmseg/schedule_40k.py',
]

model = dict(
pretrained='open-mmlab://resnet18_v1c',
backbone=dict(depth=18),
decode_head=dict(in_channels=512, isa_channels=256, channels=128, num_classes=59),
auxiliary_head=dict(in_channels=256, channels=64, num_classes=59))

optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001)
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
_base_ = [
'../../_base_/models/pspnet_r50-d8.py',
'../../_base_/datasets/mmseg/pascal_context_59.py',
'../../_base_/mmseg_runtime.py',
'../../_base_/schedules/mmseg/schedule_80k.py',
]
model = dict(
pretrained='open-mmlab://resnet18_v1c',
backbone=dict(depth=18),
decode_head=dict(
num_classes=59,
in_channels=512,
channels=128,
),
auxiliary_head=dict(num_classes=59,in_channels=256, channels=64),
# change the test time crop size here
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)
6 changes: 3 additions & 3 deletions eval/process.bash
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ DIR=$(pwd)
cd checkpoints
aria2c -x8 $checkpoint_url -o $checkpoint_name
cd $DIR
python tools/model_converters.py checkpoints/$checkpoint_name --out-path checkpoints/ade_student
PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:512 python tools/test.py $config_name checkpoints/ade_student/$checkpoint_name_student --eval mIoU
python tools/model_converters.py checkpoints/$checkpoint_name --out-path checkpoints/pascal_student
PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:512 python tools/test.py $config_name checkpoints/pascal_student/$checkpoint_name_student --eval mIoU

echo $checkpoint_name
ls checkpoints/ade_student/
ls checkpoints/pascal_student/

0 comments on commit fbba941

Please sign in to comment.