first commit

This commit is contained in:
admin
2026-05-20 15:05:35 +08:00
commit ac09b26253
2048 changed files with 189478 additions and 0 deletions

View File

@@ -0,0 +1,73 @@
# STDC
> [Rethinking BiSeNet For Real-time Semantic Segmentation](https://arxiv.org/abs/2104.13188)
## Introduction
<!-- [ALGORITHM] -->
<a href="https://github.com/MichaelFan01/STDC-Seg">Official Repo</a>
<a href="https://github.com/open-mmlab/mmsegmentation/blob/v0.20.0/mmseg/models/backbones/stdc.py#L394">Code Snippet</a>
## Abstract
<!-- [ABSTRACT] -->
BiSeNet has been proved to be a popular two-stream network for real-time segmentation. However, its principle of adding an extra path to encode spatial information is time-consuming, and the backbones borrowed from pretrained tasks, e.g., image classification, may be inefficient for image segmentation due to the deficiency of task-specific design. To handle these problems, we propose a novel and efficient structure named Short-Term Dense Concatenate network (STDC network) by removing structure redundancy. Specifically, we gradually reduce the dimension of feature maps and use the aggregation of them for image representation, which forms the basic module of STDC network. In the decoder, we propose a Detail Aggregation module by integrating the learning of spatial information into low-level layers in single-stream manner. Finally, the low-level features and deep features are fused to predict the final segmentation results. Extensive experiments on Cityscapes and CamVid dataset demonstrate the effectiveness of our method by achieving promising trade-off between segmentation accuracy and inference speed. On Cityscapes, we achieve 71.9% mIoU on the test set with a speed of 250.4 FPS on NVIDIA GTX 1080Ti, which is 45.2% faster than the latest methods, and achieve 76.8% mIoU with 97.0 FPS while inferring on higher resolution images.
<!-- [IMAGE] -->
<div align=center>
<img src="https://user-images.githubusercontent.com/24582831/143640374-d0709587-edb2-4821-bb60-340035f6ad8f.png" width="60%"/>
</div>
## Usage
We have provided [ImageNet Pretrained STDCNet Weights](https://drive.google.com/drive/folders/1wROFwRt8qWHD4jSo8Zu1gp1d6oYJ3ns1) models converted from [official repo](https://github.com/MichaelFan01/STDC-Seg).
If you want to convert keys on your own to use official repositories' pre-trained models, we also provide a script [`stdc2mmseg.py`](../../tools/model_converters/stdc2mmseg.py) in the tools directory to convert the key of models from [the official repo](https://github.com/MichaelFan01/STDC-Seg) to MMSegmentation style.
```shell
python tools/model_converters/stdc2mmseg.py ${PRETRAIN_PATH} ${STORE_PATH} ${STDC_TYPE}
```
E.g.
```shell
python tools/model_converters/stdc2mmseg.py ./STDCNet813M_73.91.tar ./pretrained/stdc1.pth STDC1
python tools/model_converters/stdc2mmseg.py ./STDCNet1446_76.47.tar ./pretrained/stdc2.pth STDC2
```
This script convert model from `PRETRAIN_PATH` and store the converted model in `STORE_PATH`.
## Results and models
### Cityscapes
| Method | Backbone | Crop Size | Lr schd | Mem (GB) | Inf time (fps) | Device | mIoU | mIoU(ms+flip) | config | download |
| ------ | -------------------- | --------- | ------: | -------- | -------------- | ------ | ----: | ------------- | ----------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| STDC | STDC1 (No Pretrain) | 512x1024 | 80000 | 7.15 | 23.06 | V100 | 71.82 | 73.89 | [config](https://github.com/open-mmlab/mmsegmentation/blob/main/configs/stdc/stdc1_4xb12-80k_cityscapes-512x1024.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/stdc/stdc1_512x1024_80k_cityscapes/stdc1_512x1024_80k_cityscapes_20220224_073048-74e6920a.pth) \| [log](https://download.openmmlab.com/mmsegmentation/v0.5/stdc/stdc1_512x1024_80k_cityscapes/stdc1_512x1024_80k_cityscapes_20220224_073048.log.json) |
| STDC | STDC1 | 512x1024 | 80000 | - | - | V100 | 74.94 | 76.97 | [config](https://github.com/open-mmlab/mmsegmentation/blob/main/configs/stdc/stdc1_in1k-pre_4xb12-80k_cityscapes-512x1024.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/stdc/stdc1_in1k-pre_512x1024_80k_cityscapes/stdc1_in1k-pre_512x1024_80k_cityscapes_20220224_141648-3d4c2981.pth) \| [log](https://download.openmmlab.com/mmsegmentation/v0.5/stdc/stdc1_in1k-pre_512x1024_80k_cityscapes/stdc1_in1k-pre_512x1024_80k_cityscapes_20220224_141648.log.json) |
| STDC | STDC2 (No Pretrain) | 512x1024 | 80000 | 8.27 | 23.71 | V100 | 73.15 | 76.13 | [config](https://github.com/open-mmlab/mmsegmentation/blob/main/configs/stdc/stdc2_4xb12-80k_cityscapes-512x1024.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/stdc/stdc2_512x1024_80k_cityscapes/stdc2_512x1024_80k_cityscapes_20220222_132015-fb1e3a1a.pth) \| [log](https://download.openmmlab.com/mmsegmentation/v0.5/stdc/stdc2_512x1024_80k_cityscapes/stdc2_512x1024_80k_cityscapes_20220222_132015.log.json) |
| STDC | STDC2 | 512x1024 | 80000 | - | - | V100 | 76.67 | 78.67 | [config](https://github.com/open-mmlab/mmsegmentation/blob/main/configs/stdc/stdc2_in1k-pre_4xb12-80k_cityscapes-512x1024.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/stdc/stdc2_in1k-pre_512x1024_80k_cityscapes/stdc2_in1k-pre_512x1024_80k_cityscapes_20220224_073048-1f8f0f6c.pth) \| [log](https://download.openmmlab.com/mmsegmentation/v0.5/stdc/stdc2_in1k-pre_512x1024_80k_cityscapes/stdc2_in1k-pre_512x1024_80k_cityscapes_20220224_073048.log.json) |
Note:
- For STDC on Cityscapes dataset, default setting is 4 GPUs with 12 samples per GPU in training.
- `No Pretrain` means the model is trained from scratch.
- The FPS is for reference only. The environment is also different from paper setting, whose input size is `512x1024` and `768x1536`, i.e., 50% and 75% of our input size, respectively and using TensorRT.
- The parameter `fusion_kernel` in `STDCHead` is not learnable. In official repo, `find_unused_parameters=True` is set [here](https://github.com/MichaelFan01/STDC-Seg/blob/59ff37fbd693b99972c76fcefe97caa14aeb619f/train.py#L220). You may check it by printing model parameters of original repo on your own.
## Citation
```bibtex
@inproceedings{fan2021rethinking,
title={Rethinking BiSeNet For Real-time Semantic Segmentation},
author={Fan, Mingyuan and Lai, Shenqi and Huang, Junshi and Wei, Xiaoming and Chai, Zhenhua and Luo, Junfeng and Wei, Xiaolin},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
pages={9716--9725},
year={2021}
}
```

View File

@@ -0,0 +1,107 @@
Collections:
- Name: STDC
License: Apache License 2.0
Metadata:
Training Data:
- Cityscapes
Paper:
Title: Rethinking BiSeNet For Real-time Semantic Segmentation
URL: https://arxiv.org/abs/2104.13188
README: configs/stdc/README.md
Frameworks:
- PyTorch
Models:
- Name: stdc1_4xb12-80k_cityscapes-512x1024
In Collection: STDC
Results:
Task: Semantic Segmentation
Dataset: Cityscapes
Metrics:
mIoU: 71.82
mIoU(ms+flip): 73.89
Config: configs/stdc/stdc1_4xb12-80k_cityscapes-512x1024.py
Metadata:
Training Data: Cityscapes
Batch Size: 48
Architecture:
- STDC1
- STDC
Training Resources: 4x V100 GPUS
Memory (GB): 7.15
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/stdc/stdc1_512x1024_80k_cityscapes/stdc1_512x1024_80k_cityscapes_20220224_073048-74e6920a.pth
Training log: https://download.openmmlab.com/mmsegmentation/v0.5/stdc/stdc1_512x1024_80k_cityscapes/stdc1_512x1024_80k_cityscapes_20220224_073048.log.json
Paper:
Title: Rethinking BiSeNet For Real-time Semantic Segmentation
URL: https://arxiv.org/abs/2104.13188
Code: https://github.com/open-mmlab/mmsegmentation/blob/v0.20.0/mmseg/models/backbones/stdc.py#L394
Framework: PyTorch
- Name: stdc1_in1k-pre_4xb12-80k_cityscapes-512x1024
In Collection: STDC
Results:
Task: Semantic Segmentation
Dataset: Cityscapes
Metrics:
mIoU: 74.94
mIoU(ms+flip): 76.97
Config: configs/stdc/stdc1_in1k-pre_4xb12-80k_cityscapes-512x1024.py
Metadata:
Training Data: Cityscapes
Batch Size: 48
Architecture:
- STDC1
- STDC
Training Resources: 4x V100 GPUS
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/stdc/stdc1_in1k-pre_512x1024_80k_cityscapes/stdc1_in1k-pre_512x1024_80k_cityscapes_20220224_141648-3d4c2981.pth
Training log: https://download.openmmlab.com/mmsegmentation/v0.5/stdc/stdc1_in1k-pre_512x1024_80k_cityscapes/stdc1_in1k-pre_512x1024_80k_cityscapes_20220224_141648.log.json
Paper:
Title: Rethinking BiSeNet For Real-time Semantic Segmentation
URL: https://arxiv.org/abs/2104.13188
Code: https://github.com/open-mmlab/mmsegmentation/blob/v0.20.0/mmseg/models/backbones/stdc.py#L394
Framework: PyTorch
- Name: stdc2_4xb12-80k_cityscapes-512x1024
In Collection: STDC
Results:
Task: Semantic Segmentation
Dataset: Cityscapes
Metrics:
mIoU: 73.15
mIoU(ms+flip): 76.13
Config: configs/stdc/stdc2_4xb12-80k_cityscapes-512x1024.py
Metadata:
Training Data: Cityscapes
Batch Size: 48
Architecture:
- STDC2
- STDC
Training Resources: 4x V100 GPUS
Memory (GB): 8.27
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/stdc/stdc2_512x1024_80k_cityscapes/stdc2_512x1024_80k_cityscapes_20220222_132015-fb1e3a1a.pth
Training log: https://download.openmmlab.com/mmsegmentation/v0.5/stdc/stdc2_512x1024_80k_cityscapes/stdc2_512x1024_80k_cityscapes_20220222_132015.log.json
Paper:
Title: Rethinking BiSeNet For Real-time Semantic Segmentation
URL: https://arxiv.org/abs/2104.13188
Code: https://github.com/open-mmlab/mmsegmentation/blob/v0.20.0/mmseg/models/backbones/stdc.py#L394
Framework: PyTorch
- Name: stdc2_in1k-pre_4xb12-80k_cityscapes-512x1024
In Collection: STDC
Results:
Task: Semantic Segmentation
Dataset: Cityscapes
Metrics:
mIoU: 76.67
mIoU(ms+flip): 78.67
Config: configs/stdc/stdc2_in1k-pre_4xb12-80k_cityscapes-512x1024.py
Metadata:
Training Data: Cityscapes
Batch Size: 48
Architecture:
- STDC2
- STDC
Training Resources: 4x V100 GPUS
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/stdc/stdc2_in1k-pre_512x1024_80k_cityscapes/stdc2_in1k-pre_512x1024_80k_cityscapes_20220224_073048-1f8f0f6c.pth
Training log: https://download.openmmlab.com/mmsegmentation/v0.5/stdc/stdc2_in1k-pre_512x1024_80k_cityscapes/stdc2_in1k-pre_512x1024_80k_cityscapes_20220224_073048.log.json
Paper:
Title: Rethinking BiSeNet For Real-time Semantic Segmentation
URL: https://arxiv.org/abs/2104.13188
Code: https://github.com/open-mmlab/mmsegmentation/blob/v0.20.0/mmseg/models/backbones/stdc.py#L394
Framework: PyTorch

View File

@@ -0,0 +1,94 @@
_base_ = [
'../_base_/models/stdc.py',
'../_base_/datasets/publicdataset_autolaparo.py',
'../_base_/default_runtime.py',
'../_base_/schedules/schedule_300e_val1_check10.py',
]
norm_cfg = dict(
type='BN',
)
crop_size = (512, 512)
data_preprocessor = dict(
size=(512, 512),
mean=[
123.62464353460942,
85.34836259209033,
82.31539425671558,
],
std=[
47.172211618459315,
47.08256715323592,
48.135121265163605,
],
bgr_to_rgb=False,
)
model = dict(
data_preprocessor=dict(
size=(512, 512),
mean=[
123.62464353460942,
85.34836259209033,
82.31539425671558,
],
std=[
47.172211618459315,
47.08256715323592,
48.135121265163605,
],
bgr_to_rgb=False,
),
backbone=dict(
backbone_cfg=dict(
stdc_type='STDCNet1',
),
init_cfg=dict(
type='Pretrained',
checkpoint='./My_Local_Model/open_mmlab/stdc1.pth',
),
),
decode_head=dict(
num_classes=10,
loss_decode=dict(
type='DiceLoss',
use_sigmoid=False,
loss_weight=1.0,
),
),
)
optim_wrapper = dict(
type='OptimWrapper',
_delete_=True,
optimizer=dict(
type='AdamW',
lr=0.0001,
weight_decay=0.0005,
),
clip_grad=dict(
max_norm=1,
norm_type=2,
),
)
param_scheduler = [
dict(
type='LinearLR',
start_factor=1e-06,
by_epoch=True,
begin=0,
end=10,
),
dict(
type='PolyLR',
power=0.9,
begin=10,
end=300,
eta_min=1e-05,
by_epoch=True,
),
]

View File

@@ -0,0 +1,94 @@
_base_ = [
'../_base_/models/stdc.py',
'../_base_/datasets/publicdataset_cholecseg8k.py',
'../_base_/default_runtime.py',
'../_base_/schedules/schedule_300e_val1_check10.py',
]
norm_cfg = dict(
type='BN',
)
crop_size = (512, 512)
data_preprocessor = dict(
size=(512, 512),
mean=[
85.65740418979115,
53.99282220050495,
46.074045888534535,
],
std=[
72.24589167201978,
56.76979155397199,
49.056637115061775,
],
bgr_to_rgb=False,
)
model = dict(
data_preprocessor=dict(
size=(512, 512),
mean=[
85.65740418979115,
53.99282220050495,
46.074045888534535,
],
std=[
72.24589167201978,
56.76979155397199,
49.056637115061775,
],
bgr_to_rgb=False,
),
backbone=dict(
backbone_cfg=dict(
stdc_type='STDCNet1',
),
init_cfg=dict(
type='Pretrained',
checkpoint='./My_Local_Model/open_mmlab/stdc1.pth',
),
),
decode_head=dict(
num_classes=13,
loss_decode=dict(
type='DiceLoss',
use_sigmoid=False,
loss_weight=1.0,
),
),
)
optim_wrapper = dict(
type='OptimWrapper',
_delete_=True,
optimizer=dict(
type='AdamW',
lr=0.0001,
weight_decay=0.0005,
),
clip_grad=dict(
max_norm=1,
norm_type=2,
),
)
param_scheduler = [
dict(
type='LinearLR',
start_factor=1e-06,
by_epoch=True,
begin=0,
end=10,
),
dict(
type='PolyLR',
power=0.9,
begin=10,
end=300,
eta_min=1e-05,
by_epoch=True,
),
]

View File

@@ -0,0 +1,94 @@
_base_ = [
'../_base_/models/stdc.py',
'../_base_/datasets/publicdataset_dresden.py',
'../_base_/default_runtime.py',
'../_base_/schedules/schedule_300e_val1_check10.py',
]
norm_cfg = dict(
type='BN',
)
crop_size = (512, 512)
data_preprocessor = dict(
size=(512, 512),
mean=[
103.172638338208,
61.44762740851152,
51.407770213021976,
],
std=[
75.77031253622098,
54.63616729031377,
49.45572239497569,
],
bgr_to_rgb=False,
)
model = dict(
data_preprocessor=dict(
size=(512, 512),
mean=[
103.172638338208,
61.44762740851152,
51.407770213021976,
],
std=[
75.77031253622098,
54.63616729031377,
49.45572239497569,
],
bgr_to_rgb=False,
),
backbone=dict(
backbone_cfg=dict(
stdc_type='STDCNet1',
),
init_cfg=dict(
type='Pretrained',
checkpoint='./My_Local_Model/open_mmlab/stdc1.pth',
),
),
decode_head=dict(
num_classes=11,
loss_decode=dict(
type='DiceLoss',
use_sigmoid=False,
loss_weight=1.0,
),
),
)
optim_wrapper = dict(
type='OptimWrapper',
_delete_=True,
optimizer=dict(
type='AdamW',
lr=0.0001,
weight_decay=0.0005,
),
clip_grad=dict(
max_norm=1,
norm_type=2,
),
)
param_scheduler = [
dict(
type='LinearLR',
start_factor=1e-06,
by_epoch=True,
begin=0,
end=10,
),
dict(
type='PolyLR',
power=0.9,
begin=10,
end=300,
eta_min=1e-05,
by_epoch=True,
),
]

View File

@@ -0,0 +1,94 @@
_base_ = [
'../_base_/models/stdc.py',
'../_base_/datasets/publicdataset_endovis_2017.py',
'../_base_/default_runtime.py',
'../_base_/schedules/schedule_300e_val1_check10.py',
]
norm_cfg = dict(
type='BN',
)
crop_size = (512, 512)
data_preprocessor = dict(
size=(512, 512),
mean=[
122.21429912990676,
77.0821859677977,
87.03836664626716,
],
std=[
50.53335800365262,
42.895340354037465,
47.739426483390446,
],
bgr_to_rgb=False,
)
model = dict(
data_preprocessor=dict(
size=(512, 512),
mean=[
122.21429912990676,
77.0821859677977,
87.03836664626716,
],
std=[
50.53335800365262,
42.895340354037465,
47.739426483390446,
],
bgr_to_rgb=False,
),
backbone=dict(
backbone_cfg=dict(
stdc_type='STDCNet1',
),
init_cfg=dict(
type='Pretrained',
checkpoint='./My_Local_Model/open_mmlab/stdc1.pth',
),
),
decode_head=dict(
num_classes=8,
loss_decode=dict(
type='DiceLoss',
use_sigmoid=False,
loss_weight=1.0,
),
),
)
optim_wrapper = dict(
type='OptimWrapper',
_delete_=True,
optimizer=dict(
type='AdamW',
lr=0.0001,
weight_decay=0.0005,
),
clip_grad=dict(
max_norm=1,
norm_type=2,
),
)
param_scheduler = [
dict(
type='LinearLR',
start_factor=1e-06,
by_epoch=True,
begin=0,
end=10,
),
dict(
type='PolyLR',
power=0.9,
begin=10,
end=300,
eta_min=1e-05,
by_epoch=True,
),
]

View File

@@ -0,0 +1,94 @@
_base_ = [
'../_base_/models/stdc.py',
'../_base_/datasets/publicdataset_endovis_2018.py',
'../_base_/default_runtime.py',
'../_base_/schedules/schedule_300e_val1_check10.py',
]
norm_cfg = dict(
type='BN',
)
crop_size = (512, 512)
data_preprocessor = dict(
size=(512, 512),
mean=[
122.21429912990676,
77.0821859677977,
87.03836664626716,
],
std=[
50.53335800365262,
42.895340354037465,
47.739426483390446,
],
bgr_to_rgb=False,
)
model = dict(
data_preprocessor=dict(
size=(512, 512),
mean=[
122.21429912990676,
77.0821859677977,
87.03836664626716,
],
std=[
50.53335800365262,
42.895340354037465,
47.739426483390446,
],
bgr_to_rgb=False,
),
backbone=dict(
backbone_cfg=dict(
stdc_type='STDCNet1',
),
init_cfg=dict(
type='Pretrained',
checkpoint='./My_Local_Model/open_mmlab/stdc1.pth',
),
),
decode_head=dict(
num_classes=8,
loss_decode=dict(
type='DiceLoss',
use_sigmoid=False,
loss_weight=1.0,
),
),
)
optim_wrapper = dict(
type='OptimWrapper',
_delete_=True,
optimizer=dict(
type='AdamW',
lr=0.0001,
weight_decay=0.0005,
),
clip_grad=dict(
max_norm=1,
norm_type=2,
),
)
param_scheduler = [
dict(
type='LinearLR',
start_factor=1e-06,
by_epoch=True,
begin=0,
end=10,
),
dict(
type='PolyLR',
power=0.9,
begin=10,
end=300,
eta_min=1e-05,
by_epoch=True,
),
]

View File

@@ -0,0 +1,94 @@
_base_ = [
'../_base_/models/stdc.py',
'../_base_/datasets/publicdataset_autolaparo.py',
'../_base_/default_runtime.py',
'../_base_/schedules/schedule_300e_val1_check10.py',
]
norm_cfg = dict(
type='BN',
)
crop_size = (512, 512)
data_preprocessor = dict(
size=(512, 512),
mean=[
123.62464353460942,
85.34836259209033,
82.31539425671558,
],
std=[
47.172211618459315,
47.08256715323592,
48.135121265163605,
],
bgr_to_rgb=False,
)
model = dict(
data_preprocessor=dict(
size=(512, 512),
mean=[
123.62464353460942,
85.34836259209033,
82.31539425671558,
],
std=[
47.172211618459315,
47.08256715323592,
48.135121265163605,
],
bgr_to_rgb=False,
),
backbone=dict(
backbone_cfg=dict(
stdc_type='STDCNet2',
),
init_cfg=dict(
type='Pretrained',
checkpoint='./My_Local_Model/open_mmlab/stdc2.pth',
),
),
decode_head=dict(
num_classes=10,
loss_decode=dict(
type='DiceLoss',
use_sigmoid=False,
loss_weight=1.0,
),
),
)
optim_wrapper = dict(
type='OptimWrapper',
_delete_=True,
optimizer=dict(
type='AdamW',
lr=0.0001,
weight_decay=0.0005,
),
clip_grad=dict(
max_norm=1,
norm_type=2,
),
)
param_scheduler = [
dict(
type='LinearLR',
start_factor=1e-06,
by_epoch=True,
begin=0,
end=10,
),
dict(
type='PolyLR',
power=0.9,
begin=10,
end=300,
eta_min=1e-05,
by_epoch=True,
),
]

View File

@@ -0,0 +1,94 @@
_base_ = [
'../_base_/models/stdc.py',
'../_base_/datasets/publicdataset_cholecseg8k.py',
'../_base_/default_runtime.py',
'../_base_/schedules/schedule_300e_val1_check10.py',
]
norm_cfg = dict(
type='BN',
)
crop_size = (512, 512)
data_preprocessor = dict(
size=(512, 512),
mean=[
85.65740418979115,
53.99282220050495,
46.074045888534535,
],
std=[
72.24589167201978,
56.76979155397199,
49.056637115061775,
],
bgr_to_rgb=False,
)
model = dict(
data_preprocessor=dict(
size=(512, 512),
mean=[
85.65740418979115,
53.99282220050495,
46.074045888534535,
],
std=[
72.24589167201978,
56.76979155397199,
49.056637115061775,
],
bgr_to_rgb=False,
),
backbone=dict(
backbone_cfg=dict(
stdc_type='STDCNet2',
),
init_cfg=dict(
type='Pretrained',
checkpoint='./My_Local_Model/open_mmlab/stdc2.pth',
),
),
decode_head=dict(
num_classes=13,
loss_decode=dict(
type='DiceLoss',
use_sigmoid=False,
loss_weight=1.0,
),
),
)
optim_wrapper = dict(
type='OptimWrapper',
_delete_=True,
optimizer=dict(
type='AdamW',
lr=0.0001,
weight_decay=0.0005,
),
clip_grad=dict(
max_norm=1,
norm_type=2,
),
)
param_scheduler = [
dict(
type='LinearLR',
start_factor=1e-06,
by_epoch=True,
begin=0,
end=10,
),
dict(
type='PolyLR',
power=0.9,
begin=10,
end=300,
eta_min=1e-05,
by_epoch=True,
),
]

View File

@@ -0,0 +1,94 @@
_base_ = [
'../_base_/models/stdc.py',
'../_base_/datasets/publicdataset_dresden.py',
'../_base_/default_runtime.py',
'../_base_/schedules/schedule_300e_val1_check10.py',
]
norm_cfg = dict(
type='BN',
)
crop_size = (512, 512)
data_preprocessor = dict(
size=(512, 512),
mean=[
103.172638338208,
61.44762740851152,
51.407770213021976,
],
std=[
75.77031253622098,
54.63616729031377,
49.45572239497569,
],
bgr_to_rgb=False,
)
model = dict(
data_preprocessor=dict(
size=(512, 512),
mean=[
103.172638338208,
61.44762740851152,
51.407770213021976,
],
std=[
75.77031253622098,
54.63616729031377,
49.45572239497569,
],
bgr_to_rgb=False,
),
backbone=dict(
backbone_cfg=dict(
stdc_type='STDCNet2',
),
init_cfg=dict(
type='Pretrained',
checkpoint='./My_Local_Model/open_mmlab/stdc2.pth',
),
),
decode_head=dict(
num_classes=11,
loss_decode=dict(
type='DiceLoss',
use_sigmoid=False,
loss_weight=1.0,
),
),
)
optim_wrapper = dict(
type='OptimWrapper',
_delete_=True,
optimizer=dict(
type='AdamW',
lr=0.0001,
weight_decay=0.0005,
),
clip_grad=dict(
max_norm=1,
norm_type=2,
),
)
param_scheduler = [
dict(
type='LinearLR',
start_factor=1e-06,
by_epoch=True,
begin=0,
end=10,
),
dict(
type='PolyLR',
power=0.9,
begin=10,
end=300,
eta_min=1e-05,
by_epoch=True,
),
]

View File

@@ -0,0 +1,94 @@
_base_ = [
'../_base_/models/stdc.py',
'../_base_/datasets/publicdataset_endovis_2017.py',
'../_base_/default_runtime.py',
'../_base_/schedules/schedule_300e_val1_check10.py',
]
norm_cfg = dict(
type='BN',
)
crop_size = (512, 512)
data_preprocessor = dict(
size=(512, 512),
mean=[
122.21429912990676,
77.0821859677977,
87.03836664626716,
],
std=[
50.53335800365262,
42.895340354037465,
47.739426483390446,
],
bgr_to_rgb=False,
)
model = dict(
data_preprocessor=dict(
size=(512, 512),
mean=[
122.21429912990676,
77.0821859677977,
87.03836664626716,
],
std=[
50.53335800365262,
42.895340354037465,
47.739426483390446,
],
bgr_to_rgb=False,
),
backbone=dict(
backbone_cfg=dict(
stdc_type='STDCNet2',
),
init_cfg=dict(
type='Pretrained',
checkpoint='./My_Local_Model/open_mmlab/stdc2.pth',
),
),
decode_head=dict(
num_classes=8,
loss_decode=dict(
type='DiceLoss',
use_sigmoid=False,
loss_weight=1.0,
),
),
)
optim_wrapper = dict(
type='OptimWrapper',
_delete_=True,
optimizer=dict(
type='AdamW',
lr=0.0001,
weight_decay=0.0005,
),
clip_grad=dict(
max_norm=1,
norm_type=2,
),
)
param_scheduler = [
dict(
type='LinearLR',
start_factor=1e-06,
by_epoch=True,
begin=0,
end=10,
),
dict(
type='PolyLR',
power=0.9,
begin=10,
end=300,
eta_min=1e-05,
by_epoch=True,
),
]

View File

@@ -0,0 +1,94 @@
_base_ = [
'../_base_/models/stdc.py',
'../_base_/datasets/publicdataset_endovis_2018.py',
'../_base_/default_runtime.py',
'../_base_/schedules/schedule_300e_val1_check10.py',
]
norm_cfg = dict(
type='BN',
)
crop_size = (512, 512)
data_preprocessor = dict(
size=(512, 512),
mean=[
122.21429912990676,
77.0821859677977,
87.03836664626716,
],
std=[
50.53335800365262,
42.895340354037465,
47.739426483390446,
],
bgr_to_rgb=False,
)
model = dict(
data_preprocessor=dict(
size=(512, 512),
mean=[
122.21429912990676,
77.0821859677977,
87.03836664626716,
],
std=[
50.53335800365262,
42.895340354037465,
47.739426483390446,
],
bgr_to_rgb=False,
),
backbone=dict(
backbone_cfg=dict(
stdc_type='STDCNet2',
),
init_cfg=dict(
type='Pretrained',
checkpoint='./My_Local_Model/open_mmlab/stdc2.pth',
),
),
decode_head=dict(
num_classes=8,
loss_decode=dict(
type='DiceLoss',
use_sigmoid=False,
loss_weight=1.0,
),
),
)
optim_wrapper = dict(
type='OptimWrapper',
_delete_=True,
optimizer=dict(
type='AdamW',
lr=0.0001,
weight_decay=0.0005,
),
clip_grad=dict(
max_norm=1,
norm_type=2,
),
)
param_scheduler = [
dict(
type='LinearLR',
start_factor=1e-06,
by_epoch=True,
begin=0,
end=10,
),
dict(
type='PolyLR',
power=0.9,
begin=10,
end=300,
eta_min=1e-05,
by_epoch=True,
),
]

View File

@@ -0,0 +1,21 @@
_base_ = [
'../_base_/models/stdc.py', '../_base_/datasets/cityscapes.py',
'../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py'
]
crop_size = (512, 1024)
data_preprocessor = dict(size=crop_size)
model = dict(data_preprocessor=data_preprocessor)
param_scheduler = [
dict(type='LinearLR', by_epoch=False, start_factor=0.1, begin=0, end=1000),
dict(
type='PolyLR',
eta_min=1e-4,
power=0.9,
begin=1000,
end=80000,
by_epoch=False,
)
]
train_dataloader = dict(batch_size=12, num_workers=4)
val_dataloader = dict(batch_size=1, num_workers=4)
test_dataloader = val_dataloader

View File

@@ -0,0 +1,6 @@
checkpoint = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/stdc/stdc1_20220308-5368626c.pth' # noqa
_base_ = './stdc1_4xb12-80k_cityscapes-512x1024.py'
model = dict(
backbone=dict(
backbone_cfg=dict(
init_cfg=dict(type='Pretrained', checkpoint=checkpoint))))

View File

@@ -0,0 +1,2 @@
_base_ = './stdc1_4xb12-80k_cityscapes-512x1024.py'
model = dict(backbone=dict(backbone_cfg=dict(stdc_type='STDCNet2')))

View File

@@ -0,0 +1,6 @@
checkpoint = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/stdc/stdc2_20220308-7dbd9127.pth' # noqa
_base_ = './stdc2_4xb12-80k_cityscapes-512x1024.py'
model = dict(
backbone=dict(
backbone_cfg=dict(
init_cfg=dict(type='Pretrained', checkpoint=checkpoint))))