Upload folder using huggingface_hub (part 4)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- EgoHOS/raw/script/mmsegmentation/configs/segmenter/README.md +74 -0
- EgoHOS/raw/script/mmsegmentation/configs/segmenter/segmenter.yml +125 -0
- EgoHOS/raw/script/mmsegmentation/configs/segmenter/segmenter_vit-b_mask_8x1_512x512_160k_ade20k.py +43 -0
- EgoHOS/raw/script/mmsegmentation/configs/segmenter/segmenter_vit-l_mask_8x1_512x512_160k_ade20k.py +61 -0
- EgoHOS/raw/script/mmsegmentation/configs/segmenter/segmenter_vit-s_linear_8x1_512x512_160k_ade20k.py +14 -0
- EgoHOS/raw/script/mmsegmentation/configs/segmenter/segmenter_vit-s_mask_8x1_512x512_160k_ade20k.py +66 -0
- EgoHOS/raw/script/mmsegmentation/configs/segmenter/segmenter_vit-t_mask_8x1_512x512_160k_ade20k.py +56 -0
- EgoHOS/raw/script/mmsegmentation/configs/sem_fpn/README.md +50 -0
- EgoHOS/raw/script/mmsegmentation/configs/sem_fpn/fpn_r101_512x1024_80k_cityscapes.py +2 -0
- EgoHOS/raw/script/mmsegmentation/configs/sem_fpn/fpn_r101_512x512_160k_ade20k.py +2 -0
- EgoHOS/raw/script/mmsegmentation/configs/sem_fpn/fpn_r50_512x1024_80k_cityscapes.py +4 -0
- EgoHOS/raw/script/mmsegmentation/configs/sem_fpn/fpn_r50_512x512_160k_ade20k.py +5 -0
- EgoHOS/raw/script/mmsegmentation/configs/sem_fpn/sem_fpn.yml +104 -0
- EgoHOS/raw/script/mmsegmentation/configs/setr/README.md +73 -0
- EgoHOS/raw/script/mmsegmentation/configs/setr/setr.yml +164 -0
- EgoHOS/raw/script/mmsegmentation/configs/setr/setr_mla_512x512_160k_b16_ade20k.py +4 -0
- EgoHOS/raw/script/mmsegmentation/configs/setr/setr_mla_512x512_160k_b8_ade20k.py +85 -0
- EgoHOS/raw/script/mmsegmentation/configs/setr/setr_naive_512x512_160k_b16_ade20k.py +67 -0
- EgoHOS/raw/script/mmsegmentation/configs/setr/setr_pup_512x512_160k_b16_ade20k.py +67 -0
- EgoHOS/raw/script/mmsegmentation/configs/setr/setr_vit-large_mla_8x1_768x768_80k_cityscapes.py +17 -0
- EgoHOS/raw/script/mmsegmentation/configs/setr/setr_vit-large_naive_8x1_768x768_80k_cityscapes.py +18 -0
- EgoHOS/raw/script/mmsegmentation/configs/setr/setr_vit-large_pup_8x1_768x768_80k_cityscapes.py +64 -0
- EgoHOS/raw/script/mmsegmentation/configs/stdc/README.md +72 -0
- EgoHOS/raw/script/mmsegmentation/configs/stdc/stdc.yml +87 -0
- EgoHOS/raw/script/mmsegmentation/configs/stdc/stdc1_512x1024_80k_cityscapes.py +9 -0
- EgoHOS/raw/script/mmsegmentation/configs/stdc/stdc1_in1k-pre_512x1024_80k_cityscapes.py +6 -0
- EgoHOS/raw/script/mmsegmentation/configs/stdc/stdc2_512x1024_80k_cityscapes.py +2 -0
- EgoHOS/raw/script/mmsegmentation/configs/stdc/stdc2_in1k-pre_512x1024_80k_cityscapes.py +6 -0
- EgoHOS/raw/script/mmsegmentation/configs/swin/README.md +75 -0
- EgoHOS/raw/script/mmsegmentation/configs/swin/seg_handobj1.py +54 -0
- EgoHOS/raw/script/mmsegmentation/configs/swin/seg_handobj1_ccda.py +54 -0
- EgoHOS/raw/script/mmsegmentation/configs/swin/seg_handobj2.py +54 -0
- EgoHOS/raw/script/mmsegmentation/configs/swin/seg_handobj2_512.py +54 -0
- EgoHOS/raw/script/mmsegmentation/configs/swin/seg_handobj2_ccda.py +54 -0
- EgoHOS/raw/script/mmsegmentation/configs/swin/seg_twohands.py +54 -0
- EgoHOS/raw/script/mmsegmentation/configs/swin/seg_twohands_ccda.py +54 -0
- EgoHOS/raw/script/mmsegmentation/configs/swin/swin.yml +117 -0
- EgoHOS/raw/script/mmsegmentation/configs/swin/twohands_cb_to_obj1.py +55 -0
- EgoHOS/raw/script/mmsegmentation/configs/swin/twohands_cb_to_obj1_ccda.py +55 -0
- EgoHOS/raw/script/mmsegmentation/configs/swin/twohands_cb_to_obj2_ccda.py +59 -0
- EgoHOS/raw/script/mmsegmentation/configs/swin/twohands_to_cb.py +55 -0
- EgoHOS/raw/script/mmsegmentation/configs/swin/twohands_to_cb_ccda.py +55 -0
- EgoHOS/raw/script/mmsegmentation/configs/swin/twohands_to_obj1.py +55 -0
- EgoHOS/raw/script/mmsegmentation/configs/swin/twohands_to_obj1_ccda.py +55 -0
- EgoHOS/raw/script/mmsegmentation/configs/swin/twohands_to_obj2.py +55 -0
- EgoHOS/raw/script/mmsegmentation/configs/swin/twohands_to_obj2_ccda.py +56 -0
- EgoHOS/raw/script/mmsegmentation/configs/swin/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_1K.py +15 -0
- EgoHOS/raw/script/mmsegmentation/configs/swin/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K.py +9 -0
- EgoHOS/raw/script/mmsegmentation/configs/swin/upernet_swin_base_patch4_window12_512x512_160k_egohos_handobj2_subset_pretrain_480x360_22K.py +54 -0
- EgoHOS/raw/script/mmsegmentation/configs/swin/upernet_swin_base_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K.py +13 -0
EgoHOS/raw/script/mmsegmentation/configs/segmenter/README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Segmenter
|
| 2 |
+
|
| 3 |
+
[Segmenter: Transformer for Semantic Segmentation](https://arxiv.org/abs/2105.05633)
|
| 4 |
+
|
| 5 |
+
## Introduction
|
| 6 |
+
|
| 7 |
+
<!-- [ALGORITHM] -->
|
| 8 |
+
|
| 9 |
+
<a href="https://github.com/rstrudel/segmenter">Official Repo</a>
|
| 10 |
+
|
| 11 |
+
<a href="https://github.com/open-mmlab/mmsegmentation/blob/v0.21.0/mmseg/models/decode_heads/segmenter_mask_head.py#L15">Code Snippet</a>
|
| 12 |
+
|
| 13 |
+
## Abstract
|
| 14 |
+
|
| 15 |
+
<!-- [ABSTRACT] -->
|
| 16 |
+
|
| 17 |
+
Image segmentation is often ambiguous at the level of individual image patches and requires contextual information to reach label consensus. In this paper we introduce Segmenter, a transformer model for semantic segmentation. In contrast to convolution-based methods, our approach allows to model global context already at the first layer and throughout the network. We build on the recent Vision Transformer (ViT) and extend it to semantic segmentation. To do so, we rely on the output embeddings corresponding to image patches and obtain class labels from these embeddings with a point-wise linear decoder or a mask transformer decoder. We leverage models pre-trained for image classification and show that we can fine-tune them on moderate sized datasets available for semantic segmentation. The linear decoder allows to obtain excellent results already, but the performance can be further improved by a mask transformer generating class masks. We conduct an extensive ablation study to show the impact of the different parameters, in particular the performance is better for large models and small patch sizes. Segmenter attains excellent results for semantic segmentation. It outperforms the state of the art on both ADE20K and Pascal Context datasets and is competitive on Cityscapes.
|
| 18 |
+
|
| 19 |
+
<!-- [IMAGE] -->
|
| 20 |
+
<div align=center>
|
| 21 |
+
<img src="https://user-images.githubusercontent.com/24582831/148507554-87eb80bd-02c7-4c31-b102-c6141e231ec8.png" width="70%"/>
|
| 22 |
+
</div>
|
| 23 |
+
|
| 24 |
+
```bibtex
|
| 25 |
+
@inproceedings{strudel2021segmenter,
|
| 26 |
+
title={Segmenter: Transformer for semantic segmentation},
|
| 27 |
+
author={Strudel, Robin and Garcia, Ricardo and Laptev, Ivan and Schmid, Cordelia},
|
| 28 |
+
booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision},
|
| 29 |
+
pages={7262--7272},
|
| 30 |
+
year={2021}
|
| 31 |
+
}
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
## Usage
|
| 36 |
+
|
| 37 |
+
We have provided pretrained models converted from [ViT-AugReg](https://github.com/rwightman/pytorch-image-models/blob/f55c22bebf9d8afc449d317a723231ef72e0d662/timm/models/vision_transformer.py#L54-L106).
|
| 38 |
+
|
| 39 |
+
If you want to convert keys on your own to use the pre-trained ViT model from [Segmenter](https://github.com/rstrudel/segmenter), we also provide a script [`vitjax2mmseg.py`](../../tools/model_converters/vitjax2mmseg.py) in the tools directory to convert the key of models from [ViT-AugReg](https://github.com/rwightman/pytorch-image-models/blob/f55c22bebf9d8afc449d317a723231ef72e0d662/timm/models/vision_transformer.py#L54-L106) to MMSegmentation style.
|
| 40 |
+
|
| 41 |
+
```shell
|
| 42 |
+
python tools/model_converters/vitjax2mmseg.py ${PRETRAIN_PATH} ${STORE_PATH}
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
E.g.
|
| 46 |
+
|
| 47 |
+
```shell
|
| 48 |
+
python tools/model_converters/vitjax2mmseg.py \
|
| 49 |
+
Ti_16-i21k-300ep-lr_0.001-aug_none-wd_0.03-do_0.0-sd_0.0--imagenet2012-steps_20k-lr_0.03-res_384.npz \
|
| 50 |
+
pretrain/vit_tiny_p16_384.pth
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
This script convert model from `PRETRAIN_PATH` and store the converted model in `STORE_PATH`.
|
| 54 |
+
|
| 55 |
+
In our default setting, pretrained models and their corresponding [ViT-AugReg](https://github.com/rwightman/pytorch-image-models/blob/f55c22bebf9d8afc449d317a723231ef72e0d662/timm/models/vision_transformer.py#L54-L106) models could be defined below:
|
| 56 |
+
|
| 57 |
+
| pretrained models | original models |
|
| 58 |
+
| ------ | -------- |
|
| 59 |
+
|vit_tiny_p16_384.pth | ['vit_tiny_patch16_384'](https://storage.googleapis.com/vit_models/augreg/Ti_16-i21k-300ep-lr_0.001-aug_none-wd_0.03-do_0.0-sd_0.0--imagenet2012-steps_20k-lr_0.03-res_384.npz) |
|
| 60 |
+
|vit_small_p16_384.pth | ['vit_small_patch16_384'](https://storage.googleapis.com/vit_models/augreg/S_16-i21k-300ep-lr_0.001-aug_light1-wd_0.03-do_0.0-sd_0.0--imagenet2012-steps_20k-lr_0.03-res_384.npz) |
|
| 61 |
+
|vit_base_p16_384.pth | ['vit_base_patch16_384'](https://storage.googleapis.com/vit_models/augreg/B_16-i21k-300ep-lr_0.001-aug_medium1-wd_0.1-do_0.0-sd_0.0--imagenet2012-steps_20k-lr_0.01-res_384.npz) |
|
| 62 |
+
|vit_large_p16_384.pth | ['vit_large_patch16_384'](https://storage.googleapis.com/vit_models/augreg/L_16-i21k-300ep-lr_0.001-aug_medium1-wd_0.1-do_0.1-sd_0.1--imagenet2012-steps_20k-lr_0.01-res_384.npz) |
|
| 63 |
+
|
| 64 |
+
## Results and models
|
| 65 |
+
|
| 66 |
+
### ADE20K
|
| 67 |
+
|
| 68 |
+
| Method | Backbone | Crop Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | config | download |
|
| 69 |
+
| ------ | -------- | --------- | ---------- | ------- | -------- | --- | --- | -------------- | ----- |
|
| 70 |
+
| Segmenter Mask | ViT-T_16 | 512x512 | 160000 | 1.21 | 27.98 | 39.99 | 40.83 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/segmenter/segmenter_vit-t_mask_8x1_512x512_160k_ade20k.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/segmenter/segmenter_vit-t_mask_8x1_512x512_160k_ade20k/segmenter_vit-t_mask_8x1_512x512_160k_ade20k_20220105_151706-ffcf7509.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/segmenter/segmenter_vit-t_mask_8x1_512x512_160k_ade20k/segmenter_vit-t_mask_8x1_512x512_160k_ade20k_20220105_151706.log.json) |
|
| 71 |
+
| Segmenter Linear | ViT-S_16 | 512x512 | 160000 | 1.78 | 28.07 | 45.75 | 46.82 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/segmenter/segmenter_vit-s_linear_8x1_512x512_160k_ade20k.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/segmenter/segmenter_vit-s_linear_8x1_512x512_160k_ade20k/segmenter_vit-s_linear_8x1_512x512_160k_ade20k_20220105_151713-39658c46.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/segmenter/segmenter_vit-s_linear_8x1_512x512_160k_ade20k/segmenter_vit-s_linear_8x1_512x512_160k_ade20k_20220105_151713.log.json) |
|
| 72 |
+
| Segmenter Mask | ViT-S_16 | 512x512 | 160000 | 2.03 | 24.80 | 46.19 | 47.85 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/segmenter/segmenter_vit-s_mask_8x1_512x512_160k_ade20k.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/segmenter/segmenter_vit-s_mask_8x1_512x512_160k_ade20k/segmenter_vit-s_mask_8x1_512x512_160k_ade20k_20220105_151706-511bb103.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/segmenter/segmenter_vit-s_mask_8x1_512x512_160k_ade20k/segmenter_vit-s_mask_8x1_512x512_160k_ade20k_20220105_151706.log.json) |
|
| 73 |
+
| Segmenter Mask | ViT-B_16 |512x512 | 160000 | 4.20 | 13.20 | 49.60 | 51.07 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/segmenter/segmenter_vit-b_mask_8x1_512x512_160k_ade20k.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/segmenter/segmenter_vit-b_mask_8x1_512x512_160k_ade20k/segmenter_vit-b_mask_8x1_512x512_160k_ade20k_20220105_151706-bc533b08.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/segmenter/segmenter_vit-b_mask_8x1_512x512_160k_ade20k/segmenter_vit-b_mask_8x1_512x512_160k_ade20k_20220105_151706.log.json) |
|
| 74 |
+
| Segmenter Mask | ViT-L_16 |640x640 | 160000 | 16.56 | 2.62 | 52.16 | 53.65 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/segmenter/segmenter_vit-l_mask_8x1_512x512_160k_ade20k.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/segmenter/segmenter_vit-l_mask_8x1_512x512_160k_ade20k/segmenter_vit-l_mask_8x1_512x512_160k_ade20k_20220105_162750-7ef345be.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/segmenter/segmenter_vit-l_mask_8x1_512x512_160k_ade20k/segmenter_vit-l_mask_8x1_512x512_160k_ade20k_20220105_162750.log.json) |
|
EgoHOS/raw/script/mmsegmentation/configs/segmenter/segmenter.yml
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Collections:
|
| 2 |
+
- Name: Segmenter
|
| 3 |
+
Metadata:
|
| 4 |
+
Training Data:
|
| 5 |
+
- ADE20K
|
| 6 |
+
Paper:
|
| 7 |
+
URL: https://arxiv.org/abs/2105.05633
|
| 8 |
+
Title: 'Segmenter: Transformer for Semantic Segmentation'
|
| 9 |
+
README: configs/segmenter/README.md
|
| 10 |
+
Code:
|
| 11 |
+
URL: https://github.com/open-mmlab/mmsegmentation/blob/v0.21.0/mmseg/models/decode_heads/segmenter_mask_head.py#L15
|
| 12 |
+
Version: v0.21.0
|
| 13 |
+
Converted From:
|
| 14 |
+
Code: https://github.com/rstrudel/segmenter
|
| 15 |
+
Models:
|
| 16 |
+
- Name: segmenter_vit-t_mask_8x1_512x512_160k_ade20k
|
| 17 |
+
In Collection: Segmenter
|
| 18 |
+
Metadata:
|
| 19 |
+
backbone: ViT-T_16
|
| 20 |
+
crop size: (512,512)
|
| 21 |
+
lr schd: 160000
|
| 22 |
+
inference time (ms/im):
|
| 23 |
+
- value: 35.74
|
| 24 |
+
hardware: V100
|
| 25 |
+
backend: PyTorch
|
| 26 |
+
batch size: 1
|
| 27 |
+
mode: FP32
|
| 28 |
+
resolution: (512,512)
|
| 29 |
+
Training Memory (GB): 1.21
|
| 30 |
+
Results:
|
| 31 |
+
- Task: Semantic Segmentation
|
| 32 |
+
Dataset: ADE20K
|
| 33 |
+
Metrics:
|
| 34 |
+
mIoU: 39.99
|
| 35 |
+
mIoU(ms+flip): 40.83
|
| 36 |
+
Config: configs/segmenter/segmenter_vit-t_mask_8x1_512x512_160k_ade20k.py
|
| 37 |
+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/segmenter/segmenter_vit-t_mask_8x1_512x512_160k_ade20k/segmenter_vit-t_mask_8x1_512x512_160k_ade20k_20220105_151706-ffcf7509.pth
|
| 38 |
+
- Name: segmenter_vit-s_linear_8x1_512x512_160k_ade20k
|
| 39 |
+
In Collection: Segmenter
|
| 40 |
+
Metadata:
|
| 41 |
+
backbone: ViT-S_16
|
| 42 |
+
crop size: (512,512)
|
| 43 |
+
lr schd: 160000
|
| 44 |
+
inference time (ms/im):
|
| 45 |
+
- value: 35.63
|
| 46 |
+
hardware: V100
|
| 47 |
+
backend: PyTorch
|
| 48 |
+
batch size: 1
|
| 49 |
+
mode: FP32
|
| 50 |
+
resolution: (512,512)
|
| 51 |
+
Training Memory (GB): 1.78
|
| 52 |
+
Results:
|
| 53 |
+
- Task: Semantic Segmentation
|
| 54 |
+
Dataset: ADE20K
|
| 55 |
+
Metrics:
|
| 56 |
+
mIoU: 45.75
|
| 57 |
+
mIoU(ms+flip): 46.82
|
| 58 |
+
Config: configs/segmenter/segmenter_vit-s_linear_8x1_512x512_160k_ade20k.py
|
| 59 |
+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/segmenter/segmenter_vit-s_linear_8x1_512x512_160k_ade20k/segmenter_vit-s_linear_8x1_512x512_160k_ade20k_20220105_151713-39658c46.pth
|
| 60 |
+
- Name: segmenter_vit-s_mask_8x1_512x512_160k_ade20k
|
| 61 |
+
In Collection: Segmenter
|
| 62 |
+
Metadata:
|
| 63 |
+
backbone: ViT-S_16
|
| 64 |
+
crop size: (512,512)
|
| 65 |
+
lr schd: 160000
|
| 66 |
+
inference time (ms/im):
|
| 67 |
+
- value: 40.32
|
| 68 |
+
hardware: V100
|
| 69 |
+
backend: PyTorch
|
| 70 |
+
batch size: 1
|
| 71 |
+
mode: FP32
|
| 72 |
+
resolution: (512,512)
|
| 73 |
+
Training Memory (GB): 2.03
|
| 74 |
+
Results:
|
| 75 |
+
- Task: Semantic Segmentation
|
| 76 |
+
Dataset: ADE20K
|
| 77 |
+
Metrics:
|
| 78 |
+
mIoU: 46.19
|
| 79 |
+
mIoU(ms+flip): 47.85
|
| 80 |
+
Config: configs/segmenter/segmenter_vit-s_mask_8x1_512x512_160k_ade20k.py
|
| 81 |
+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/segmenter/segmenter_vit-s_mask_8x1_512x512_160k_ade20k/segmenter_vit-s_mask_8x1_512x512_160k_ade20k_20220105_151706-511bb103.pth
|
| 82 |
+
- Name: segmenter_vit-b_mask_8x1_512x512_160k_ade20k
|
| 83 |
+
In Collection: Segmenter
|
| 84 |
+
Metadata:
|
| 85 |
+
backbone: ViT-B_16
|
| 86 |
+
crop size: (512,512)
|
| 87 |
+
lr schd: 160000
|
| 88 |
+
inference time (ms/im):
|
| 89 |
+
- value: 75.76
|
| 90 |
+
hardware: V100
|
| 91 |
+
backend: PyTorch
|
| 92 |
+
batch size: 1
|
| 93 |
+
mode: FP32
|
| 94 |
+
resolution: (512,512)
|
| 95 |
+
Training Memory (GB): 4.2
|
| 96 |
+
Results:
|
| 97 |
+
- Task: Semantic Segmentation
|
| 98 |
+
Dataset: ADE20K
|
| 99 |
+
Metrics:
|
| 100 |
+
mIoU: 49.6
|
| 101 |
+
mIoU(ms+flip): 51.07
|
| 102 |
+
Config: configs/segmenter/segmenter_vit-b_mask_8x1_512x512_160k_ade20k.py
|
| 103 |
+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/segmenter/segmenter_vit-b_mask_8x1_512x512_160k_ade20k/segmenter_vit-b_mask_8x1_512x512_160k_ade20k_20220105_151706-bc533b08.pth
|
| 104 |
+
- Name: segmenter_vit-l_mask_8x1_512x512_160k_ade20k
|
| 105 |
+
In Collection: Segmenter
|
| 106 |
+
Metadata:
|
| 107 |
+
backbone: ViT-L_16
|
| 108 |
+
crop size: (640,640)
|
| 109 |
+
lr schd: 160000
|
| 110 |
+
inference time (ms/im):
|
| 111 |
+
- value: 381.68
|
| 112 |
+
hardware: V100
|
| 113 |
+
backend: PyTorch
|
| 114 |
+
batch size: 1
|
| 115 |
+
mode: FP32
|
| 116 |
+
resolution: (640,640)
|
| 117 |
+
Training Memory (GB): 16.56
|
| 118 |
+
Results:
|
| 119 |
+
- Task: Semantic Segmentation
|
| 120 |
+
Dataset: ADE20K
|
| 121 |
+
Metrics:
|
| 122 |
+
mIoU: 52.16
|
| 123 |
+
mIoU(ms+flip): 53.65
|
| 124 |
+
Config: configs/segmenter/segmenter_vit-l_mask_8x1_512x512_160k_ade20k.py
|
| 125 |
+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/segmenter/segmenter_vit-l_mask_8x1_512x512_160k_ade20k/segmenter_vit-l_mask_8x1_512x512_160k_ade20k_20220105_162750-7ef345be.pth
|
EgoHOS/raw/script/mmsegmentation/configs/segmenter/segmenter_vit-b_mask_8x1_512x512_160k_ade20k.py
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/segmenter_vit-b16_mask.py',
|
| 3 |
+
'../_base_/datasets/ade20k.py', '../_base_/default_runtime.py',
|
| 4 |
+
'../_base_/schedules/schedule_160k.py'
|
| 5 |
+
]
|
| 6 |
+
optimizer = dict(lr=0.001, weight_decay=0.0)
|
| 7 |
+
|
| 8 |
+
img_norm_cfg = dict(
|
| 9 |
+
mean=[127.5, 127.5, 127.5], std=[127.5, 127.5, 127.5], to_rgb=True)
|
| 10 |
+
crop_size = (512, 512)
|
| 11 |
+
train_pipeline = [
|
| 12 |
+
dict(type='LoadImageFromFile'),
|
| 13 |
+
dict(type='LoadAnnotations', reduce_zero_label=True),
|
| 14 |
+
dict(type='Resize', img_scale=(2048, 512), ratio_range=(0.5, 2.0)),
|
| 15 |
+
dict(type='RandomCrop', crop_size=crop_size, cat_max_ratio=0.75),
|
| 16 |
+
dict(type='RandomFlip', prob=0.5),
|
| 17 |
+
dict(type='PhotoMetricDistortion'),
|
| 18 |
+
dict(type='Normalize', **img_norm_cfg),
|
| 19 |
+
dict(type='Pad', size=crop_size, pad_val=0, seg_pad_val=255),
|
| 20 |
+
dict(type='DefaultFormatBundle'),
|
| 21 |
+
dict(type='Collect', keys=['img', 'gt_semantic_seg'])
|
| 22 |
+
]
|
| 23 |
+
test_pipeline = [
|
| 24 |
+
dict(type='LoadImageFromFile'),
|
| 25 |
+
dict(
|
| 26 |
+
type='MultiScaleFlipAug',
|
| 27 |
+
img_scale=(2048, 512),
|
| 28 |
+
# img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75],
|
| 29 |
+
flip=False,
|
| 30 |
+
transforms=[
|
| 31 |
+
dict(type='Resize', keep_ratio=True),
|
| 32 |
+
dict(type='RandomFlip'),
|
| 33 |
+
dict(type='Normalize', **img_norm_cfg),
|
| 34 |
+
dict(type='ImageToTensor', keys=['img']),
|
| 35 |
+
dict(type='Collect', keys=['img'])
|
| 36 |
+
])
|
| 37 |
+
]
|
| 38 |
+
data = dict(
|
| 39 |
+
# num_gpus: 8 -> batch_size: 8
|
| 40 |
+
samples_per_gpu=1,
|
| 41 |
+
train=dict(pipeline=train_pipeline),
|
| 42 |
+
val=dict(pipeline=test_pipeline),
|
| 43 |
+
test=dict(pipeline=test_pipeline))
|
EgoHOS/raw/script/mmsegmentation/configs/segmenter/segmenter_vit-l_mask_8x1_512x512_160k_ade20k.py
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/segmenter_vit-b16_mask.py',
|
| 3 |
+
'../_base_/datasets/ade20k.py', '../_base_/default_runtime.py',
|
| 4 |
+
'../_base_/schedules/schedule_160k.py'
|
| 5 |
+
]
|
| 6 |
+
checkpoint = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/segmenter/vit_large_p16_384_20220308-d4efb41d.pth' # noqa
|
| 7 |
+
|
| 8 |
+
model = dict(
|
| 9 |
+
pretrained=checkpoint,
|
| 10 |
+
backbone=dict(
|
| 11 |
+
type='VisionTransformer',
|
| 12 |
+
img_size=(640, 640),
|
| 13 |
+
embed_dims=1024,
|
| 14 |
+
num_layers=24,
|
| 15 |
+
num_heads=16),
|
| 16 |
+
decode_head=dict(
|
| 17 |
+
type='SegmenterMaskTransformerHead',
|
| 18 |
+
in_channels=1024,
|
| 19 |
+
channels=1024,
|
| 20 |
+
num_heads=16,
|
| 21 |
+
embed_dims=1024),
|
| 22 |
+
test_cfg=dict(mode='slide', crop_size=(640, 640), stride=(608, 608)))
|
| 23 |
+
|
| 24 |
+
optimizer = dict(lr=0.001, weight_decay=0.0)
|
| 25 |
+
|
| 26 |
+
img_norm_cfg = dict(
|
| 27 |
+
mean=[127.5, 127.5, 127.5], std=[127.5, 127.5, 127.5], to_rgb=True)
|
| 28 |
+
crop_size = (640, 640)
|
| 29 |
+
train_pipeline = [
|
| 30 |
+
dict(type='LoadImageFromFile'),
|
| 31 |
+
dict(type='LoadAnnotations', reduce_zero_label=True),
|
| 32 |
+
dict(type='Resize', img_scale=(2048, 640), ratio_range=(0.5, 2.0)),
|
| 33 |
+
dict(type='RandomCrop', crop_size=crop_size, cat_max_ratio=0.75),
|
| 34 |
+
dict(type='RandomFlip', prob=0.5),
|
| 35 |
+
dict(type='PhotoMetricDistortion'),
|
| 36 |
+
dict(type='Normalize', **img_norm_cfg),
|
| 37 |
+
dict(type='Pad', size=crop_size, pad_val=0, seg_pad_val=255),
|
| 38 |
+
dict(type='DefaultFormatBundle'),
|
| 39 |
+
dict(type='Collect', keys=['img', 'gt_semantic_seg'])
|
| 40 |
+
]
|
| 41 |
+
test_pipeline = [
|
| 42 |
+
dict(type='LoadImageFromFile'),
|
| 43 |
+
dict(
|
| 44 |
+
type='MultiScaleFlipAug',
|
| 45 |
+
img_scale=(2048, 640),
|
| 46 |
+
# img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75],
|
| 47 |
+
flip=False,
|
| 48 |
+
transforms=[
|
| 49 |
+
dict(type='Resize', keep_ratio=True),
|
| 50 |
+
dict(type='RandomFlip'),
|
| 51 |
+
dict(type='Normalize', **img_norm_cfg),
|
| 52 |
+
dict(type='ImageToTensor', keys=['img']),
|
| 53 |
+
dict(type='Collect', keys=['img'])
|
| 54 |
+
])
|
| 55 |
+
]
|
| 56 |
+
data = dict(
|
| 57 |
+
# num_gpus: 8 -> batch_size: 8
|
| 58 |
+
samples_per_gpu=1,
|
| 59 |
+
train=dict(pipeline=train_pipeline),
|
| 60 |
+
val=dict(pipeline=test_pipeline),
|
| 61 |
+
test=dict(pipeline=test_pipeline))
|
EgoHOS/raw/script/mmsegmentation/configs/segmenter/segmenter_vit-s_linear_8x1_512x512_160k_ade20k.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = './segmenter_vit-s_mask_8x1_512x512_160k_ade20k.py'
|
| 2 |
+
|
| 3 |
+
model = dict(
|
| 4 |
+
decode_head=dict(
|
| 5 |
+
_delete_=True,
|
| 6 |
+
type='FCNHead',
|
| 7 |
+
in_channels=384,
|
| 8 |
+
channels=384,
|
| 9 |
+
num_convs=0,
|
| 10 |
+
dropout_ratio=0.0,
|
| 11 |
+
concat_input=False,
|
| 12 |
+
num_classes=150,
|
| 13 |
+
loss_decode=dict(
|
| 14 |
+
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)))
|
EgoHOS/raw/script/mmsegmentation/configs/segmenter/segmenter_vit-s_mask_8x1_512x512_160k_ade20k.py
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/segmenter_vit-b16_mask.py',
|
| 3 |
+
'../_base_/datasets/ade20k.py', '../_base_/default_runtime.py',
|
| 4 |
+
'../_base_/schedules/schedule_160k.py'
|
| 5 |
+
]
|
| 6 |
+
|
| 7 |
+
checkpoint = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/segmenter/vit_small_p16_384_20220308-410f6037.pth' # noqa
|
| 8 |
+
|
| 9 |
+
backbone_norm_cfg = dict(type='LN', eps=1e-6, requires_grad=True)
|
| 10 |
+
model = dict(
|
| 11 |
+
pretrained=checkpoint,
|
| 12 |
+
backbone=dict(
|
| 13 |
+
img_size=(512, 512),
|
| 14 |
+
embed_dims=384,
|
| 15 |
+
num_heads=6,
|
| 16 |
+
),
|
| 17 |
+
decode_head=dict(
|
| 18 |
+
type='SegmenterMaskTransformerHead',
|
| 19 |
+
in_channels=384,
|
| 20 |
+
channels=384,
|
| 21 |
+
num_classes=150,
|
| 22 |
+
num_layers=2,
|
| 23 |
+
num_heads=6,
|
| 24 |
+
embed_dims=384,
|
| 25 |
+
dropout_ratio=0.0,
|
| 26 |
+
loss_decode=dict(
|
| 27 |
+
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)))
|
| 28 |
+
|
| 29 |
+
optimizer = dict(lr=0.001, weight_decay=0.0)
|
| 30 |
+
|
| 31 |
+
img_norm_cfg = dict(
|
| 32 |
+
mean=[127.5, 127.5, 127.5], std=[127.5, 127.5, 127.5], to_rgb=True)
|
| 33 |
+
crop_size = (512, 512)
|
| 34 |
+
train_pipeline = [
|
| 35 |
+
dict(type='LoadImageFromFile'),
|
| 36 |
+
dict(type='LoadAnnotations', reduce_zero_label=True),
|
| 37 |
+
dict(type='Resize', img_scale=(2048, 512), ratio_range=(0.5, 2.0)),
|
| 38 |
+
dict(type='RandomCrop', crop_size=crop_size, cat_max_ratio=0.75),
|
| 39 |
+
dict(type='RandomFlip', prob=0.5),
|
| 40 |
+
dict(type='PhotoMetricDistortion'),
|
| 41 |
+
dict(type='Normalize', **img_norm_cfg),
|
| 42 |
+
dict(type='Pad', size=crop_size, pad_val=0, seg_pad_val=255),
|
| 43 |
+
dict(type='DefaultFormatBundle'),
|
| 44 |
+
dict(type='Collect', keys=['img', 'gt_semantic_seg'])
|
| 45 |
+
]
|
| 46 |
+
test_pipeline = [
|
| 47 |
+
dict(type='LoadImageFromFile'),
|
| 48 |
+
dict(
|
| 49 |
+
type='MultiScaleFlipAug',
|
| 50 |
+
img_scale=(2048, 512),
|
| 51 |
+
# img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75],
|
| 52 |
+
flip=False,
|
| 53 |
+
transforms=[
|
| 54 |
+
dict(type='Resize', keep_ratio=True),
|
| 55 |
+
dict(type='RandomFlip'),
|
| 56 |
+
dict(type='Normalize', **img_norm_cfg),
|
| 57 |
+
dict(type='ImageToTensor', keys=['img']),
|
| 58 |
+
dict(type='Collect', keys=['img'])
|
| 59 |
+
])
|
| 60 |
+
]
|
| 61 |
+
data = dict(
|
| 62 |
+
# num_gpus: 8 -> batch_size: 8
|
| 63 |
+
samples_per_gpu=1,
|
| 64 |
+
train=dict(pipeline=train_pipeline),
|
| 65 |
+
val=dict(pipeline=test_pipeline),
|
| 66 |
+
test=dict(pipeline=test_pipeline))
|
EgoHOS/raw/script/mmsegmentation/configs/segmenter/segmenter_vit-t_mask_8x1_512x512_160k_ade20k.py
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/segmenter_vit-b16_mask.py',
|
| 3 |
+
'../_base_/datasets/ade20k.py', '../_base_/default_runtime.py',
|
| 4 |
+
'../_base_/schedules/schedule_160k.py'
|
| 5 |
+
]
|
| 6 |
+
|
| 7 |
+
checkpoint = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/segmenter/vit_tiny_p16_384_20220308-cce8c795.pth' # noqa
|
| 8 |
+
|
| 9 |
+
model = dict(
|
| 10 |
+
pretrained=checkpoint,
|
| 11 |
+
backbone=dict(embed_dims=192, num_heads=3),
|
| 12 |
+
decode_head=dict(
|
| 13 |
+
type='SegmenterMaskTransformerHead',
|
| 14 |
+
in_channels=192,
|
| 15 |
+
channels=192,
|
| 16 |
+
num_heads=3,
|
| 17 |
+
embed_dims=192))
|
| 18 |
+
|
| 19 |
+
optimizer = dict(lr=0.001, weight_decay=0.0)
|
| 20 |
+
|
| 21 |
+
img_norm_cfg = dict(
|
| 22 |
+
mean=[127.5, 127.5, 127.5], std=[127.5, 127.5, 127.5], to_rgb=True)
|
| 23 |
+
crop_size = (512, 512)
|
| 24 |
+
train_pipeline = [
|
| 25 |
+
dict(type='LoadImageFromFile'),
|
| 26 |
+
dict(type='LoadAnnotations', reduce_zero_label=True),
|
| 27 |
+
dict(type='Resize', img_scale=(2048, 512), ratio_range=(0.5, 2.0)),
|
| 28 |
+
dict(type='RandomCrop', crop_size=crop_size, cat_max_ratio=0.75),
|
| 29 |
+
dict(type='RandomFlip', prob=0.5),
|
| 30 |
+
dict(type='PhotoMetricDistortion'),
|
| 31 |
+
dict(type='Normalize', **img_norm_cfg),
|
| 32 |
+
dict(type='Pad', size=crop_size, pad_val=0, seg_pad_val=255),
|
| 33 |
+
dict(type='DefaultFormatBundle'),
|
| 34 |
+
dict(type='Collect', keys=['img', 'gt_semantic_seg'])
|
| 35 |
+
]
|
| 36 |
+
test_pipeline = [
|
| 37 |
+
dict(type='LoadImageFromFile'),
|
| 38 |
+
dict(
|
| 39 |
+
type='MultiScaleFlipAug',
|
| 40 |
+
img_scale=(2048, 512),
|
| 41 |
+
# img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75],
|
| 42 |
+
flip=False,
|
| 43 |
+
transforms=[
|
| 44 |
+
dict(type='Resize', keep_ratio=True),
|
| 45 |
+
dict(type='RandomFlip'),
|
| 46 |
+
dict(type='Normalize', **img_norm_cfg),
|
| 47 |
+
dict(type='ImageToTensor', keys=['img']),
|
| 48 |
+
dict(type='Collect', keys=['img'])
|
| 49 |
+
])
|
| 50 |
+
]
|
| 51 |
+
data = dict(
|
| 52 |
+
# num_gpus: 8 -> batch_size: 8
|
| 53 |
+
samples_per_gpu=1,
|
| 54 |
+
train=dict(pipeline=train_pipeline),
|
| 55 |
+
val=dict(pipeline=test_pipeline),
|
| 56 |
+
test=dict(pipeline=test_pipeline))
|
EgoHOS/raw/script/mmsegmentation/configs/sem_fpn/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Semantic FPN
|
| 2 |
+
|
| 3 |
+
[Panoptic Feature Pyramid Networks](https://arxiv.org/abs/1901.02446)
|
| 4 |
+
|
| 5 |
+
## Introduction
|
| 6 |
+
|
| 7 |
+
<!-- [ALGORITHM] -->
|
| 8 |
+
|
| 9 |
+
<a href="https://github.com/facebookresearch/detectron2">Official Repo</a>
|
| 10 |
+
|
| 11 |
+
<a href="https://github.com/open-mmlab/mmsegmentation/blob/v0.17.0/mmseg/models/decode_heads/fpn_head.py#L12">Code Snippet</a>
|
| 12 |
+
|
| 13 |
+
## Abstract
|
| 14 |
+
|
| 15 |
+
<!-- [ABSTRACT] -->
|
| 16 |
+
|
| 17 |
+
The recently introduced panoptic segmentation task has renewed our community's interest in unifying the tasks of instance segmentation (for thing classes) and semantic segmentation (for stuff classes). However, current state-of-the-art methods for this joint task use separate and dissimilar networks for instance and semantic segmentation, without performing any shared computation. In this work, we aim to unify these methods at the architectural level, designing a single network for both tasks. Our approach is to endow Mask R-CNN, a popular instance segmentation method, with a semantic segmentation branch using a shared Feature Pyramid Network (FPN) backbone. Surprisingly, this simple baseline not only remains effective for instance segmentation, but also yields a lightweight, top-performing method for semantic segmentation. In this work, we perform a detailed study of this minimally extended version of Mask R-CNN with FPN, which we refer to as Panoptic FPN, and show it is a robust and accurate baseline for both tasks. Given its effectiveness and conceptual simplicity, we hope our method can serve as a strong baseline and aid future research in panoptic segmentation.
|
| 18 |
+
|
| 19 |
+
<!-- [IMAGE] -->
|
| 20 |
+
<div align=center>
|
| 21 |
+
<img src="https://user-images.githubusercontent.com/24582831/142902694-03ed2131-9104-467b-ace1-c74c62fb7177.png" width="60%"/>
|
| 22 |
+
</div>
|
| 23 |
+
|
| 24 |
+
## Citation
|
| 25 |
+
|
| 26 |
+
```bibtex
|
| 27 |
+
@inproceedings{kirillov2019panoptic,
|
| 28 |
+
title={Panoptic feature pyramid networks},
|
| 29 |
+
author={Kirillov, Alexander and Girshick, Ross and He, Kaiming and Doll{\'a}r, Piotr},
|
| 30 |
+
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
|
| 31 |
+
pages={6399--6408},
|
| 32 |
+
year={2019}
|
| 33 |
+
}
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
## Results and models
|
| 37 |
+
|
| 38 |
+
### Cityscapes
|
| 39 |
+
|
| 40 |
+
| Method | Backbone | Crop Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | config | download |
|
| 41 |
+
| ------ | -------- | --------- | ------: | -------: | -------------- | ----: | ------------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| 42 |
+
| FPN | R-50 | 512x1024 | 80000 | 2.8 | 13.54 | 74.52 | 76.08 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/sem_fpn/fpn_r50_512x1024_80k_cityscapes.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/sem_fpn/fpn_r50_512x1024_80k_cityscapes/fpn_r50_512x1024_80k_cityscapes_20200717_021437-94018a0d.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/sem_fpn/fpn_r50_512x1024_80k_cityscapes/fpn_r50_512x1024_80k_cityscapes-20200717_021437.log.json) |
|
| 43 |
+
| FPN | R-101 | 512x1024 | 80000 | 3.9 | 10.29 | 75.80 | 77.40 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/sem_fpn/fpn_r101_512x1024_80k_cityscapes.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/sem_fpn/fpn_r101_512x1024_80k_cityscapes/fpn_r101_512x1024_80k_cityscapes_20200717_012416-c5800d4c.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/sem_fpn/fpn_r101_512x1024_80k_cityscapes/fpn_r101_512x1024_80k_cityscapes-20200717_012416.log.json) |
|
| 44 |
+
|
| 45 |
+
### ADE20K
|
| 46 |
+
|
| 47 |
+
| Method | Backbone | Crop Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | config | download |
|
| 48 |
+
| ------ | -------- | --------- | ------: | -------: | -------------- | ----: | ------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| 49 |
+
| FPN | R-50 | 512x512 | 160000 | 4.9 | 55.77 | 37.49 | 39.09 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/sem_fpn/fpn_r50_512x512_160k_ade20k.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/sem_fpn/fpn_r50_512x512_160k_ade20k/fpn_r50_512x512_160k_ade20k_20200718_131734-5b5a6ab9.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/sem_fpn/fpn_r50_512x512_160k_ade20k/fpn_r50_512x512_160k_ade20k-20200718_131734.log.json) |
|
| 50 |
+
| FPN | R-101 | 512x512 | 160000 | 5.9 | 40.58 | 39.35 | 40.72 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/sem_fpn/fpn_r101_512x512_160k_ade20k.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/sem_fpn/fpn_r101_512x512_160k_ade20k/fpn_r101_512x512_160k_ade20k_20200718_131734-306b5004.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/sem_fpn/fpn_r101_512x512_160k_ade20k/fpn_r101_512x512_160k_ade20k-20200718_131734.log.json) |
|
EgoHOS/raw/script/mmsegmentation/configs/sem_fpn/fpn_r101_512x1024_80k_cityscapes.py
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = './fpn_r50_512x1024_80k_cityscapes.py'
|
| 2 |
+
model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101))
|
EgoHOS/raw/script/mmsegmentation/configs/sem_fpn/fpn_r101_512x512_160k_ade20k.py
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = './fpn_r50_512x512_160k_ade20k.py'
|
| 2 |
+
model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101))
|
EgoHOS/raw/script/mmsegmentation/configs/sem_fpn/fpn_r50_512x1024_80k_cityscapes.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/fpn_r50.py', '../_base_/datasets/cityscapes.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py'
|
| 4 |
+
]
|
EgoHOS/raw/script/mmsegmentation/configs/sem_fpn/fpn_r50_512x512_160k_ade20k.py
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/fpn_r50.py', '../_base_/datasets/ade20k.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py'
|
| 4 |
+
]
|
| 5 |
+
model = dict(decode_head=dict(num_classes=150))
|
EgoHOS/raw/script/mmsegmentation/configs/sem_fpn/sem_fpn.yml
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Collections:
|
| 2 |
+
- Name: FPN
|
| 3 |
+
Metadata:
|
| 4 |
+
Training Data:
|
| 5 |
+
- Cityscapes
|
| 6 |
+
- ADE20K
|
| 7 |
+
Paper:
|
| 8 |
+
URL: https://arxiv.org/abs/1901.02446
|
| 9 |
+
Title: Panoptic Feature Pyramid Networks
|
| 10 |
+
README: configs/sem_fpn/README.md
|
| 11 |
+
Code:
|
| 12 |
+
URL: https://github.com/open-mmlab/mmsegmentation/blob/v0.17.0/mmseg/models/decode_heads/fpn_head.py#L12
|
| 13 |
+
Version: v0.17.0
|
| 14 |
+
Converted From:
|
| 15 |
+
Code: https://github.com/facebookresearch/detectron2
|
| 16 |
+
Models:
|
| 17 |
+
- Name: fpn_r50_512x1024_80k_cityscapes
|
| 18 |
+
In Collection: FPN
|
| 19 |
+
Metadata:
|
| 20 |
+
backbone: R-50
|
| 21 |
+
crop size: (512,1024)
|
| 22 |
+
lr schd: 80000
|
| 23 |
+
inference time (ms/im):
|
| 24 |
+
- value: 73.86
|
| 25 |
+
hardware: V100
|
| 26 |
+
backend: PyTorch
|
| 27 |
+
batch size: 1
|
| 28 |
+
mode: FP32
|
| 29 |
+
resolution: (512,1024)
|
| 30 |
+
Training Memory (GB): 2.8
|
| 31 |
+
Results:
|
| 32 |
+
- Task: Semantic Segmentation
|
| 33 |
+
Dataset: Cityscapes
|
| 34 |
+
Metrics:
|
| 35 |
+
mIoU: 74.52
|
| 36 |
+
mIoU(ms+flip): 76.08
|
| 37 |
+
Config: configs/sem_fpn/fpn_r50_512x1024_80k_cityscapes.py
|
| 38 |
+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/sem_fpn/fpn_r50_512x1024_80k_cityscapes/fpn_r50_512x1024_80k_cityscapes_20200717_021437-94018a0d.pth
|
| 39 |
+
- Name: fpn_r101_512x1024_80k_cityscapes
|
| 40 |
+
In Collection: FPN
|
| 41 |
+
Metadata:
|
| 42 |
+
backbone: R-101
|
| 43 |
+
crop size: (512,1024)
|
| 44 |
+
lr schd: 80000
|
| 45 |
+
inference time (ms/im):
|
| 46 |
+
- value: 97.18
|
| 47 |
+
hardware: V100
|
| 48 |
+
backend: PyTorch
|
| 49 |
+
batch size: 1
|
| 50 |
+
mode: FP32
|
| 51 |
+
resolution: (512,1024)
|
| 52 |
+
Training Memory (GB): 3.9
|
| 53 |
+
Results:
|
| 54 |
+
- Task: Semantic Segmentation
|
| 55 |
+
Dataset: Cityscapes
|
| 56 |
+
Metrics:
|
| 57 |
+
mIoU: 75.8
|
| 58 |
+
mIoU(ms+flip): 77.4
|
| 59 |
+
Config: configs/sem_fpn/fpn_r101_512x1024_80k_cityscapes.py
|
| 60 |
+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/sem_fpn/fpn_r101_512x1024_80k_cityscapes/fpn_r101_512x1024_80k_cityscapes_20200717_012416-c5800d4c.pth
|
| 61 |
+
- Name: fpn_r50_512x512_160k_ade20k
|
| 62 |
+
In Collection: FPN
|
| 63 |
+
Metadata:
|
| 64 |
+
backbone: R-50
|
| 65 |
+
crop size: (512,512)
|
| 66 |
+
lr schd: 160000
|
| 67 |
+
inference time (ms/im):
|
| 68 |
+
- value: 17.93
|
| 69 |
+
hardware: V100
|
| 70 |
+
backend: PyTorch
|
| 71 |
+
batch size: 1
|
| 72 |
+
mode: FP32
|
| 73 |
+
resolution: (512,512)
|
| 74 |
+
Training Memory (GB): 4.9
|
| 75 |
+
Results:
|
| 76 |
+
- Task: Semantic Segmentation
|
| 77 |
+
Dataset: ADE20K
|
| 78 |
+
Metrics:
|
| 79 |
+
mIoU: 37.49
|
| 80 |
+
mIoU(ms+flip): 39.09
|
| 81 |
+
Config: configs/sem_fpn/fpn_r50_512x512_160k_ade20k.py
|
| 82 |
+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/sem_fpn/fpn_r50_512x512_160k_ade20k/fpn_r50_512x512_160k_ade20k_20200718_131734-5b5a6ab9.pth
|
| 83 |
+
- Name: fpn_r101_512x512_160k_ade20k
|
| 84 |
+
In Collection: FPN
|
| 85 |
+
Metadata:
|
| 86 |
+
backbone: R-101
|
| 87 |
+
crop size: (512,512)
|
| 88 |
+
lr schd: 160000
|
| 89 |
+
inference time (ms/im):
|
| 90 |
+
- value: 24.64
|
| 91 |
+
hardware: V100
|
| 92 |
+
backend: PyTorch
|
| 93 |
+
batch size: 1
|
| 94 |
+
mode: FP32
|
| 95 |
+
resolution: (512,512)
|
| 96 |
+
Training Memory (GB): 5.9
|
| 97 |
+
Results:
|
| 98 |
+
- Task: Semantic Segmentation
|
| 99 |
+
Dataset: ADE20K
|
| 100 |
+
Metrics:
|
| 101 |
+
mIoU: 39.35
|
| 102 |
+
mIoU(ms+flip): 40.72
|
| 103 |
+
Config: configs/sem_fpn/fpn_r101_512x512_160k_ade20k.py
|
| 104 |
+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/sem_fpn/fpn_r101_512x512_160k_ade20k/fpn_r101_512x512_160k_ade20k_20200718_131734-306b5004.pth
|
EgoHOS/raw/script/mmsegmentation/configs/setr/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SETR
|
| 2 |
+
|
| 3 |
+
[Rethinking Semantic Segmentation from a Sequence-to-Sequence Perspective with Transformers](https://arxiv.org/abs/2012.15840)
|
| 4 |
+
|
| 5 |
+
## Introduction
|
| 6 |
+
|
| 7 |
+
<!-- [ALGORITHM] -->
|
| 8 |
+
|
| 9 |
+
<a href="https://github.com/fudan-zvg/SETR">Official Repo</a>
|
| 10 |
+
|
| 11 |
+
<a href="https://github.com/open-mmlab/mmsegmentation/blob/v0.17.0/mmseg/models/decode_heads/setr_up_head.py#L11">Code Snippet</a>
|
| 12 |
+
|
| 13 |
+
## Abstract
|
| 14 |
+
|
| 15 |
+
<!-- [ABSTRACT] -->
|
| 16 |
+
|
| 17 |
+
Most recent semantic segmentation methods adopt a fully-convolutional network (FCN) with an encoder-decoder architecture. The encoder progressively reduces the spatial resolution and learns more abstract/semantic visual concepts with larger receptive fields. Since context modeling is critical for segmentation, the latest efforts have been focused on increasing the receptive field, through either dilated/atrous convolutions or inserting attention modules. However, the encoder-decoder based FCN architecture remains unchanged. In this paper, we aim to provide an alternative perspective by treating semantic segmentation as a sequence-to-sequence prediction task. Specifically, we deploy a pure transformer (ie, without convolution and resolution reduction) to encode an image as a sequence of patches. With the global context modeled in every layer of the transformer, this encoder can be combined with a simple decoder to provide a powerful segmentation model, termed SEgmentation TRansformer (SETR). Extensive experiments show that SETR achieves new state of the art on ADE20K (50.28% mIoU), Pascal Context (55.83% mIoU) and competitive results on Cityscapes. Particularly, we achieve the first position in the highly competitive ADE20K test server leaderboard on the day of submission.
|
| 18 |
+
|
| 19 |
+
<!-- [IMAGE] -->
|
| 20 |
+
<div align=center>
|
| 21 |
+
<img src="https://user-images.githubusercontent.com/24582831/142902777-ee2d34b7-a631-4fa7-ad68-118ff5716afe.png" width="80%"/>
|
| 22 |
+
</div>
|
| 23 |
+
|
| 24 |
+
```None
|
| 25 |
+
This head has two version head.
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
## Citation
|
| 29 |
+
|
| 30 |
+
```bibtex
|
| 31 |
+
@article{zheng2020rethinking,
|
| 32 |
+
title={Rethinking Semantic Segmentation from a Sequence-to-Sequence Perspective with Transformers},
|
| 33 |
+
author={Zheng, Sixiao and Lu, Jiachen and Zhao, Hengshuang and Zhu, Xiatian and Luo, Zekun and Wang, Yabiao and Fu, Yanwei and Feng, Jianfeng and Xiang, Tao and Torr, Philip HS and others},
|
| 34 |
+
journal={arXiv preprint arXiv:2012.15840},
|
| 35 |
+
year={2020}
|
| 36 |
+
}
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
## Usage
|
| 40 |
+
|
| 41 |
+
You can download the pretrain from [here](https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-vitjx/jx_vit_large_p16_384-b3be5167.pth). Then you can convert its keys with the script `vit2mmseg.py` in the tools directory.
|
| 42 |
+
|
| 43 |
+
```shell
|
| 44 |
+
python tools/model_converters/vit2mmseg.py ${PRETRAIN_PATH} ${STORE_PATH}
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
E.g.
|
| 48 |
+
|
| 49 |
+
```shell
|
| 50 |
+
python tools/model_converters/vit2mmseg.py \
|
| 51 |
+
jx_vit_large_p16_384-b3be5167.pth pretrain/vit_large_p16.pth
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
This script convert the model from `PRETRAIN_PATH` and store the converted model in `STORE_PATH`.
|
| 55 |
+
|
| 56 |
+
## Results and models
|
| 57 |
+
|
| 58 |
+
### ADE20K
|
| 59 |
+
|
| 60 |
+
| Method | Backbone | Crop Size | Batch Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | config | download |
|
| 61 |
+
| ------ | -------- | --------- | ---------- | ------- | -------- | -------------- | ----- | ------------: | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
| 62 |
+
| SETR Naive | ViT-L | 512x512 | 16 | 160000 | 18.40 | 4.72 | 48.28 | 49.56 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/setr/setr_naive_512x512_160k_b16_ade20k.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/setr/setr_naive_512x512_160k_b16_ade20k/setr_naive_512x512_160k_b16_ade20k_20210619_191258-061f24f5.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/setr/setr_naive_512x512_160k_b16_ade20k/setr_naive_512x512_160k_b16_ade20k_20210619_191258.log.json) |
|
| 63 |
+
| SETR PUP | ViT-L | 512x512 | 16 | 160000 | 19.54 | 4.50 | 48.24 | 49.99 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/setr/setr_pup_512x512_160k_b16_ade20k.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/setr/setr_pup_512x512_160k_b16_ade20k/setr_pup_512x512_160k_b16_ade20k_20210619_191343-7e0ce826.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/setr/setr_pup_512x512_160k_b16_ade20k/setr_pup_512x512_160k_b16_ade20k_20210619_191343.log.json) |
|
| 64 |
+
| SETR MLA | ViT-L | 512x512 | 8 | 160000 | 10.96 | - | 47.34 | 49.05 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/setr/setr_mla_512x512_160k_b8_ade20k.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/setr/setr_mla_512x512_160k_b8_ade20k/setr_mla_512x512_160k_b8_ade20k_20210619_191118-c6d21df0.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/setr/setr_mla_512x512_160k_b8_ade20k/setr_mla_512x512_160k_b8_ade20k_20210619_191118.log.json) |
|
| 65 |
+
| SETR MLA | ViT-L | 512x512 | 16 | 160000 | 17.30 | 5.25 | 47.54 | 49.37 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/setr/setr_mla_512x512_160k_b16_ade20k.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/setr/setr_mla_512x512_160k_b16_ade20k/setr_mla_512x512_160k_b16_ade20k_20210619_191057-f9741de7.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/setr/setr_mla_512x512_160k_b16_ade20k/setr_mla_512x512_160k_b16_ade20k_20210619_191057.log.json) |
|
| 66 |
+
|
| 67 |
+
### Cityscapes
|
| 68 |
+
|
| 69 |
+
| Method | Backbone | Crop Size | Batch Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | config | download |
|
| 70 |
+
| ------ | -------- | --------- | ---------- | ------- | -------- | -------------- | ----- | ------------: | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
| 71 |
+
| SETR Naive | ViT-L | 768x768 | 8 | 80000 | 24.06 | 0.39 | 78.10 | 80.22 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/setr/setr_vit-large_naive_8x1_768x768_80k_cityscapes.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/setr/setr_naive_vit-large_8x1_768x768_80k_cityscapes/setr_naive_vit-large_8x1_768x768_80k_cityscapes_20211123_000505-20728e80.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/setr/setr_naive_vit-large_8x1_768x768_80k_cityscapes/setr_naive_vit-large_8x1_768x768_80k_cityscapes_20211123_000505.log.json) |
|
| 72 |
+
| SETR PUP | ViT-L | 768x768 | 8 | 80000 | 27.96 | 0.37 | 79.21 | 81.02 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/setr/setr_vit-large_pup_8x1_768x768_80k_cityscapes.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/setr/setr_pup_vit-large_8x1_768x768_80k_cityscapes/setr_pup_vit-large_8x1_768x768_80k_cityscapes_20211122_155115-f6f37b8f.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/setr/setr_pup_vit-large_8x1_768x768_80k_cityscapes/setr_pup_vit-large_8x1_768x768_80k_cityscapes_20211122_155115.log.json) |
|
| 73 |
+
| SETR MLA | ViT-L | 768x768 | 8 | 80000 | 24.10 | 0.41 | 77.00 | 79.59 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/setr/setr_vit-large_mla_8x1_768x768_80k_cityscapes.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/setr/setr_mla_vit-large_8x1_768x768_80k_cityscapes/setr_mla_vit-large_8x1_768x768_80k_cityscapes_20211119_101003-7f8dccbe.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/setr/setr_mla_vit-large_8x1_768x768_80k_cityscapes/setr_mla_vit-large_8x1_768x768_80k_cityscapes_20211119_101003.log.json) |
|
EgoHOS/raw/script/mmsegmentation/configs/setr/setr.yml
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Collections:
|
| 2 |
+
- Name: SETR
|
| 3 |
+
Metadata:
|
| 4 |
+
Training Data:
|
| 5 |
+
- ADE20K
|
| 6 |
+
- Cityscapes
|
| 7 |
+
Paper:
|
| 8 |
+
URL: https://arxiv.org/abs/2012.15840
|
| 9 |
+
Title: Rethinking Semantic Segmentation from a Sequence-to-Sequence Perspective
|
| 10 |
+
with Transformers
|
| 11 |
+
README: configs/setr/README.md
|
| 12 |
+
Code:
|
| 13 |
+
URL: https://github.com/open-mmlab/mmsegmentation/blob/v0.17.0/mmseg/models/decode_heads/setr_up_head.py#L11
|
| 14 |
+
Version: v0.17.0
|
| 15 |
+
Converted From:
|
| 16 |
+
Code: https://github.com/fudan-zvg/SETR
|
| 17 |
+
Models:
|
| 18 |
+
- Name: setr_naive_512x512_160k_b16_ade20k
|
| 19 |
+
In Collection: SETR
|
| 20 |
+
Metadata:
|
| 21 |
+
backbone: ViT-L
|
| 22 |
+
crop size: (512,512)
|
| 23 |
+
lr schd: 160000
|
| 24 |
+
inference time (ms/im):
|
| 25 |
+
- value: 211.86
|
| 26 |
+
hardware: V100
|
| 27 |
+
backend: PyTorch
|
| 28 |
+
batch size: 1
|
| 29 |
+
mode: FP32
|
| 30 |
+
resolution: (512,512)
|
| 31 |
+
Training Memory (GB): 18.4
|
| 32 |
+
Results:
|
| 33 |
+
- Task: Semantic Segmentation
|
| 34 |
+
Dataset: ADE20K
|
| 35 |
+
Metrics:
|
| 36 |
+
mIoU: 48.28
|
| 37 |
+
mIoU(ms+flip): 49.56
|
| 38 |
+
Config: configs/setr/setr_naive_512x512_160k_b16_ade20k.py
|
| 39 |
+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/setr/setr_naive_512x512_160k_b16_ade20k/setr_naive_512x512_160k_b16_ade20k_20210619_191258-061f24f5.pth
|
| 40 |
+
- Name: setr_pup_512x512_160k_b16_ade20k
|
| 41 |
+
In Collection: SETR
|
| 42 |
+
Metadata:
|
| 43 |
+
backbone: ViT-L
|
| 44 |
+
crop size: (512,512)
|
| 45 |
+
lr schd: 160000
|
| 46 |
+
inference time (ms/im):
|
| 47 |
+
- value: 222.22
|
| 48 |
+
hardware: V100
|
| 49 |
+
backend: PyTorch
|
| 50 |
+
batch size: 1
|
| 51 |
+
mode: FP32
|
| 52 |
+
resolution: (512,512)
|
| 53 |
+
Training Memory (GB): 19.54
|
| 54 |
+
Results:
|
| 55 |
+
- Task: Semantic Segmentation
|
| 56 |
+
Dataset: ADE20K
|
| 57 |
+
Metrics:
|
| 58 |
+
mIoU: 48.24
|
| 59 |
+
mIoU(ms+flip): 49.99
|
| 60 |
+
Config: configs/setr/setr_pup_512x512_160k_b16_ade20k.py
|
| 61 |
+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/setr/setr_pup_512x512_160k_b16_ade20k/setr_pup_512x512_160k_b16_ade20k_20210619_191343-7e0ce826.pth
|
| 62 |
+
- Name: setr_mla_512x512_160k_b8_ade20k
|
| 63 |
+
In Collection: SETR
|
| 64 |
+
Metadata:
|
| 65 |
+
backbone: ViT-L
|
| 66 |
+
crop size: (512,512)
|
| 67 |
+
lr schd: 160000
|
| 68 |
+
Training Memory (GB): 10.96
|
| 69 |
+
Results:
|
| 70 |
+
- Task: Semantic Segmentation
|
| 71 |
+
Dataset: ADE20K
|
| 72 |
+
Metrics:
|
| 73 |
+
mIoU: 47.34
|
| 74 |
+
mIoU(ms+flip): 49.05
|
| 75 |
+
Config: configs/setr/setr_mla_512x512_160k_b8_ade20k.py
|
| 76 |
+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/setr/setr_mla_512x512_160k_b8_ade20k/setr_mla_512x512_160k_b8_ade20k_20210619_191118-c6d21df0.pth
|
| 77 |
+
- Name: setr_mla_512x512_160k_b16_ade20k
|
| 78 |
+
In Collection: SETR
|
| 79 |
+
Metadata:
|
| 80 |
+
backbone: ViT-L
|
| 81 |
+
crop size: (512,512)
|
| 82 |
+
lr schd: 160000
|
| 83 |
+
inference time (ms/im):
|
| 84 |
+
- value: 190.48
|
| 85 |
+
hardware: V100
|
| 86 |
+
backend: PyTorch
|
| 87 |
+
batch size: 1
|
| 88 |
+
mode: FP32
|
| 89 |
+
resolution: (512,512)
|
| 90 |
+
Training Memory (GB): 17.3
|
| 91 |
+
Results:
|
| 92 |
+
- Task: Semantic Segmentation
|
| 93 |
+
Dataset: ADE20K
|
| 94 |
+
Metrics:
|
| 95 |
+
mIoU: 47.54
|
| 96 |
+
mIoU(ms+flip): 49.37
|
| 97 |
+
Config: configs/setr/setr_mla_512x512_160k_b16_ade20k.py
|
| 98 |
+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/setr/setr_mla_512x512_160k_b16_ade20k/setr_mla_512x512_160k_b16_ade20k_20210619_191057-f9741de7.pth
|
| 99 |
+
- Name: setr_vit-large_naive_8x1_768x768_80k_cityscapes
|
| 100 |
+
In Collection: SETR
|
| 101 |
+
Metadata:
|
| 102 |
+
backbone: ViT-L
|
| 103 |
+
crop size: (768,768)
|
| 104 |
+
lr schd: 80000
|
| 105 |
+
inference time (ms/im):
|
| 106 |
+
- value: 2564.1
|
| 107 |
+
hardware: V100
|
| 108 |
+
backend: PyTorch
|
| 109 |
+
batch size: 1
|
| 110 |
+
mode: FP32
|
| 111 |
+
resolution: (768,768)
|
| 112 |
+
Training Memory (GB): 24.06
|
| 113 |
+
Results:
|
| 114 |
+
- Task: Semantic Segmentation
|
| 115 |
+
Dataset: Cityscapes
|
| 116 |
+
Metrics:
|
| 117 |
+
mIoU: 78.1
|
| 118 |
+
mIoU(ms+flip): 80.22
|
| 119 |
+
Config: configs/setr/setr_vit-large_naive_8x1_768x768_80k_cityscapes.py
|
| 120 |
+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/setr/setr_naive_vit-large_8x1_768x768_80k_cityscapes/setr_naive_vit-large_8x1_768x768_80k_cityscapes_20211123_000505-20728e80.pth
|
| 121 |
+
- Name: setr_vit-large_pup_8x1_768x768_80k_cityscapes
|
| 122 |
+
In Collection: SETR
|
| 123 |
+
Metadata:
|
| 124 |
+
backbone: ViT-L
|
| 125 |
+
crop size: (768,768)
|
| 126 |
+
lr schd: 80000
|
| 127 |
+
inference time (ms/im):
|
| 128 |
+
- value: 2702.7
|
| 129 |
+
hardware: V100
|
| 130 |
+
backend: PyTorch
|
| 131 |
+
batch size: 1
|
| 132 |
+
mode: FP32
|
| 133 |
+
resolution: (768,768)
|
| 134 |
+
Training Memory (GB): 27.96
|
| 135 |
+
Results:
|
| 136 |
+
- Task: Semantic Segmentation
|
| 137 |
+
Dataset: Cityscapes
|
| 138 |
+
Metrics:
|
| 139 |
+
mIoU: 79.21
|
| 140 |
+
mIoU(ms+flip): 81.02
|
| 141 |
+
Config: configs/setr/setr_vit-large_pup_8x1_768x768_80k_cityscapes.py
|
| 142 |
+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/setr/setr_pup_vit-large_8x1_768x768_80k_cityscapes/setr_pup_vit-large_8x1_768x768_80k_cityscapes_20211122_155115-f6f37b8f.pth
|
| 143 |
+
- Name: setr_vit-large_mla_8x1_768x768_80k_cityscapes
|
| 144 |
+
In Collection: SETR
|
| 145 |
+
Metadata:
|
| 146 |
+
backbone: ViT-L
|
| 147 |
+
crop size: (768,768)
|
| 148 |
+
lr schd: 80000
|
| 149 |
+
inference time (ms/im):
|
| 150 |
+
- value: 2439.02
|
| 151 |
+
hardware: V100
|
| 152 |
+
backend: PyTorch
|
| 153 |
+
batch size: 1
|
| 154 |
+
mode: FP32
|
| 155 |
+
resolution: (768,768)
|
| 156 |
+
Training Memory (GB): 24.1
|
| 157 |
+
Results:
|
| 158 |
+
- Task: Semantic Segmentation
|
| 159 |
+
Dataset: Cityscapes
|
| 160 |
+
Metrics:
|
| 161 |
+
mIoU: 77.0
|
| 162 |
+
mIoU(ms+flip): 79.59
|
| 163 |
+
Config: configs/setr/setr_vit-large_mla_8x1_768x768_80k_cityscapes.py
|
| 164 |
+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/setr/setr_mla_vit-large_8x1_768x768_80k_cityscapes/setr_mla_vit-large_8x1_768x768_80k_cityscapes_20211119_101003-7f8dccbe.pth
|
EgoHOS/raw/script/mmsegmentation/configs/setr/setr_mla_512x512_160k_b16_ade20k.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = ['./setr_mla_512x512_160k_b8_ade20k.py']
|
| 2 |
+
|
| 3 |
+
# num_gpus: 8 -> batch_size: 16
|
| 4 |
+
data = dict(samples_per_gpu=2)
|
EgoHOS/raw/script/mmsegmentation/configs/setr/setr_mla_512x512_160k_b8_ade20k.py
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/setr_mla.py', '../_base_/datasets/ade20k.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py'
|
| 4 |
+
]
|
| 5 |
+
norm_cfg = dict(type='SyncBN', requires_grad=True)
|
| 6 |
+
model = dict(
|
| 7 |
+
pretrained=None,
|
| 8 |
+
backbone=dict(
|
| 9 |
+
img_size=(512, 512),
|
| 10 |
+
drop_rate=0.,
|
| 11 |
+
init_cfg=dict(
|
| 12 |
+
type='Pretrained', checkpoint='pretrain/vit_large_p16.pth')),
|
| 13 |
+
decode_head=dict(num_classes=150),
|
| 14 |
+
auxiliary_head=[
|
| 15 |
+
dict(
|
| 16 |
+
type='FCNHead',
|
| 17 |
+
in_channels=256,
|
| 18 |
+
channels=256,
|
| 19 |
+
in_index=0,
|
| 20 |
+
dropout_ratio=0,
|
| 21 |
+
norm_cfg=norm_cfg,
|
| 22 |
+
act_cfg=dict(type='ReLU'),
|
| 23 |
+
num_convs=0,
|
| 24 |
+
kernel_size=1,
|
| 25 |
+
concat_input=False,
|
| 26 |
+
num_classes=150,
|
| 27 |
+
align_corners=False,
|
| 28 |
+
loss_decode=dict(
|
| 29 |
+
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
|
| 30 |
+
dict(
|
| 31 |
+
type='FCNHead',
|
| 32 |
+
in_channels=256,
|
| 33 |
+
channels=256,
|
| 34 |
+
in_index=1,
|
| 35 |
+
dropout_ratio=0,
|
| 36 |
+
norm_cfg=norm_cfg,
|
| 37 |
+
act_cfg=dict(type='ReLU'),
|
| 38 |
+
num_convs=0,
|
| 39 |
+
kernel_size=1,
|
| 40 |
+
concat_input=False,
|
| 41 |
+
num_classes=150,
|
| 42 |
+
align_corners=False,
|
| 43 |
+
loss_decode=dict(
|
| 44 |
+
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
|
| 45 |
+
dict(
|
| 46 |
+
type='FCNHead',
|
| 47 |
+
in_channels=256,
|
| 48 |
+
channels=256,
|
| 49 |
+
in_index=2,
|
| 50 |
+
dropout_ratio=0,
|
| 51 |
+
norm_cfg=norm_cfg,
|
| 52 |
+
act_cfg=dict(type='ReLU'),
|
| 53 |
+
num_convs=0,
|
| 54 |
+
kernel_size=1,
|
| 55 |
+
concat_input=False,
|
| 56 |
+
num_classes=150,
|
| 57 |
+
align_corners=False,
|
| 58 |
+
loss_decode=dict(
|
| 59 |
+
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
|
| 60 |
+
dict(
|
| 61 |
+
type='FCNHead',
|
| 62 |
+
in_channels=256,
|
| 63 |
+
channels=256,
|
| 64 |
+
in_index=3,
|
| 65 |
+
dropout_ratio=0,
|
| 66 |
+
norm_cfg=norm_cfg,
|
| 67 |
+
act_cfg=dict(type='ReLU'),
|
| 68 |
+
num_convs=0,
|
| 69 |
+
kernel_size=1,
|
| 70 |
+
concat_input=False,
|
| 71 |
+
num_classes=150,
|
| 72 |
+
align_corners=False,
|
| 73 |
+
loss_decode=dict(
|
| 74 |
+
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
|
| 75 |
+
],
|
| 76 |
+
test_cfg=dict(mode='slide', crop_size=(512, 512), stride=(341, 341)),
|
| 77 |
+
)
|
| 78 |
+
|
| 79 |
+
optimizer = dict(
|
| 80 |
+
lr=0.001,
|
| 81 |
+
weight_decay=0.0,
|
| 82 |
+
paramwise_cfg=dict(custom_keys={'head': dict(lr_mult=10.)}))
|
| 83 |
+
|
| 84 |
+
# num_gpus: 8 -> batch_size: 8
|
| 85 |
+
data = dict(samples_per_gpu=1)
|
EgoHOS/raw/script/mmsegmentation/configs/setr/setr_naive_512x512_160k_b16_ade20k.py
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/setr_naive.py', '../_base_/datasets/ade20k.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py'
|
| 4 |
+
]
|
| 5 |
+
norm_cfg = dict(type='SyncBN', requires_grad=True)
|
| 6 |
+
model = dict(
|
| 7 |
+
pretrained=None,
|
| 8 |
+
backbone=dict(
|
| 9 |
+
img_size=(512, 512),
|
| 10 |
+
drop_rate=0.,
|
| 11 |
+
init_cfg=dict(
|
| 12 |
+
type='Pretrained', checkpoint='pretrain/vit_large_p16.pth')),
|
| 13 |
+
decode_head=dict(num_classes=150),
|
| 14 |
+
auxiliary_head=[
|
| 15 |
+
dict(
|
| 16 |
+
type='SETRUPHead',
|
| 17 |
+
in_channels=1024,
|
| 18 |
+
channels=256,
|
| 19 |
+
in_index=0,
|
| 20 |
+
num_classes=150,
|
| 21 |
+
dropout_ratio=0,
|
| 22 |
+
norm_cfg=norm_cfg,
|
| 23 |
+
act_cfg=dict(type='ReLU'),
|
| 24 |
+
num_convs=2,
|
| 25 |
+
kernel_size=1,
|
| 26 |
+
align_corners=False,
|
| 27 |
+
loss_decode=dict(
|
| 28 |
+
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
|
| 29 |
+
dict(
|
| 30 |
+
type='SETRUPHead',
|
| 31 |
+
in_channels=1024,
|
| 32 |
+
channels=256,
|
| 33 |
+
in_index=1,
|
| 34 |
+
num_classes=150,
|
| 35 |
+
dropout_ratio=0,
|
| 36 |
+
norm_cfg=norm_cfg,
|
| 37 |
+
act_cfg=dict(type='ReLU'),
|
| 38 |
+
num_convs=2,
|
| 39 |
+
kernel_size=1,
|
| 40 |
+
align_corners=False,
|
| 41 |
+
loss_decode=dict(
|
| 42 |
+
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
|
| 43 |
+
dict(
|
| 44 |
+
type='SETRUPHead',
|
| 45 |
+
in_channels=1024,
|
| 46 |
+
channels=256,
|
| 47 |
+
in_index=2,
|
| 48 |
+
num_classes=150,
|
| 49 |
+
dropout_ratio=0,
|
| 50 |
+
norm_cfg=norm_cfg,
|
| 51 |
+
act_cfg=dict(type='ReLU'),
|
| 52 |
+
num_convs=2,
|
| 53 |
+
kernel_size=1,
|
| 54 |
+
align_corners=False,
|
| 55 |
+
loss_decode=dict(
|
| 56 |
+
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4))
|
| 57 |
+
],
|
| 58 |
+
test_cfg=dict(mode='slide', crop_size=(512, 512), stride=(341, 341)),
|
| 59 |
+
)
|
| 60 |
+
|
| 61 |
+
optimizer = dict(
|
| 62 |
+
lr=0.01,
|
| 63 |
+
weight_decay=0.0,
|
| 64 |
+
paramwise_cfg=dict(custom_keys={'head': dict(lr_mult=10.)}))
|
| 65 |
+
|
| 66 |
+
# num_gpus: 8 -> batch_size: 16
|
| 67 |
+
data = dict(samples_per_gpu=2)
|
EgoHOS/raw/script/mmsegmentation/configs/setr/setr_pup_512x512_160k_b16_ade20k.py
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/setr_pup.py', '../_base_/datasets/ade20k.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py'
|
| 4 |
+
]
|
| 5 |
+
norm_cfg = dict(type='SyncBN', requires_grad=True)
|
| 6 |
+
model = dict(
|
| 7 |
+
pretrained=None,
|
| 8 |
+
backbone=dict(
|
| 9 |
+
img_size=(512, 512),
|
| 10 |
+
drop_rate=0.,
|
| 11 |
+
init_cfg=dict(
|
| 12 |
+
type='Pretrained', checkpoint='pretrain/vit_large_p16.pth')),
|
| 13 |
+
decode_head=dict(num_classes=150),
|
| 14 |
+
auxiliary_head=[
|
| 15 |
+
dict(
|
| 16 |
+
type='SETRUPHead',
|
| 17 |
+
in_channels=1024,
|
| 18 |
+
channels=256,
|
| 19 |
+
in_index=0,
|
| 20 |
+
num_classes=150,
|
| 21 |
+
dropout_ratio=0,
|
| 22 |
+
norm_cfg=norm_cfg,
|
| 23 |
+
act_cfg=dict(type='ReLU'),
|
| 24 |
+
num_convs=2,
|
| 25 |
+
kernel_size=3,
|
| 26 |
+
align_corners=False,
|
| 27 |
+
loss_decode=dict(
|
| 28 |
+
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
|
| 29 |
+
dict(
|
| 30 |
+
type='SETRUPHead',
|
| 31 |
+
in_channels=1024,
|
| 32 |
+
channels=256,
|
| 33 |
+
in_index=1,
|
| 34 |
+
num_classes=150,
|
| 35 |
+
dropout_ratio=0,
|
| 36 |
+
norm_cfg=norm_cfg,
|
| 37 |
+
act_cfg=dict(type='ReLU'),
|
| 38 |
+
num_convs=2,
|
| 39 |
+
kernel_size=3,
|
| 40 |
+
align_corners=False,
|
| 41 |
+
loss_decode=dict(
|
| 42 |
+
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
|
| 43 |
+
dict(
|
| 44 |
+
type='SETRUPHead',
|
| 45 |
+
in_channels=1024,
|
| 46 |
+
channels=256,
|
| 47 |
+
in_index=2,
|
| 48 |
+
num_classes=150,
|
| 49 |
+
dropout_ratio=0,
|
| 50 |
+
norm_cfg=norm_cfg,
|
| 51 |
+
act_cfg=dict(type='ReLU'),
|
| 52 |
+
num_convs=2,
|
| 53 |
+
kernel_size=3,
|
| 54 |
+
align_corners=False,
|
| 55 |
+
loss_decode=dict(
|
| 56 |
+
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
|
| 57 |
+
],
|
| 58 |
+
test_cfg=dict(mode='slide', crop_size=(512, 512), stride=(341, 341)),
|
| 59 |
+
)
|
| 60 |
+
|
| 61 |
+
optimizer = dict(
|
| 62 |
+
lr=0.001,
|
| 63 |
+
weight_decay=0.0,
|
| 64 |
+
paramwise_cfg=dict(custom_keys={'head': dict(lr_mult=10.)}))
|
| 65 |
+
|
| 66 |
+
# num_gpus: 8 -> batch_size: 16
|
| 67 |
+
data = dict(samples_per_gpu=2)
|
EgoHOS/raw/script/mmsegmentation/configs/setr/setr_vit-large_mla_8x1_768x768_80k_cityscapes.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/setr_mla.py', '../_base_/datasets/cityscapes_768x768.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py'
|
| 4 |
+
]
|
| 5 |
+
model = dict(
|
| 6 |
+
pretrained=None,
|
| 7 |
+
backbone=dict(
|
| 8 |
+
drop_rate=0,
|
| 9 |
+
init_cfg=dict(
|
| 10 |
+
type='Pretrained', checkpoint='pretrain/vit_large_p16.pth')),
|
| 11 |
+
test_cfg=dict(mode='slide', crop_size=(768, 768), stride=(512, 512)))
|
| 12 |
+
|
| 13 |
+
optimizer = dict(
|
| 14 |
+
lr=0.002,
|
| 15 |
+
weight_decay=0.0,
|
| 16 |
+
paramwise_cfg=dict(custom_keys={'head': dict(lr_mult=10.)}))
|
| 17 |
+
data = dict(samples_per_gpu=1)
|
EgoHOS/raw/script/mmsegmentation/configs/setr/setr_vit-large_naive_8x1_768x768_80k_cityscapes.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/setr_naive.py',
|
| 3 |
+
'../_base_/datasets/cityscapes_768x768.py', '../_base_/default_runtime.py',
|
| 4 |
+
'../_base_/schedules/schedule_80k.py'
|
| 5 |
+
]
|
| 6 |
+
model = dict(
|
| 7 |
+
pretrained=None,
|
| 8 |
+
backbone=dict(
|
| 9 |
+
drop_rate=0.,
|
| 10 |
+
init_cfg=dict(
|
| 11 |
+
type='Pretrained', checkpoint='pretrain/vit_large_p16.pth')),
|
| 12 |
+
test_cfg=dict(mode='slide', crop_size=(768, 768), stride=(512, 512)))
|
| 13 |
+
|
| 14 |
+
optimizer = dict(
|
| 15 |
+
weight_decay=0.0,
|
| 16 |
+
paramwise_cfg=dict(custom_keys={'head': dict(lr_mult=10.)}))
|
| 17 |
+
|
| 18 |
+
data = dict(samples_per_gpu=1)
|
EgoHOS/raw/script/mmsegmentation/configs/setr/setr_vit-large_pup_8x1_768x768_80k_cityscapes.py
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/setr_pup.py', '../_base_/datasets/cityscapes_768x768.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py'
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
norm_cfg = dict(type='SyncBN', requires_grad=True)
|
| 7 |
+
crop_size = (768, 768)
|
| 8 |
+
model = dict(
|
| 9 |
+
pretrained=None,
|
| 10 |
+
backbone=dict(
|
| 11 |
+
drop_rate=0.,
|
| 12 |
+
init_cfg=dict(
|
| 13 |
+
type='Pretrained', checkpoint='pretrain/vit_large_p16.pth')),
|
| 14 |
+
auxiliary_head=[
|
| 15 |
+
dict(
|
| 16 |
+
type='SETRUPHead',
|
| 17 |
+
in_channels=1024,
|
| 18 |
+
channels=256,
|
| 19 |
+
in_index=0,
|
| 20 |
+
num_classes=19,
|
| 21 |
+
dropout_ratio=0,
|
| 22 |
+
norm_cfg=norm_cfg,
|
| 23 |
+
num_convs=2,
|
| 24 |
+
up_scale=4,
|
| 25 |
+
kernel_size=3,
|
| 26 |
+
align_corners=False,
|
| 27 |
+
loss_decode=dict(
|
| 28 |
+
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
|
| 29 |
+
dict(
|
| 30 |
+
type='SETRUPHead',
|
| 31 |
+
in_channels=1024,
|
| 32 |
+
channels=256,
|
| 33 |
+
in_index=1,
|
| 34 |
+
num_classes=19,
|
| 35 |
+
dropout_ratio=0,
|
| 36 |
+
norm_cfg=norm_cfg,
|
| 37 |
+
num_convs=2,
|
| 38 |
+
up_scale=4,
|
| 39 |
+
kernel_size=3,
|
| 40 |
+
align_corners=False,
|
| 41 |
+
loss_decode=dict(
|
| 42 |
+
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
|
| 43 |
+
dict(
|
| 44 |
+
type='SETRUPHead',
|
| 45 |
+
in_channels=1024,
|
| 46 |
+
channels=256,
|
| 47 |
+
in_index=2,
|
| 48 |
+
num_classes=19,
|
| 49 |
+
dropout_ratio=0,
|
| 50 |
+
norm_cfg=norm_cfg,
|
| 51 |
+
num_convs=2,
|
| 52 |
+
up_scale=4,
|
| 53 |
+
kernel_size=3,
|
| 54 |
+
align_corners=False,
|
| 55 |
+
loss_decode=dict(
|
| 56 |
+
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4))
|
| 57 |
+
],
|
| 58 |
+
test_cfg=dict(mode='slide', crop_size=crop_size, stride=(512, 512)))
|
| 59 |
+
|
| 60 |
+
optimizer = dict(
|
| 61 |
+
weight_decay=0.0,
|
| 62 |
+
paramwise_cfg=dict(custom_keys={'head': dict(lr_mult=10.)}))
|
| 63 |
+
|
| 64 |
+
data = dict(samples_per_gpu=1)
|
EgoHOS/raw/script/mmsegmentation/configs/stdc/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# STDC
|
| 2 |
+
|
| 3 |
+
[Rethinking BiSeNet For Real-time Semantic Segmentation](https://arxiv.org/abs/2104.13188)
|
| 4 |
+
|
| 5 |
+
## Introduction
|
| 6 |
+
|
| 7 |
+
<!-- [ALGORITHM] -->
|
| 8 |
+
|
| 9 |
+
<a href="https://github.com/MichaelFan01/STDC-Seg">Official Repo</a>
|
| 10 |
+
|
| 11 |
+
<a href="https://github.com/open-mmlab/mmsegmentation/blob/v0.20.0/mmseg/models/backbones/stdc.py#L394">Code Snippet</a>
|
| 12 |
+
|
| 13 |
+
## Abstract
|
| 14 |
+
|
| 15 |
+
<!-- [ABSTRACT] -->
|
| 16 |
+
|
| 17 |
+
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.
|
| 18 |
+
|
| 19 |
+
<!-- [IMAGE] -->
|
| 20 |
+
<div align=center>
|
| 21 |
+
<img src="https://user-images.githubusercontent.com/24582831/143640374-d0709587-edb2-4821-bb60-340035f6ad8f.png" width="60%"/>
|
| 22 |
+
</div>
|
| 23 |
+
|
| 24 |
+
## Citation
|
| 25 |
+
|
| 26 |
+
```bibtex
|
| 27 |
+
@inproceedings{fan2021rethinking,
|
| 28 |
+
title={Rethinking BiSeNet For Real-time Semantic Segmentation},
|
| 29 |
+
author={Fan, Mingyuan and Lai, Shenqi and Huang, Junshi and Wei, Xiaoming and Chai, Zhenhua and Luo, Junfeng and Wei, Xiaolin},
|
| 30 |
+
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
|
| 31 |
+
pages={9716--9725},
|
| 32 |
+
year={2021}
|
| 33 |
+
}
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
## Usage
|
| 37 |
+
|
| 38 |
+
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).
|
| 39 |
+
|
| 40 |
+
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.
|
| 41 |
+
|
| 42 |
+
```shell
|
| 43 |
+
python tools/model_converters/stdc2mmseg.py ${PRETRAIN_PATH} ${STORE_PATH} ${STDC_TYPE}
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
E.g.
|
| 47 |
+
|
| 48 |
+
```shell
|
| 49 |
+
python tools/model_converters/stdc2mmseg.py ./STDCNet813M_73.91.tar ./pretrained/stdc1.pth STDC1
|
| 50 |
+
|
| 51 |
+
python tools/model_converters/stdc2mmseg.py ./STDCNet1446_76.47.tar ./pretrained/stdc2.pth STDC2
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
This script convert model from `PRETRAIN_PATH` and store the converted model in `STORE_PATH`.
|
| 55 |
+
|
| 56 |
+
## Results and models
|
| 57 |
+
|
| 58 |
+
### Cityscapes
|
| 59 |
+
|
| 60 |
+
| Method | Backbone | Crop Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | config | download |
|
| 61 |
+
| --------- | --------- | --------- | ------: | -------- | -------------- | ----: | ------------- | --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| 62 |
+
| STDC 1 (No Pretrain) | STDC1 | 512x1024 | 80000 | 7.15 | 23.06 | 71.82 | 73.89 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/stdc/stdc1_512x1024_80k_cityscapes.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) |
|
| 63 |
+
| STDC 1| STDC1 | 512x1024 | 80000 | - | - | 74.94 | 76.97 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/stdc/stdc1_in1k-pre_512x1024_80k_cityscapes.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) |
|
| 64 |
+
| STDC 2 (No Pretrain) | STDC2 | 512x1024 | 80000 | 8.27 | 23.71 | 73.15 | 76.13 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/stdc/stdc2_512x1024_80k_cityscapes.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) |
|
| 65 |
+
| STDC 2 | STDC2 | 512x1024 | 80000 | - | - | 76.67 | 78.67 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/stdc/stdc2_in1k-pre_512x1024_80k_cityscapes.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) |
|
| 66 |
+
|
| 67 |
+
Note:
|
| 68 |
+
|
| 69 |
+
- For STDC on Cityscapes dataset, default setting is 4 GPUs with 12 samples per GPU in training.
|
| 70 |
+
- `No Pretrain` means the model is trained from scratch.
|
| 71 |
+
- 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.
|
| 72 |
+
- 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.
|
EgoHOS/raw/script/mmsegmentation/configs/stdc/stdc.yml
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Collections:
|
| 2 |
+
- Name: STDC
|
| 3 |
+
Metadata:
|
| 4 |
+
Training Data:
|
| 5 |
+
- Cityscapes
|
| 6 |
+
Paper:
|
| 7 |
+
URL: https://arxiv.org/abs/2104.13188
|
| 8 |
+
Title: Rethinking BiSeNet For Real-time Semantic Segmentation
|
| 9 |
+
README: configs/stdc/README.md
|
| 10 |
+
Code:
|
| 11 |
+
URL: https://github.com/open-mmlab/mmsegmentation/blob/v0.20.0/mmseg/models/backbones/stdc.py#L394
|
| 12 |
+
Version: v0.20.0
|
| 13 |
+
Converted From:
|
| 14 |
+
Code: https://github.com/MichaelFan01/STDC-Seg
|
| 15 |
+
Models:
|
| 16 |
+
- Name: stdc1_512x1024_80k_cityscapes
|
| 17 |
+
In Collection: STDC
|
| 18 |
+
Metadata:
|
| 19 |
+
backbone: STDC1
|
| 20 |
+
crop size: (512,1024)
|
| 21 |
+
lr schd: 80000
|
| 22 |
+
inference time (ms/im):
|
| 23 |
+
- value: 43.37
|
| 24 |
+
hardware: V100
|
| 25 |
+
backend: PyTorch
|
| 26 |
+
batch size: 1
|
| 27 |
+
mode: FP32
|
| 28 |
+
resolution: (512,1024)
|
| 29 |
+
Training Memory (GB): 7.15
|
| 30 |
+
Results:
|
| 31 |
+
- Task: Semantic Segmentation
|
| 32 |
+
Dataset: Cityscapes
|
| 33 |
+
Metrics:
|
| 34 |
+
mIoU: 71.82
|
| 35 |
+
mIoU(ms+flip): 73.89
|
| 36 |
+
Config: configs/stdc/stdc1_512x1024_80k_cityscapes.py
|
| 37 |
+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/stdc/stdc1_512x1024_80k_cityscapes/stdc1_512x1024_80k_cityscapes_20220224_073048-74e6920a.pth
|
| 38 |
+
- Name: stdc1_in1k-pre_512x1024_80k_cityscapes
|
| 39 |
+
In Collection: STDC
|
| 40 |
+
Metadata:
|
| 41 |
+
backbone: STDC1
|
| 42 |
+
crop size: (512,1024)
|
| 43 |
+
lr schd: 80000
|
| 44 |
+
Results:
|
| 45 |
+
- Task: Semantic Segmentation
|
| 46 |
+
Dataset: Cityscapes
|
| 47 |
+
Metrics:
|
| 48 |
+
mIoU: 74.94
|
| 49 |
+
mIoU(ms+flip): 76.97
|
| 50 |
+
Config: configs/stdc/stdc1_in1k-pre_512x1024_80k_cityscapes.py
|
| 51 |
+
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
|
| 52 |
+
- Name: stdc2_512x1024_80k_cityscapes
|
| 53 |
+
In Collection: STDC
|
| 54 |
+
Metadata:
|
| 55 |
+
backbone: STDC2
|
| 56 |
+
crop size: (512,1024)
|
| 57 |
+
lr schd: 80000
|
| 58 |
+
inference time (ms/im):
|
| 59 |
+
- value: 42.18
|
| 60 |
+
hardware: V100
|
| 61 |
+
backend: PyTorch
|
| 62 |
+
batch size: 1
|
| 63 |
+
mode: FP32
|
| 64 |
+
resolution: (512,1024)
|
| 65 |
+
Training Memory (GB): 8.27
|
| 66 |
+
Results:
|
| 67 |
+
- Task: Semantic Segmentation
|
| 68 |
+
Dataset: Cityscapes
|
| 69 |
+
Metrics:
|
| 70 |
+
mIoU: 73.15
|
| 71 |
+
mIoU(ms+flip): 76.13
|
| 72 |
+
Config: configs/stdc/stdc2_512x1024_80k_cityscapes.py
|
| 73 |
+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/stdc/stdc2_512x1024_80k_cityscapes/stdc2_512x1024_80k_cityscapes_20220222_132015-fb1e3a1a.pth
|
| 74 |
+
- Name: stdc2_in1k-pre_512x1024_80k_cityscapes
|
| 75 |
+
In Collection: STDC
|
| 76 |
+
Metadata:
|
| 77 |
+
backbone: STDC2
|
| 78 |
+
crop size: (512,1024)
|
| 79 |
+
lr schd: 80000
|
| 80 |
+
Results:
|
| 81 |
+
- Task: Semantic Segmentation
|
| 82 |
+
Dataset: Cityscapes
|
| 83 |
+
Metrics:
|
| 84 |
+
mIoU: 76.67
|
| 85 |
+
mIoU(ms+flip): 78.67
|
| 86 |
+
Config: configs/stdc/stdc2_in1k-pre_512x1024_80k_cityscapes.py
|
| 87 |
+
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
|
EgoHOS/raw/script/mmsegmentation/configs/stdc/stdc1_512x1024_80k_cityscapes.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/stdc.py', '../_base_/datasets/cityscapes.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py'
|
| 4 |
+
]
|
| 5 |
+
lr_config = dict(warmup='linear', warmup_iters=1000)
|
| 6 |
+
data = dict(
|
| 7 |
+
samples_per_gpu=12,
|
| 8 |
+
workers_per_gpu=4,
|
| 9 |
+
)
|
EgoHOS/raw/script/mmsegmentation/configs/stdc/stdc1_in1k-pre_512x1024_80k_cityscapes.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
checkpoint = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/stdc/stdc1_20220308-5368626c.pth' # noqa
|
| 2 |
+
_base_ = './stdc1_512x1024_80k_cityscapes.py'
|
| 3 |
+
model = dict(
|
| 4 |
+
backbone=dict(
|
| 5 |
+
backbone_cfg=dict(
|
| 6 |
+
init_cfg=dict(type='Pretrained', checkpoint=checkpoint))))
|
EgoHOS/raw/script/mmsegmentation/configs/stdc/stdc2_512x1024_80k_cityscapes.py
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = './stdc1_512x1024_80k_cityscapes.py'
|
| 2 |
+
model = dict(backbone=dict(backbone_cfg=dict(stdc_type='STDCNet2')))
|
EgoHOS/raw/script/mmsegmentation/configs/stdc/stdc2_in1k-pre_512x1024_80k_cityscapes.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
checkpoint = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/stdc/stdc2_20220308-7dbd9127.pth' # noqa
|
| 2 |
+
_base_ = './stdc2_512x1024_80k_cityscapes.py'
|
| 3 |
+
model = dict(
|
| 4 |
+
backbone=dict(
|
| 5 |
+
backbone_cfg=dict(
|
| 6 |
+
init_cfg=dict(type='Pretrained', checkpoint=checkpoint))))
|
EgoHOS/raw/script/mmsegmentation/configs/swin/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Swin Transformer
|
| 2 |
+
|
| 3 |
+
[Swin Transformer: Hierarchical Vision Transformer using Shifted Windows](https://arxiv.org/abs/2103.14030)
|
| 4 |
+
|
| 5 |
+
## Introduction
|
| 6 |
+
|
| 7 |
+
<!-- [BACKBONE] -->
|
| 8 |
+
|
| 9 |
+
<a href="https://github.com/microsoft/Swin-Transformer">Official Repo</a>
|
| 10 |
+
|
| 11 |
+
<a href="https://github.com/open-mmlab/mmsegmentation/blob/v0.17.0/mmseg/models/backbones/swin.py#L524">Code Snippet</a>
|
| 12 |
+
|
| 13 |
+
## Abstract
|
| 14 |
+
|
| 15 |
+
<!-- [ABSTRACT] -->
|
| 16 |
+
|
| 17 |
+
This paper presents a new vision Transformer, called Swin Transformer, that capably serves as a general-purpose backbone for computer vision. Challenges in adapting Transformer from language to vision arise from differences between the two domains, such as large variations in the scale of visual entities and the high resolution of pixels in images compared to words in text. To address these differences, we propose a hierarchical Transformer whose representation is computed with Shifted windows. The shifted windowing scheme brings greater efficiency by limiting self-attention computation to non-overlapping local windows while also allowing for cross-window connection. This hierarchical architecture has the flexibility to model at various scales and has linear computational complexity with respect to image size. These qualities of Swin Transformer make it compatible with a broad range of vision tasks, including image classification (87.3 top-1 accuracy on ImageNet-1K) and dense prediction tasks such as object detection (58.7 box AP and 51.1 mask AP on COCO test-dev) and semantic segmentation (53.5 mIoU on ADE20K val). Its performance surpasses the previous state-of-the-art by a large margin of +2.7 box AP and +2.6 mask AP on COCO, and +3.2 mIoU on ADE20K, demonstrating the potential of Transformer-based models as vision backbones. The hierarchical design and the shifted window approach also prove beneficial for all-MLP architectures. The code and models are publicly available at [this https URL](https://github.com/microsoft/Swin-Transformer).
|
| 18 |
+
|
| 19 |
+
<!-- [IMAGE] -->
|
| 20 |
+
<div align=center>
|
| 21 |
+
<img src="https://user-images.githubusercontent.com/24582831/142902882-3fb9014c-11b6-47e9-aa14-500dfe7cbb1c.png" width="80%"/>
|
| 22 |
+
</div>
|
| 23 |
+
|
| 24 |
+
## Citation
|
| 25 |
+
|
| 26 |
+
```bibtex
|
| 27 |
+
@article{liu2021Swin,
|
| 28 |
+
title={Swin Transformer: Hierarchical Vision Transformer using Shifted Windows},
|
| 29 |
+
author={Liu, Ze and Lin, Yutong and Cao, Yue and Hu, Han and Wei, Yixuan and Zhang, Zheng and Lin, Stephen and Guo, Baining},
|
| 30 |
+
journal={arXiv preprint arXiv:2103.14030},
|
| 31 |
+
year={2021}
|
| 32 |
+
}
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
## Usage
|
| 36 |
+
|
| 37 |
+
We have provided pretrained models converted from [official repo](https://github.com/microsoft/Swin-Transformer).
|
| 38 |
+
|
| 39 |
+
If you want to convert keys on your own to use official repositories' pre-trained models, we also provide a script [`swin2mmseg.py`](../../tools/model_converters/swin2mmseg.py) in the tools directory to convert the key of models from [the official repo](https://github.com/SwinTransformer/Swin-Transformer-Semantic-Segmentation) to MMSegmentation style.
|
| 40 |
+
|
| 41 |
+
```shell
|
| 42 |
+
python tools/model_converters/swin2mmseg.py ${PRETRAIN_PATH} ${STORE_PATH}
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
E.g.
|
| 46 |
+
|
| 47 |
+
```shell
|
| 48 |
+
python tools/model_converters/swin2mmseg.py https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_base_patch4_window7_224.pth pretrain/swin_base_patch4_window7_224.pth
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
This script convert model from `PRETRAIN_PATH` and store the converted model in `STORE_PATH`.
|
| 52 |
+
|
| 53 |
+
In our default setting, pretrained models and their corresponding [original models](https://github.com/microsoft/Swin-Transforme) models could be defined below:
|
| 54 |
+
|
| 55 |
+
| pretrained models | original models |
|
| 56 |
+
| ------ | -------- |
|
| 57 |
+
|pretrain/swin_tiny_patch4_window7_224.pth | [swin_tiny_patch4_window7_224.pth](https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_tiny_patch4_window7_224.pth) |
|
| 58 |
+
|pretrain/swin_small_patch4_window7_224.pth | [swin_small_patch4_window7_224.pth](https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_small_patch4_window7_224.pth) |
|
| 59 |
+
|pretrain/swin_base_patch4_window7_224.pth | [swin_base_patch4_window7_224.pth](https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_base_patch4_window7_224.pth) |
|
| 60 |
+
|pretrain/swin_base_patch4_window7_224_22k.pth | [swin_base_patch4_window7_224_22k.pth](https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_base_patch4_window7_224_22k.pth) |
|
| 61 |
+
|pretrain/swin_base_patch4_window12_384.pth | [swin_base_patch4_window12_384.pth](https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_base_patch4_window12_384.pth) |
|
| 62 |
+
|pretrain/swin_base_patch4_window12_384_22k.pth | [swin_base_patch4_window12_384_22k.pth](https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_base_patch4_window12_384_22k.pth) |
|
| 63 |
+
|
| 64 |
+
## Results and models
|
| 65 |
+
|
| 66 |
+
### ADE20K
|
| 67 |
+
|
| 68 |
+
| Method | Backbone | Crop Size | pretrain | pretrain img size | Batch Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | config | download |
|
| 69 |
+
| ------ | -------- | --------- | ---------- | ------- | -------- | --- | --- | -------------- | ----- | ------------: | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
| 70 |
+
| UperNet | Swin-T | 512x512 | ImageNet-1K | 224x224 | 16 | 160000 | 5.02 | 21.06 | 44.41 | 45.79 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/swin/upernet_swin_tiny_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/swin/upernet_swin_tiny_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K/upernet_swin_tiny_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K_20210531_112542-e380ad3e.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/swin/upernet_swin_tiny_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K/upernet_swin_tiny_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K_20210531_112542.log.json) |
|
| 71 |
+
| UperNet | Swin-S | 512x512 | ImageNet-1K | 224x224 | 16 | 160000 | 6.17 | 14.72 | 47.72 | 49.24 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/swin/upernet_swin_small_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/swin/upernet_swin_small_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K/upernet_swin_small_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K_20210526_192015-ee2fff1c.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/swin/upernet_swin_small_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K/upernet_swin_small_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K_20210526_192015.log.json) |
|
| 72 |
+
| UperNet | Swin-B | 512x512 | ImageNet-1K | 224x224 | 16 | 160000 | 7.61 | 12.65 | 47.99 | 49.57 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/swin/upernet_swin_base_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/swin/upernet_swin_base_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K/upernet_swin_base_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K_20210526_192340-593b0e13.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/swin/upernet_swin_base_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K/upernet_swin_base_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K_20210526_192340.log.json) |
|
| 73 |
+
| UperNet | Swin-B | 512x512 | ImageNet-22K | 224x224 | 16 | 160000 | - | - | 50.31 | 51.9 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/swin/upernet_swin_base_patch4_window7_512x512_160k_ade20k_pretrain_224x224_22K.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/swin/upernet_swin_base_patch4_window7_512x512_160k_ade20k_pretrain_224x224_22K/upernet_swin_base_patch4_window7_512x512_160k_ade20k_pretrain_224x224_22K_20210526_211650-762e2178.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/swin/upernet_swin_base_patch4_window7_512x512_160k_ade20k_pretrain_224x224_22K/upernet_swin_base_patch4_window7_512x512_160k_ade20k_pretrain_224x224_22K_20210526_211650.log.json) |
|
| 74 |
+
| UperNet | Swin-B | 512x512 | ImageNet-1K | 384x384 | 16 | 160000 | 8.52 | 12.10 | 48.35 | 49.65 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/swin/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_1K.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/swin/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_1K/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_1K_20210531_132020-05b22ea4.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/swin/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_1K/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_1K_20210531_132020.log.json) |
|
| 75 |
+
| UperNet | Swin-B | 512x512 | ImageNet-22K | 384x384 | 16 | 160000 | - | - | 50.76 | 52.4 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/swin/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/swin/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K_20210531_125459-429057bf.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/swin/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K_20210531_125459.log.json) |
|
EgoHOS/raw/script/mmsegmentation/configs/swin/seg_handobj1.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/upernet_swin.py', '../_base_/datasets/egohos_handobj1.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py'
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
checkpoint_file = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/swin/swin_base_patch4_window12_384_22k_20220317-e5c09f74.pth' # noqa
|
| 7 |
+
|
| 8 |
+
model = dict(
|
| 9 |
+
pretrained = './pretrain/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K_20210531_125459-429057bf.pth',
|
| 10 |
+
backbone=dict(
|
| 11 |
+
# init_cfg=dict(type='Pretrained', checkpoint=checkpoint_file),
|
| 12 |
+
pretrain_img_size=384,
|
| 13 |
+
embed_dims=128,
|
| 14 |
+
depths=[2, 2, 18, 2],
|
| 15 |
+
num_heads=[4, 8, 16, 32],
|
| 16 |
+
window_size=12),
|
| 17 |
+
decode_head=dict(in_channels=[128, 256, 512, 1024], num_classes=6),
|
| 18 |
+
auxiliary_head=dict(in_channels=512, num_classes=6))
|
| 19 |
+
|
| 20 |
+
train_pipeline = [dict(type='LoadAnnotations', reduce_zero_label=False)]
|
| 21 |
+
|
| 22 |
+
# AdamW optimizer, no weight decay for position embedding & layer norm
|
| 23 |
+
# in backbone
|
| 24 |
+
optimizer = dict(
|
| 25 |
+
_delete_=True,
|
| 26 |
+
type='AdamW',
|
| 27 |
+
lr=0.00006,
|
| 28 |
+
betas=(0.9, 0.999),
|
| 29 |
+
weight_decay=0.01,
|
| 30 |
+
paramwise_cfg=dict(
|
| 31 |
+
custom_keys={
|
| 32 |
+
'absolute_pos_embed': dict(decay_mult=0.),
|
| 33 |
+
'relative_position_bias_table': dict(decay_mult=0.),
|
| 34 |
+
'norm': dict(decay_mult=0.)
|
| 35 |
+
}))
|
| 36 |
+
|
| 37 |
+
lr_config = dict(
|
| 38 |
+
_delete_=True,
|
| 39 |
+
policy='poly',
|
| 40 |
+
warmup='linear',
|
| 41 |
+
warmup_iters=1500,
|
| 42 |
+
warmup_ratio=1e-6,
|
| 43 |
+
power=1.0,
|
| 44 |
+
min_lr=0.0,
|
| 45 |
+
by_epoch=False)
|
| 46 |
+
|
| 47 |
+
# By default, models are trained on 8 GPUs with 2 images per GPU
|
| 48 |
+
data = dict(samples_per_gpu=8)
|
| 49 |
+
|
| 50 |
+
checkpoint_config = dict(by_epoch=False, interval=2000)
|
| 51 |
+
evaluation = dict(interval=2000, metric=['mIoU', 'mFscore'], pred_eval=True, save_best='mIoU')
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
|
EgoHOS/raw/script/mmsegmentation/configs/swin/seg_handobj1_ccda.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/upernet_swin.py', '../_base_/datasets/egohos_handobj1_ccda.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py'
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
checkpoint_file = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/swin/swin_base_patch4_window12_384_22k_20220317-e5c09f74.pth' # noqa
|
| 7 |
+
|
| 8 |
+
model = dict(
|
| 9 |
+
pretrained = './pretrain/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K_20210531_125459-429057bf.pth',
|
| 10 |
+
backbone=dict(
|
| 11 |
+
# init_cfg=dict(type='Pretrained', checkpoint=checkpoint_file),
|
| 12 |
+
pretrain_img_size=384,
|
| 13 |
+
embed_dims=128,
|
| 14 |
+
depths=[2, 2, 18, 2],
|
| 15 |
+
num_heads=[4, 8, 16, 32],
|
| 16 |
+
window_size=12),
|
| 17 |
+
decode_head=dict(in_channels=[128, 256, 512, 1024], num_classes=6),
|
| 18 |
+
auxiliary_head=dict(in_channels=512, num_classes=6))
|
| 19 |
+
|
| 20 |
+
train_pipeline = [dict(type='LoadAnnotations', reduce_zero_label=False)]
|
| 21 |
+
|
| 22 |
+
# AdamW optimizer, no weight decay for position embedding & layer norm
|
| 23 |
+
# in backbone
|
| 24 |
+
optimizer = dict(
|
| 25 |
+
_delete_=True,
|
| 26 |
+
type='AdamW',
|
| 27 |
+
lr=0.00006,
|
| 28 |
+
betas=(0.9, 0.999),
|
| 29 |
+
weight_decay=0.01,
|
| 30 |
+
paramwise_cfg=dict(
|
| 31 |
+
custom_keys={
|
| 32 |
+
'absolute_pos_embed': dict(decay_mult=0.),
|
| 33 |
+
'relative_position_bias_table': dict(decay_mult=0.),
|
| 34 |
+
'norm': dict(decay_mult=0.)
|
| 35 |
+
}))
|
| 36 |
+
|
| 37 |
+
lr_config = dict(
|
| 38 |
+
_delete_=True,
|
| 39 |
+
policy='poly',
|
| 40 |
+
warmup='linear',
|
| 41 |
+
warmup_iters=1500,
|
| 42 |
+
warmup_ratio=1e-6,
|
| 43 |
+
power=1.0,
|
| 44 |
+
min_lr=0.0,
|
| 45 |
+
by_epoch=False)
|
| 46 |
+
|
| 47 |
+
# By default, models are trained on 8 GPUs with 2 images per GPU
|
| 48 |
+
data = dict(samples_per_gpu=8)
|
| 49 |
+
|
| 50 |
+
checkpoint_config = dict(by_epoch=False, interval=2000)
|
| 51 |
+
evaluation = dict(interval=2000, metric=['mIoU', 'mFscore'], pred_eval=True, save_best='mIoU')
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
|
EgoHOS/raw/script/mmsegmentation/configs/swin/seg_handobj2.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/upernet_swin.py', '../_base_/datasets/egohos_handobj2.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py'
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
checkpoint_file = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/swin/swin_base_patch4_window12_384_22k_20220317-e5c09f74.pth' # noqa
|
| 7 |
+
|
| 8 |
+
model = dict(
|
| 9 |
+
pretrained = './pretrain/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K_20210531_125459-429057bf.pth',
|
| 10 |
+
backbone=dict(
|
| 11 |
+
# init_cfg=dict(type='Pretrained', checkpoint=checkpoint_file),
|
| 12 |
+
pretrain_img_size=384,
|
| 13 |
+
embed_dims=128,
|
| 14 |
+
depths=[2, 2, 18, 2],
|
| 15 |
+
num_heads=[4, 8, 16, 32],
|
| 16 |
+
window_size=12),
|
| 17 |
+
decode_head=dict(in_channels=[128, 256, 512, 1024], num_classes=9),
|
| 18 |
+
auxiliary_head=dict(in_channels=512, num_classes=9))
|
| 19 |
+
|
| 20 |
+
train_pipeline = [dict(type='LoadAnnotations', reduce_zero_label=False)]
|
| 21 |
+
|
| 22 |
+
# AdamW optimizer, no weight decay for position embedding & layer norm
|
| 23 |
+
# in backbone
|
| 24 |
+
optimizer = dict(
|
| 25 |
+
_delete_=True,
|
| 26 |
+
type='AdamW',
|
| 27 |
+
lr=0.00006,
|
| 28 |
+
betas=(0.9, 0.999),
|
| 29 |
+
weight_decay=0.01,
|
| 30 |
+
paramwise_cfg=dict(
|
| 31 |
+
custom_keys={
|
| 32 |
+
'absolute_pos_embed': dict(decay_mult=0.),
|
| 33 |
+
'relative_position_bias_table': dict(decay_mult=0.),
|
| 34 |
+
'norm': dict(decay_mult=0.)
|
| 35 |
+
}))
|
| 36 |
+
|
| 37 |
+
lr_config = dict(
|
| 38 |
+
_delete_=True,
|
| 39 |
+
policy='poly',
|
| 40 |
+
warmup='linear',
|
| 41 |
+
warmup_iters=1500,
|
| 42 |
+
warmup_ratio=1e-6,
|
| 43 |
+
power=1.0,
|
| 44 |
+
min_lr=0.0,
|
| 45 |
+
by_epoch=False)
|
| 46 |
+
|
| 47 |
+
# By default, models are trained on 8 GPUs with 2 images per GPU
|
| 48 |
+
data = dict(samples_per_gpu=8)
|
| 49 |
+
|
| 50 |
+
checkpoint_config = dict(by_epoch=False, interval=2000)
|
| 51 |
+
evaluation = dict(interval=2000, metric=['mIoU', 'mFscore'], pred_eval=True, save_best='mIoU')
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
|
EgoHOS/raw/script/mmsegmentation/configs/swin/seg_handobj2_512.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/upernet_swin.py', '../_base_/datasets/egohos_handobj2_512.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py'
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
checkpoint_file = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/swin/swin_base_patch4_window12_384_22k_20220317-e5c09f74.pth' # noqa
|
| 7 |
+
|
| 8 |
+
model = dict(
|
| 9 |
+
pretrained = './pretrain/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K_20210531_125459-429057bf.pth',
|
| 10 |
+
backbone=dict(
|
| 11 |
+
# init_cfg=dict(type='Pretrained', checkpoint=checkpoint_file),
|
| 12 |
+
pretrain_img_size=384,
|
| 13 |
+
embed_dims=128,
|
| 14 |
+
depths=[2, 2, 18, 2],
|
| 15 |
+
num_heads=[4, 8, 16, 32],
|
| 16 |
+
window_size=12),
|
| 17 |
+
decode_head=dict(in_channels=[128, 256, 512, 1024], num_classes=9),
|
| 18 |
+
auxiliary_head=dict(in_channels=512, num_classes=9))
|
| 19 |
+
|
| 20 |
+
train_pipeline = [dict(type='LoadAnnotations', reduce_zero_label=False)]
|
| 21 |
+
|
| 22 |
+
# AdamW optimizer, no weight decay for position embedding & layer norm
|
| 23 |
+
# in backbone
|
| 24 |
+
optimizer = dict(
|
| 25 |
+
_delete_=True,
|
| 26 |
+
type='AdamW',
|
| 27 |
+
lr=0.00006,
|
| 28 |
+
betas=(0.9, 0.999),
|
| 29 |
+
weight_decay=0.01,
|
| 30 |
+
paramwise_cfg=dict(
|
| 31 |
+
custom_keys={
|
| 32 |
+
'absolute_pos_embed': dict(decay_mult=0.),
|
| 33 |
+
'relative_position_bias_table': dict(decay_mult=0.),
|
| 34 |
+
'norm': dict(decay_mult=0.)
|
| 35 |
+
}))
|
| 36 |
+
|
| 37 |
+
lr_config = dict(
|
| 38 |
+
_delete_=True,
|
| 39 |
+
policy='poly',
|
| 40 |
+
warmup='linear',
|
| 41 |
+
warmup_iters=1500,
|
| 42 |
+
warmup_ratio=1e-6,
|
| 43 |
+
power=1.0,
|
| 44 |
+
min_lr=0.0,
|
| 45 |
+
by_epoch=False)
|
| 46 |
+
|
| 47 |
+
# By default, models are trained on 8 GPUs with 2 images per GPU
|
| 48 |
+
data = dict(samples_per_gpu=8)
|
| 49 |
+
|
| 50 |
+
checkpoint_config = dict(by_epoch=False, interval=2000)
|
| 51 |
+
evaluation = dict(interval=2000, metric=['mIoU', 'mFscore'], pred_eval=True, save_best='mIoU')
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
|
EgoHOS/raw/script/mmsegmentation/configs/swin/seg_handobj2_ccda.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/upernet_swin.py', '../_base_/datasets/egohos_handobj2_ccda.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py'
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
checkpoint_file = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/swin/swin_base_patch4_window12_384_22k_20220317-e5c09f74.pth' # noqa
|
| 7 |
+
|
| 8 |
+
model = dict(
|
| 9 |
+
pretrained = './pretrain/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K_20210531_125459-429057bf.pth',
|
| 10 |
+
backbone=dict(
|
| 11 |
+
# init_cfg=dict(type='Pretrained', checkpoint=checkpoint_file),
|
| 12 |
+
pretrain_img_size=384,
|
| 13 |
+
embed_dims=128,
|
| 14 |
+
depths=[2, 2, 18, 2],
|
| 15 |
+
num_heads=[4, 8, 16, 32],
|
| 16 |
+
window_size=12),
|
| 17 |
+
decode_head=dict(in_channels=[128, 256, 512, 1024], num_classes=9),
|
| 18 |
+
auxiliary_head=dict(in_channels=512, num_classes=9))
|
| 19 |
+
|
| 20 |
+
train_pipeline = [dict(type='LoadAnnotations', reduce_zero_label=False)]
|
| 21 |
+
|
| 22 |
+
# AdamW optimizer, no weight decay for position embedding & layer norm
|
| 23 |
+
# in backbone
|
| 24 |
+
optimizer = dict(
|
| 25 |
+
_delete_=True,
|
| 26 |
+
type='AdamW',
|
| 27 |
+
lr=0.00006,
|
| 28 |
+
betas=(0.9, 0.999),
|
| 29 |
+
weight_decay=0.01,
|
| 30 |
+
paramwise_cfg=dict(
|
| 31 |
+
custom_keys={
|
| 32 |
+
'absolute_pos_embed': dict(decay_mult=0.),
|
| 33 |
+
'relative_position_bias_table': dict(decay_mult=0.),
|
| 34 |
+
'norm': dict(decay_mult=0.)
|
| 35 |
+
}))
|
| 36 |
+
|
| 37 |
+
lr_config = dict(
|
| 38 |
+
_delete_=True,
|
| 39 |
+
policy='poly',
|
| 40 |
+
warmup='linear',
|
| 41 |
+
warmup_iters=1500,
|
| 42 |
+
warmup_ratio=1e-6,
|
| 43 |
+
power=1.0,
|
| 44 |
+
min_lr=0.0,
|
| 45 |
+
by_epoch=False)
|
| 46 |
+
|
| 47 |
+
# By default, models are trained on 8 GPUs with 2 images per GPU
|
| 48 |
+
data = dict(samples_per_gpu=8)
|
| 49 |
+
|
| 50 |
+
checkpoint_config = dict(by_epoch=False, interval=2000)
|
| 51 |
+
evaluation = dict(interval=2000, metric=['mIoU', 'mFscore'], pred_eval=True, save_best='mIoU')
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
|
EgoHOS/raw/script/mmsegmentation/configs/swin/seg_twohands.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/upernet_swin.py', '../_base_/datasets/egohos_twohands.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py'
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
checkpoint_file = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/swin/swin_base_patch4_window12_384_22k_20220317-e5c09f74.pth' # noqa
|
| 7 |
+
|
| 8 |
+
model = dict(
|
| 9 |
+
pretrained = './pretrain/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K_20210531_125459-429057bf.pth',
|
| 10 |
+
backbone=dict(
|
| 11 |
+
# init_cfg=dict(type='Pretrained', checkpoint=checkpoint_file),
|
| 12 |
+
pretrain_img_size=384,
|
| 13 |
+
embed_dims=128,
|
| 14 |
+
depths=[2, 2, 18, 2],
|
| 15 |
+
num_heads=[4, 8, 16, 32],
|
| 16 |
+
window_size=12),
|
| 17 |
+
decode_head=dict(in_channels=[128, 256, 512, 1024], num_classes=3),
|
| 18 |
+
auxiliary_head=dict(in_channels=512, num_classes=3))
|
| 19 |
+
|
| 20 |
+
train_pipeline = [dict(type='LoadAnnotations', reduce_zero_label=False)]
|
| 21 |
+
|
| 22 |
+
# AdamW optimizer, no weight decay for position embedding & layer norm
|
| 23 |
+
# in backbone
|
| 24 |
+
optimizer = dict(
|
| 25 |
+
_delete_=True,
|
| 26 |
+
type='AdamW',
|
| 27 |
+
lr=0.00006,
|
| 28 |
+
betas=(0.9, 0.999),
|
| 29 |
+
weight_decay=0.01,
|
| 30 |
+
paramwise_cfg=dict(
|
| 31 |
+
custom_keys={
|
| 32 |
+
'absolute_pos_embed': dict(decay_mult=0.),
|
| 33 |
+
'relative_position_bias_table': dict(decay_mult=0.),
|
| 34 |
+
'norm': dict(decay_mult=0.)
|
| 35 |
+
}))
|
| 36 |
+
|
| 37 |
+
lr_config = dict(
|
| 38 |
+
_delete_=True,
|
| 39 |
+
policy='poly',
|
| 40 |
+
warmup='linear',
|
| 41 |
+
warmup_iters=1500,
|
| 42 |
+
warmup_ratio=1e-6,
|
| 43 |
+
power=1.0,
|
| 44 |
+
min_lr=0.0,
|
| 45 |
+
by_epoch=False)
|
| 46 |
+
|
| 47 |
+
# By default, models are trained on 8 GPUs with 2 images per GPU
|
| 48 |
+
data = dict(samples_per_gpu=8)
|
| 49 |
+
|
| 50 |
+
# checkpoint_config = dict(by_epoch=False, interval=2000)
|
| 51 |
+
evaluation = dict(interval=2000, metric=['mIoU', 'mFscore'], pred_eval=True, save_best='mIoU')
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
|
EgoHOS/raw/script/mmsegmentation/configs/swin/seg_twohands_ccda.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/upernet_swin.py', '../_base_/datasets/egohos_twohands_ccda.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py'
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
checkpoint_file = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/swin/swin_base_patch4_window12_384_22k_20220317-e5c09f74.pth' # noqa
|
| 7 |
+
|
| 8 |
+
model = dict(
|
| 9 |
+
pretrained = './pretrain/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K_20210531_125459-429057bf.pth',
|
| 10 |
+
backbone=dict(
|
| 11 |
+
# init_cfg=dict(type='Pretrained', checkpoint=checkpoint_file),
|
| 12 |
+
pretrain_img_size=384,
|
| 13 |
+
embed_dims=128,
|
| 14 |
+
depths=[2, 2, 18, 2],
|
| 15 |
+
num_heads=[4, 8, 16, 32],
|
| 16 |
+
window_size=12),
|
| 17 |
+
decode_head=dict(in_channels=[128, 256, 512, 1024], num_classes=3),
|
| 18 |
+
auxiliary_head=dict(in_channels=512, num_classes=3))
|
| 19 |
+
|
| 20 |
+
train_pipeline = [dict(type='LoadAnnotations', reduce_zero_label=False)]
|
| 21 |
+
|
| 22 |
+
# AdamW optimizer, no weight decay for position embedding & layer norm
|
| 23 |
+
# in backbone
|
| 24 |
+
optimizer = dict(
|
| 25 |
+
_delete_=True,
|
| 26 |
+
type='AdamW',
|
| 27 |
+
lr=0.00006,
|
| 28 |
+
betas=(0.9, 0.999),
|
| 29 |
+
weight_decay=0.01,
|
| 30 |
+
paramwise_cfg=dict(
|
| 31 |
+
custom_keys={
|
| 32 |
+
'absolute_pos_embed': dict(decay_mult=0.),
|
| 33 |
+
'relative_position_bias_table': dict(decay_mult=0.),
|
| 34 |
+
'norm': dict(decay_mult=0.)
|
| 35 |
+
}))
|
| 36 |
+
|
| 37 |
+
lr_config = dict(
|
| 38 |
+
_delete_=True,
|
| 39 |
+
policy='poly',
|
| 40 |
+
warmup='linear',
|
| 41 |
+
warmup_iters=1500,
|
| 42 |
+
warmup_ratio=1e-6,
|
| 43 |
+
power=1.0,
|
| 44 |
+
min_lr=0.0,
|
| 45 |
+
by_epoch=False)
|
| 46 |
+
|
| 47 |
+
# By default, models are trained on 8 GPUs with 2 images per GPU
|
| 48 |
+
data = dict(samples_per_gpu=8)
|
| 49 |
+
|
| 50 |
+
# checkpoint_config = dict(by_epoch=False, interval=2000)
|
| 51 |
+
evaluation = dict(interval=2000, metric=['mIoU', 'mFscore'], pred_eval=True, save_best='mIoU')
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
|
EgoHOS/raw/script/mmsegmentation/configs/swin/swin.yml
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Models:
|
| 2 |
+
- Name: upernet_swin_tiny_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K
|
| 3 |
+
In Collection: UperNet
|
| 4 |
+
Metadata:
|
| 5 |
+
backbone: Swin-T
|
| 6 |
+
crop size: (512,512)
|
| 7 |
+
lr schd: 160000
|
| 8 |
+
inference time (ms/im):
|
| 9 |
+
- value: 47.48
|
| 10 |
+
hardware: V100
|
| 11 |
+
backend: PyTorch
|
| 12 |
+
batch size: 1
|
| 13 |
+
mode: FP32
|
| 14 |
+
resolution: (512,512)
|
| 15 |
+
Training Memory (GB): 5.02
|
| 16 |
+
Results:
|
| 17 |
+
- Task: Semantic Segmentation
|
| 18 |
+
Dataset: ADE20K
|
| 19 |
+
Metrics:
|
| 20 |
+
mIoU: 44.41
|
| 21 |
+
mIoU(ms+flip): 45.79
|
| 22 |
+
Config: configs/swin/upernet_swin_tiny_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K.py
|
| 23 |
+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/swin/upernet_swin_tiny_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K/upernet_swin_tiny_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K_20210531_112542-e380ad3e.pth
|
| 24 |
+
- Name: upernet_swin_small_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K
|
| 25 |
+
In Collection: UperNet
|
| 26 |
+
Metadata:
|
| 27 |
+
backbone: Swin-S
|
| 28 |
+
crop size: (512,512)
|
| 29 |
+
lr schd: 160000
|
| 30 |
+
inference time (ms/im):
|
| 31 |
+
- value: 67.93
|
| 32 |
+
hardware: V100
|
| 33 |
+
backend: PyTorch
|
| 34 |
+
batch size: 1
|
| 35 |
+
mode: FP32
|
| 36 |
+
resolution: (512,512)
|
| 37 |
+
Training Memory (GB): 6.17
|
| 38 |
+
Results:
|
| 39 |
+
- Task: Semantic Segmentation
|
| 40 |
+
Dataset: ADE20K
|
| 41 |
+
Metrics:
|
| 42 |
+
mIoU: 47.72
|
| 43 |
+
mIoU(ms+flip): 49.24
|
| 44 |
+
Config: configs/swin/upernet_swin_small_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K.py
|
| 45 |
+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/swin/upernet_swin_small_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K/upernet_swin_small_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K_20210526_192015-ee2fff1c.pth
|
| 46 |
+
- Name: upernet_swin_base_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K
|
| 47 |
+
In Collection: UperNet
|
| 48 |
+
Metadata:
|
| 49 |
+
backbone: Swin-B
|
| 50 |
+
crop size: (512,512)
|
| 51 |
+
lr schd: 160000
|
| 52 |
+
inference time (ms/im):
|
| 53 |
+
- value: 79.05
|
| 54 |
+
hardware: V100
|
| 55 |
+
backend: PyTorch
|
| 56 |
+
batch size: 1
|
| 57 |
+
mode: FP32
|
| 58 |
+
resolution: (512,512)
|
| 59 |
+
Training Memory (GB): 7.61
|
| 60 |
+
Results:
|
| 61 |
+
- Task: Semantic Segmentation
|
| 62 |
+
Dataset: ADE20K
|
| 63 |
+
Metrics:
|
| 64 |
+
mIoU: 47.99
|
| 65 |
+
mIoU(ms+flip): 49.57
|
| 66 |
+
Config: configs/swin/upernet_swin_base_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K.py
|
| 67 |
+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/swin/upernet_swin_base_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K/upernet_swin_base_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K_20210526_192340-593b0e13.pth
|
| 68 |
+
- Name: upernet_swin_base_patch4_window7_512x512_160k_ade20k_pretrain_224x224_22K
|
| 69 |
+
In Collection: UperNet
|
| 70 |
+
Metadata:
|
| 71 |
+
backbone: Swin-B
|
| 72 |
+
crop size: (512,512)
|
| 73 |
+
lr schd: 160000
|
| 74 |
+
Results:
|
| 75 |
+
- Task: Semantic Segmentation
|
| 76 |
+
Dataset: ADE20K
|
| 77 |
+
Metrics:
|
| 78 |
+
mIoU: 50.31
|
| 79 |
+
mIoU(ms+flip): 51.9
|
| 80 |
+
Config: configs/swin/upernet_swin_base_patch4_window7_512x512_160k_ade20k_pretrain_224x224_22K.py
|
| 81 |
+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/swin/upernet_swin_base_patch4_window7_512x512_160k_ade20k_pretrain_224x224_22K/upernet_swin_base_patch4_window7_512x512_160k_ade20k_pretrain_224x224_22K_20210526_211650-762e2178.pth
|
| 82 |
+
- Name: upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_1K
|
| 83 |
+
In Collection: UperNet
|
| 84 |
+
Metadata:
|
| 85 |
+
backbone: Swin-B
|
| 86 |
+
crop size: (512,512)
|
| 87 |
+
lr schd: 160000
|
| 88 |
+
inference time (ms/im):
|
| 89 |
+
- value: 82.64
|
| 90 |
+
hardware: V100
|
| 91 |
+
backend: PyTorch
|
| 92 |
+
batch size: 1
|
| 93 |
+
mode: FP32
|
| 94 |
+
resolution: (512,512)
|
| 95 |
+
Training Memory (GB): 8.52
|
| 96 |
+
Results:
|
| 97 |
+
- Task: Semantic Segmentation
|
| 98 |
+
Dataset: ADE20K
|
| 99 |
+
Metrics:
|
| 100 |
+
mIoU: 48.35
|
| 101 |
+
mIoU(ms+flip): 49.65
|
| 102 |
+
Config: configs/swin/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_1K.py
|
| 103 |
+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/swin/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_1K/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_1K_20210531_132020-05b22ea4.pth
|
| 104 |
+
- Name: upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K
|
| 105 |
+
In Collection: UperNet
|
| 106 |
+
Metadata:
|
| 107 |
+
backbone: Swin-B
|
| 108 |
+
crop size: (512,512)
|
| 109 |
+
lr schd: 160000
|
| 110 |
+
Results:
|
| 111 |
+
- Task: Semantic Segmentation
|
| 112 |
+
Dataset: ADE20K
|
| 113 |
+
Metrics:
|
| 114 |
+
mIoU: 50.76
|
| 115 |
+
mIoU(ms+flip): 52.4
|
| 116 |
+
Config: configs/swin/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K.py
|
| 117 |
+
Weights: https://download.openmmlab.com/mmsegmentation/v0.5/swin/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K_20210531_125459-429057bf.pth
|
EgoHOS/raw/script/mmsegmentation/configs/swin/twohands_cb_to_obj1.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/upernet_swin.py', '../_base_/datasets/egohos_obj1.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py'
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
checkpoint_file = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/swin/swin_base_patch4_window12_384_22k_20220317-e5c09f74.pth' # noqa
|
| 7 |
+
|
| 8 |
+
model = dict(
|
| 9 |
+
pretrained = './pretrain/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K_20210531_125459-429057bf.pth',
|
| 10 |
+
backbone=dict(
|
| 11 |
+
in_channels = 5,
|
| 12 |
+
# init_cfg=dict(type='Pretrained', checkpoint=checkpoint_file),
|
| 13 |
+
pretrain_img_size=384,
|
| 14 |
+
embed_dims=128,
|
| 15 |
+
depths=[2, 2, 18, 2],
|
| 16 |
+
num_heads=[4, 8, 16, 32],
|
| 17 |
+
window_size=12),
|
| 18 |
+
decode_head=dict(in_channels=[128, 256, 512, 1024], num_classes=4),
|
| 19 |
+
auxiliary_head=dict(in_channels=512, num_classes=4))
|
| 20 |
+
|
| 21 |
+
train_pipeline = [dict(type='LoadAnnotations', reduce_zero_label=False)]
|
| 22 |
+
|
| 23 |
+
# AdamW optimizer, no weight decay for position embedding & layer norm
|
| 24 |
+
# in backbone
|
| 25 |
+
optimizer = dict(
|
| 26 |
+
_delete_=True,
|
| 27 |
+
type='AdamW',
|
| 28 |
+
lr=0.00006,
|
| 29 |
+
betas=(0.9, 0.999),
|
| 30 |
+
weight_decay=0.01,
|
| 31 |
+
paramwise_cfg=dict(
|
| 32 |
+
custom_keys={
|
| 33 |
+
'absolute_pos_embed': dict(decay_mult=0.),
|
| 34 |
+
'relative_position_bias_table': dict(decay_mult=0.),
|
| 35 |
+
'norm': dict(decay_mult=0.)
|
| 36 |
+
}))
|
| 37 |
+
|
| 38 |
+
lr_config = dict(
|
| 39 |
+
_delete_=True,
|
| 40 |
+
policy='poly',
|
| 41 |
+
warmup='linear',
|
| 42 |
+
warmup_iters=1500,
|
| 43 |
+
warmup_ratio=1e-6,
|
| 44 |
+
power=1.0,
|
| 45 |
+
min_lr=0.0,
|
| 46 |
+
by_epoch=False)
|
| 47 |
+
|
| 48 |
+
# By default, models are trained on 8 GPUs with 2 images per GPU
|
| 49 |
+
data = dict(samples_per_gpu=8)
|
| 50 |
+
|
| 51 |
+
# checkpoint_config = dict(by_epoch=False, interval=2000)
|
| 52 |
+
evaluation = dict(interval=2000, metric=['mIoU', 'mFscore'], pred_eval=True, save_best='mIoU')
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
|
EgoHOS/raw/script/mmsegmentation/configs/swin/twohands_cb_to_obj1_ccda.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/upernet_swin.py', '../_base_/datasets/egohos_obj1_ccda.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py'
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
checkpoint_file = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/swin/swin_base_patch4_window12_384_22k_20220317-e5c09f74.pth' # noqa
|
| 7 |
+
|
| 8 |
+
model = dict(
|
| 9 |
+
pretrained = './pretrain/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K_20210531_125459-429057bf.pth',
|
| 10 |
+
backbone=dict(
|
| 11 |
+
in_channels = 5,
|
| 12 |
+
# init_cfg=dict(type='Pretrained', checkpoint=checkpoint_file),
|
| 13 |
+
pretrain_img_size=384,
|
| 14 |
+
embed_dims=128,
|
| 15 |
+
depths=[2, 2, 18, 2],
|
| 16 |
+
num_heads=[4, 8, 16, 32],
|
| 17 |
+
window_size=12),
|
| 18 |
+
decode_head=dict(in_channels=[128, 256, 512, 1024], num_classes=4),
|
| 19 |
+
auxiliary_head=dict(in_channels=512, num_classes=4))
|
| 20 |
+
|
| 21 |
+
train_pipeline = [dict(type='LoadAnnotations', reduce_zero_label=False)]
|
| 22 |
+
|
| 23 |
+
# AdamW optimizer, no weight decay for position embedding & layer norm
|
| 24 |
+
# in backbone
|
| 25 |
+
optimizer = dict(
|
| 26 |
+
_delete_=True,
|
| 27 |
+
type='AdamW',
|
| 28 |
+
lr=0.00006,
|
| 29 |
+
betas=(0.9, 0.999),
|
| 30 |
+
weight_decay=0.01,
|
| 31 |
+
paramwise_cfg=dict(
|
| 32 |
+
custom_keys={
|
| 33 |
+
'absolute_pos_embed': dict(decay_mult=0.),
|
| 34 |
+
'relative_position_bias_table': dict(decay_mult=0.),
|
| 35 |
+
'norm': dict(decay_mult=0.)
|
| 36 |
+
}))
|
| 37 |
+
|
| 38 |
+
lr_config = dict(
|
| 39 |
+
_delete_=True,
|
| 40 |
+
policy='poly',
|
| 41 |
+
warmup='linear',
|
| 42 |
+
warmup_iters=1500,
|
| 43 |
+
warmup_ratio=1e-6,
|
| 44 |
+
power=1.0,
|
| 45 |
+
min_lr=0.0,
|
| 46 |
+
by_epoch=False)
|
| 47 |
+
|
| 48 |
+
# By default, models are trained on 8 GPUs with 2 images per GPU
|
| 49 |
+
data = dict(samples_per_gpu=8)
|
| 50 |
+
|
| 51 |
+
# checkpoint_config = dict(by_epoch=False, interval=2000)
|
| 52 |
+
evaluation = dict(interval=2000, metric=['mIoU', 'mFscore'], pred_eval=True, save_best='mIoU')
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
|
EgoHOS/raw/script/mmsegmentation/configs/swin/twohands_cb_to_obj2_ccda.py
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/upernet_swin.py', '../_base_/datasets/egohos_obj2_ccda.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py'
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
checkpoint_file = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/swin/swin_base_patch4_window12_384_22k_20220317-e5c09f74.pth' # noqa
|
| 7 |
+
|
| 8 |
+
model = dict(
|
| 9 |
+
pretrained = './pretrain/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K_20210531_125459-429057bf.pth',
|
| 10 |
+
backbone=dict(
|
| 11 |
+
in_channels = 5,
|
| 12 |
+
# init_cfg=dict(type='Pretrained', checkpoint=checkpoint_file),
|
| 13 |
+
pretrain_img_size=384,
|
| 14 |
+
embed_dims=128,
|
| 15 |
+
depths=[2, 2, 18, 2],
|
| 16 |
+
num_heads=[4, 8, 16, 32],
|
| 17 |
+
window_size=12),
|
| 18 |
+
decode_head=dict(in_channels=[128, 256, 512, 1024], num_classes=7),
|
| 19 |
+
auxiliary_head=dict(in_channels=512, num_classes=7))
|
| 20 |
+
|
| 21 |
+
train_pipeline = [dict(type='LoadAnnotations', reduce_zero_label=False)]
|
| 22 |
+
|
| 23 |
+
# AdamW optimizer, no weight decay for position embedding & layer norm
|
| 24 |
+
# in backbone
|
| 25 |
+
optimizer = dict(
|
| 26 |
+
_delete_=True,
|
| 27 |
+
type='AdamW',
|
| 28 |
+
lr=0.00006,
|
| 29 |
+
betas=(0.9, 0.999),
|
| 30 |
+
weight_decay=0.01,
|
| 31 |
+
paramwise_cfg=dict(
|
| 32 |
+
custom_keys={
|
| 33 |
+
'absolute_pos_embed': dict(decay_mult=0.),
|
| 34 |
+
'relative_position_bias_table': dict(decay_mult=0.),
|
| 35 |
+
'norm': dict(decay_mult=0.)
|
| 36 |
+
}))
|
| 37 |
+
|
| 38 |
+
lr_config = dict(
|
| 39 |
+
_delete_=True,
|
| 40 |
+
policy='poly',
|
| 41 |
+
warmup='linear',
|
| 42 |
+
warmup_iters=1500,
|
| 43 |
+
warmup_ratio=1e-6,
|
| 44 |
+
power=1.0,
|
| 45 |
+
min_lr=0.0,
|
| 46 |
+
by_epoch=False)
|
| 47 |
+
|
| 48 |
+
# By default, models are trained on 8 GPUs with 2 images per GPU
|
| 49 |
+
data = dict(samples_per_gpu=8)
|
| 50 |
+
|
| 51 |
+
# checkpoint_config = dict(by_epoch=False, interval=2000)
|
| 52 |
+
evaluation = dict(interval=2000, metric=['mIoU', 'mFscore'], pred_eval=True, save_best='mIoU')
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
additional_channel = 'twohands_cb' # NONE, twohands, twohands_cb
|
| 56 |
+
twohands_dir = '/mnt/session_space/home/lingzzha/EgoHOS/testimages/pred_twohands'
|
| 57 |
+
cb_dir = '/mnt/session_space/home/lingzzha/EgoHOS/testimages/pred_cb'
|
| 58 |
+
|
| 59 |
+
|
EgoHOS/raw/script/mmsegmentation/configs/swin/twohands_to_cb.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/upernet_swin.py', '../_base_/datasets/egohos_cb.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py'
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
checkpoint_file = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/swin/swin_base_patch4_window12_384_22k_20220317-e5c09f74.pth' # noqa
|
| 7 |
+
|
| 8 |
+
model = dict(
|
| 9 |
+
pretrained = './pretrain/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K_20210531_125459-429057bf.pth',
|
| 10 |
+
backbone=dict(
|
| 11 |
+
in_channels = 4,
|
| 12 |
+
# init_cfg=dict(type='Pretrained', checkpoint=checkpoint_file),
|
| 13 |
+
pretrain_img_size=384,
|
| 14 |
+
embed_dims=128,
|
| 15 |
+
depths=[2, 2, 18, 2],
|
| 16 |
+
num_heads=[4, 8, 16, 32],
|
| 17 |
+
window_size=12),
|
| 18 |
+
decode_head=dict(in_channels=[128, 256, 512, 1024], num_classes=2),
|
| 19 |
+
auxiliary_head=dict(in_channels=512, num_classes=2))
|
| 20 |
+
|
| 21 |
+
train_pipeline = [dict(type='LoadAnnotations', reduce_zero_label=False)]
|
| 22 |
+
|
| 23 |
+
# AdamW optimizer, no weight decay for position embedding & layer norm
|
| 24 |
+
# in backbone
|
| 25 |
+
optimizer = dict(
|
| 26 |
+
_delete_=True,
|
| 27 |
+
type='AdamW',
|
| 28 |
+
lr=0.00006,
|
| 29 |
+
betas=(0.9, 0.999),
|
| 30 |
+
weight_decay=0.01,
|
| 31 |
+
paramwise_cfg=dict(
|
| 32 |
+
custom_keys={
|
| 33 |
+
'absolute_pos_embed': dict(decay_mult=0.),
|
| 34 |
+
'relative_position_bias_table': dict(decay_mult=0.),
|
| 35 |
+
'norm': dict(decay_mult=0.)
|
| 36 |
+
}))
|
| 37 |
+
|
| 38 |
+
lr_config = dict(
|
| 39 |
+
_delete_=True,
|
| 40 |
+
policy='poly',
|
| 41 |
+
warmup='linear',
|
| 42 |
+
warmup_iters=1500,
|
| 43 |
+
warmup_ratio=1e-6,
|
| 44 |
+
power=1.0,
|
| 45 |
+
min_lr=0.0,
|
| 46 |
+
by_epoch=False)
|
| 47 |
+
|
| 48 |
+
# By default, models are trained on 8 GPUs with 2 images per GPU
|
| 49 |
+
data = dict(samples_per_gpu=8)
|
| 50 |
+
|
| 51 |
+
checkpoint_config = dict(by_epoch=False, interval=2000)
|
| 52 |
+
evaluation = dict(interval=2000, metric=['mIoU', 'mFscore'], pred_eval=True, save_best='mIoU')
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
|
EgoHOS/raw/script/mmsegmentation/configs/swin/twohands_to_cb_ccda.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/upernet_swin.py', '../_base_/datasets/egohos_cb_ccda.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py'
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
checkpoint_file = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/swin/swin_base_patch4_window12_384_22k_20220317-e5c09f74.pth' # noqa
|
| 7 |
+
|
| 8 |
+
model = dict(
|
| 9 |
+
pretrained = './pretrain/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K_20210531_125459-429057bf.pth',
|
| 10 |
+
backbone=dict(
|
| 11 |
+
in_channels = 4,
|
| 12 |
+
# init_cfg=dict(type='Pretrained', checkpoint=checkpoint_file),
|
| 13 |
+
pretrain_img_size=384,
|
| 14 |
+
embed_dims=128,
|
| 15 |
+
depths=[2, 2, 18, 2],
|
| 16 |
+
num_heads=[4, 8, 16, 32],
|
| 17 |
+
window_size=12),
|
| 18 |
+
decode_head=dict(in_channels=[128, 256, 512, 1024], num_classes=2),
|
| 19 |
+
auxiliary_head=dict(in_channels=512, num_classes=2))
|
| 20 |
+
|
| 21 |
+
train_pipeline = [dict(type='LoadAnnotations', reduce_zero_label=False)]
|
| 22 |
+
|
| 23 |
+
# AdamW optimizer, no weight decay for position embedding & layer norm
|
| 24 |
+
# in backbone
|
| 25 |
+
optimizer = dict(
|
| 26 |
+
_delete_=True,
|
| 27 |
+
type='AdamW',
|
| 28 |
+
lr=0.00006,
|
| 29 |
+
betas=(0.9, 0.999),
|
| 30 |
+
weight_decay=0.01,
|
| 31 |
+
paramwise_cfg=dict(
|
| 32 |
+
custom_keys={
|
| 33 |
+
'absolute_pos_embed': dict(decay_mult=0.),
|
| 34 |
+
'relative_position_bias_table': dict(decay_mult=0.),
|
| 35 |
+
'norm': dict(decay_mult=0.)
|
| 36 |
+
}))
|
| 37 |
+
|
| 38 |
+
lr_config = dict(
|
| 39 |
+
_delete_=True,
|
| 40 |
+
policy='poly',
|
| 41 |
+
warmup='linear',
|
| 42 |
+
warmup_iters=1500,
|
| 43 |
+
warmup_ratio=1e-6,
|
| 44 |
+
power=1.0,
|
| 45 |
+
min_lr=0.0,
|
| 46 |
+
by_epoch=False)
|
| 47 |
+
|
| 48 |
+
# By default, models are trained on 8 GPUs with 2 images per GPU
|
| 49 |
+
data = dict(samples_per_gpu=8)
|
| 50 |
+
|
| 51 |
+
checkpoint_config = dict(by_epoch=False, interval=2000)
|
| 52 |
+
evaluation = dict(interval=2000, metric=['mIoU', 'mFscore'], pred_eval=True, save_best='mIoU')
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
|
EgoHOS/raw/script/mmsegmentation/configs/swin/twohands_to_obj1.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/upernet_swin.py', '../_base_/datasets/egohos_obj1.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py'
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
checkpoint_file = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/swin/swin_base_patch4_window12_384_22k_20220317-e5c09f74.pth' # noqa
|
| 7 |
+
|
| 8 |
+
model = dict(
|
| 9 |
+
pretrained = './pretrain/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K_20210531_125459-429057bf.pth',
|
| 10 |
+
backbone=dict(
|
| 11 |
+
in_channels = 4,
|
| 12 |
+
# init_cfg=dict(type='Pretrained', checkpoint=checkpoint_file),
|
| 13 |
+
pretrain_img_size=384,
|
| 14 |
+
embed_dims=128,
|
| 15 |
+
depths=[2, 2, 18, 2],
|
| 16 |
+
num_heads=[4, 8, 16, 32],
|
| 17 |
+
window_size=12),
|
| 18 |
+
decode_head=dict(in_channels=[128, 256, 512, 1024], num_classes=4),
|
| 19 |
+
auxiliary_head=dict(in_channels=512, num_classes=4))
|
| 20 |
+
|
| 21 |
+
train_pipeline = [dict(type='LoadAnnotations', reduce_zero_label=False)]
|
| 22 |
+
|
| 23 |
+
# AdamW optimizer, no weight decay for position embedding & layer norm
|
| 24 |
+
# in backbone
|
| 25 |
+
optimizer = dict(
|
| 26 |
+
_delete_=True,
|
| 27 |
+
type='AdamW',
|
| 28 |
+
lr=0.00006,
|
| 29 |
+
betas=(0.9, 0.999),
|
| 30 |
+
weight_decay=0.01,
|
| 31 |
+
paramwise_cfg=dict(
|
| 32 |
+
custom_keys={
|
| 33 |
+
'absolute_pos_embed': dict(decay_mult=0.),
|
| 34 |
+
'relative_position_bias_table': dict(decay_mult=0.),
|
| 35 |
+
'norm': dict(decay_mult=0.)
|
| 36 |
+
}))
|
| 37 |
+
|
| 38 |
+
lr_config = dict(
|
| 39 |
+
_delete_=True,
|
| 40 |
+
policy='poly',
|
| 41 |
+
warmup='linear',
|
| 42 |
+
warmup_iters=1500,
|
| 43 |
+
warmup_ratio=1e-6,
|
| 44 |
+
power=1.0,
|
| 45 |
+
min_lr=0.0,
|
| 46 |
+
by_epoch=False)
|
| 47 |
+
|
| 48 |
+
# By default, models are trained on 8 GPUs with 2 images per GPU
|
| 49 |
+
data = dict(samples_per_gpu=8)
|
| 50 |
+
|
| 51 |
+
# checkpoint_config = dict(by_epoch=False, interval=2000)
|
| 52 |
+
evaluation = dict(interval=2000, metric=['mIoU', 'mFscore'], pred_eval=True, save_best='mIoU')
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
|
EgoHOS/raw/script/mmsegmentation/configs/swin/twohands_to_obj1_ccda.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/upernet_swin.py', '../_base_/datasets/egohos_obj1_ccda.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py'
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
checkpoint_file = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/swin/swin_base_patch4_window12_384_22k_20220317-e5c09f74.pth' # noqa
|
| 7 |
+
|
| 8 |
+
model = dict(
|
| 9 |
+
pretrained = './pretrain/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K_20210531_125459-429057bf.pth',
|
| 10 |
+
backbone=dict(
|
| 11 |
+
in_channels = 4,
|
| 12 |
+
# init_cfg=dict(type='Pretrained', checkpoint=checkpoint_file),
|
| 13 |
+
pretrain_img_size=384,
|
| 14 |
+
embed_dims=128,
|
| 15 |
+
depths=[2, 2, 18, 2],
|
| 16 |
+
num_heads=[4, 8, 16, 32],
|
| 17 |
+
window_size=12),
|
| 18 |
+
decode_head=dict(in_channels=[128, 256, 512, 1024], num_classes=4),
|
| 19 |
+
auxiliary_head=dict(in_channels=512, num_classes=4))
|
| 20 |
+
|
| 21 |
+
train_pipeline = [dict(type='LoadAnnotations', reduce_zero_label=False)]
|
| 22 |
+
|
| 23 |
+
# AdamW optimizer, no weight decay for position embedding & layer norm
|
| 24 |
+
# in backbone
|
| 25 |
+
optimizer = dict(
|
| 26 |
+
_delete_=True,
|
| 27 |
+
type='AdamW',
|
| 28 |
+
lr=0.00006,
|
| 29 |
+
betas=(0.9, 0.999),
|
| 30 |
+
weight_decay=0.01,
|
| 31 |
+
paramwise_cfg=dict(
|
| 32 |
+
custom_keys={
|
| 33 |
+
'absolute_pos_embed': dict(decay_mult=0.),
|
| 34 |
+
'relative_position_bias_table': dict(decay_mult=0.),
|
| 35 |
+
'norm': dict(decay_mult=0.)
|
| 36 |
+
}))
|
| 37 |
+
|
| 38 |
+
lr_config = dict(
|
| 39 |
+
_delete_=True,
|
| 40 |
+
policy='poly',
|
| 41 |
+
warmup='linear',
|
| 42 |
+
warmup_iters=1500,
|
| 43 |
+
warmup_ratio=1e-6,
|
| 44 |
+
power=1.0,
|
| 45 |
+
min_lr=0.0,
|
| 46 |
+
by_epoch=False)
|
| 47 |
+
|
| 48 |
+
# By default, models are trained on 8 GPUs with 2 images per GPU
|
| 49 |
+
data = dict(samples_per_gpu=8)
|
| 50 |
+
|
| 51 |
+
# checkpoint_config = dict(by_epoch=False, interval=2000)
|
| 52 |
+
evaluation = dict(interval=2000, metric=['mIoU', 'mFscore'], pred_eval=True, save_best='mIoU')
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
|
EgoHOS/raw/script/mmsegmentation/configs/swin/twohands_to_obj2.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/upernet_swin.py', '../_base_/datasets/egohos_obj2.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py'
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
checkpoint_file = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/swin/swin_base_patch4_window12_384_22k_20220317-e5c09f74.pth' # noqa
|
| 7 |
+
|
| 8 |
+
model = dict(
|
| 9 |
+
pretrained = './pretrain/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K_20210531_125459-429057bf.pth',
|
| 10 |
+
backbone=dict(
|
| 11 |
+
in_channels = 4,
|
| 12 |
+
# init_cfg=dict(type='Pretrained', checkpoint=checkpoint_file),
|
| 13 |
+
pretrain_img_size=384,
|
| 14 |
+
embed_dims=128,
|
| 15 |
+
depths=[2, 2, 18, 2],
|
| 16 |
+
num_heads=[4, 8, 16, 32],
|
| 17 |
+
window_size=12),
|
| 18 |
+
decode_head=dict(in_channels=[128, 256, 512, 1024], num_classes=7),
|
| 19 |
+
auxiliary_head=dict(in_channels=512, num_classes=7))
|
| 20 |
+
|
| 21 |
+
train_pipeline = [dict(type='LoadAnnotations', reduce_zero_label=False)]
|
| 22 |
+
|
| 23 |
+
# AdamW optimizer, no weight decay for position embedding & layer norm
|
| 24 |
+
# in backbone
|
| 25 |
+
optimizer = dict(
|
| 26 |
+
_delete_=True,
|
| 27 |
+
type='AdamW',
|
| 28 |
+
lr=0.00006,
|
| 29 |
+
betas=(0.9, 0.999),
|
| 30 |
+
weight_decay=0.01,
|
| 31 |
+
paramwise_cfg=dict(
|
| 32 |
+
custom_keys={
|
| 33 |
+
'absolute_pos_embed': dict(decay_mult=0.),
|
| 34 |
+
'relative_position_bias_table': dict(decay_mult=0.),
|
| 35 |
+
'norm': dict(decay_mult=0.)
|
| 36 |
+
}))
|
| 37 |
+
|
| 38 |
+
lr_config = dict(
|
| 39 |
+
_delete_=True,
|
| 40 |
+
policy='poly',
|
| 41 |
+
warmup='linear',
|
| 42 |
+
warmup_iters=1500,
|
| 43 |
+
warmup_ratio=1e-6,
|
| 44 |
+
power=1.0,
|
| 45 |
+
min_lr=0.0,
|
| 46 |
+
by_epoch=False)
|
| 47 |
+
|
| 48 |
+
# By default, models are trained on 8 GPUs with 2 images per GPU
|
| 49 |
+
data = dict(samples_per_gpu=8)
|
| 50 |
+
|
| 51 |
+
# checkpoint_config = dict(by_epoch=False, interval=2000)
|
| 52 |
+
evaluation = dict(interval=2000, metric=['mIoU', 'mFscore'], pred_eval=True, save_best='mIoU')
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
|
EgoHOS/raw/script/mmsegmentation/configs/swin/twohands_to_obj2_ccda.py
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/upernet_swin.py', '../_base_/datasets/egohos_obj2_ccda.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py'
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
checkpoint_file = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/swin/swin_base_patch4_window12_384_22k_20220317-e5c09f74.pth' # noqa
|
| 7 |
+
|
| 8 |
+
model = dict(
|
| 9 |
+
pretrained = './pretrain/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K_20210531_125459-429057bf.pth',
|
| 10 |
+
backbone=dict(
|
| 11 |
+
in_channels = 4,
|
| 12 |
+
# init_cfg=dict(type='Pretrained', checkpoint=checkpoint_file),
|
| 13 |
+
pretrain_img_size=384,
|
| 14 |
+
embed_dims=128,
|
| 15 |
+
depths=[2, 2, 18, 2],
|
| 16 |
+
num_heads=[4, 8, 16, 32],
|
| 17 |
+
window_size=12),
|
| 18 |
+
decode_head=dict(in_channels=[128, 256, 512, 1024], num_classes=7),
|
| 19 |
+
auxiliary_head=dict(in_channels=512, num_classes=7))
|
| 20 |
+
|
| 21 |
+
train_pipeline = [dict(type='LoadAnnotations', reduce_zero_label=False)]
|
| 22 |
+
|
| 23 |
+
# AdamW optimizer, no weight decay for position embedding & layer norm
|
| 24 |
+
# in backbone
|
| 25 |
+
optimizer = dict(
|
| 26 |
+
_delete_=True,
|
| 27 |
+
type='AdamW',
|
| 28 |
+
lr=0.00006,
|
| 29 |
+
betas=(0.9, 0.999),
|
| 30 |
+
weight_decay=0.01,
|
| 31 |
+
paramwise_cfg=dict(
|
| 32 |
+
custom_keys={
|
| 33 |
+
'absolute_pos_embed': dict(decay_mult=0.),
|
| 34 |
+
'relative_position_bias_table': dict(decay_mult=0.),
|
| 35 |
+
'norm': dict(decay_mult=0.)
|
| 36 |
+
}))
|
| 37 |
+
|
| 38 |
+
lr_config = dict(
|
| 39 |
+
_delete_=True,
|
| 40 |
+
policy='poly',
|
| 41 |
+
warmup='linear',
|
| 42 |
+
warmup_iters=1500,
|
| 43 |
+
warmup_ratio=1e-6,
|
| 44 |
+
power=1.0,
|
| 45 |
+
min_lr=0.0,
|
| 46 |
+
by_epoch=False)
|
| 47 |
+
|
| 48 |
+
# By default, models are trained on 8 GPUs with 2 images per GPU
|
| 49 |
+
data = dict(samples_per_gpu=8)
|
| 50 |
+
|
| 51 |
+
# checkpoint_config = dict(by_epoch=False, interval=2000)
|
| 52 |
+
evaluation = dict(interval=2000, metric=['mIoU', 'mFscore'], pred_eval=True, save_best='mIoU')
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
|
EgoHOS/raw/script/mmsegmentation/configs/swin/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_1K.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'upernet_swin_tiny_patch4_window7_512x512_160k_ade20k_'
|
| 3 |
+
'pretrain_224x224_1K.py'
|
| 4 |
+
]
|
| 5 |
+
checkpoint_file = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/swin/swin_base_patch4_window12_384_20220317-55b0104a.pth' # noqa
|
| 6 |
+
model = dict(
|
| 7 |
+
backbone=dict(
|
| 8 |
+
init_cfg=dict(type='Pretrained', checkpoint=checkpoint_file),
|
| 9 |
+
pretrain_img_size=384,
|
| 10 |
+
embed_dims=128,
|
| 11 |
+
depths=[2, 2, 18, 2],
|
| 12 |
+
num_heads=[4, 8, 16, 32],
|
| 13 |
+
window_size=12),
|
| 14 |
+
decode_head=dict(in_channels=[128, 256, 512, 1024], num_classes=150),
|
| 15 |
+
auxiliary_head=dict(in_channels=512, num_classes=150))
|
EgoHOS/raw/script/mmsegmentation/configs/swin/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'./upernet_swin_base_patch4_window12_512x512_160k_ade20k_'
|
| 3 |
+
'pretrain_384x384_1K.py'
|
| 4 |
+
]
|
| 5 |
+
checkpoint_file = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/swin/swin_base_patch4_window12_384_22k_20220317-e5c09f74.pth' # noqa
|
| 6 |
+
model = dict(
|
| 7 |
+
backbone=dict(
|
| 8 |
+
init_cfg=dict(type='Pretrained', checkpoint=checkpoint_file)))
|
| 9 |
+
|
EgoHOS/raw/script/mmsegmentation/configs/swin/upernet_swin_base_patch4_window12_512x512_160k_egohos_handobj2_subset_pretrain_480x360_22K.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'../_base_/models/upernet_swin.py', '../_base_/datasets/egohos_handobj2_subset.py',
|
| 3 |
+
'../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py'
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
checkpoint_file = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/swin/swin_base_patch4_window12_384_22k_20220317-e5c09f74.pth' # noqa
|
| 7 |
+
|
| 8 |
+
model = dict(
|
| 9 |
+
pretrained = './pretrain/upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K_20210531_125459-429057bf.pth',
|
| 10 |
+
backbone=dict(
|
| 11 |
+
# init_cfg=dict(type='Pretrained', checkpoint=checkpoint_file),
|
| 12 |
+
pretrain_img_size=384,
|
| 13 |
+
embed_dims=128,
|
| 14 |
+
depths=[2, 2, 18, 2],
|
| 15 |
+
num_heads=[4, 8, 16, 32],
|
| 16 |
+
window_size=12),
|
| 17 |
+
decode_head=dict(in_channels=[128, 256, 512, 1024], num_classes=9),
|
| 18 |
+
auxiliary_head=dict(in_channels=512, num_classes=9))
|
| 19 |
+
|
| 20 |
+
train_pipeline = [dict(type='LoadAnnotations', reduce_zero_label=False)]
|
| 21 |
+
|
| 22 |
+
# AdamW optimizer, no weight decay for position embedding & layer norm
|
| 23 |
+
# in backbone
|
| 24 |
+
optimizer = dict(
|
| 25 |
+
_delete_=True,
|
| 26 |
+
type='AdamW',
|
| 27 |
+
lr=0.00006,
|
| 28 |
+
betas=(0.9, 0.999),
|
| 29 |
+
weight_decay=0.01,
|
| 30 |
+
paramwise_cfg=dict(
|
| 31 |
+
custom_keys={
|
| 32 |
+
'absolute_pos_embed': dict(decay_mult=0.),
|
| 33 |
+
'relative_position_bias_table': dict(decay_mult=0.),
|
| 34 |
+
'norm': dict(decay_mult=0.)
|
| 35 |
+
}))
|
| 36 |
+
|
| 37 |
+
lr_config = dict(
|
| 38 |
+
_delete_=True,
|
| 39 |
+
policy='poly',
|
| 40 |
+
warmup='linear',
|
| 41 |
+
warmup_iters=1500,
|
| 42 |
+
warmup_ratio=1e-6,
|
| 43 |
+
power=1.0,
|
| 44 |
+
min_lr=0.0,
|
| 45 |
+
by_epoch=False)
|
| 46 |
+
|
| 47 |
+
# By default, models are trained on 8 GPUs with 2 images per GPU
|
| 48 |
+
data = dict(samples_per_gpu=8)
|
| 49 |
+
|
| 50 |
+
checkpoint_config = dict(by_epoch=False, interval=2000)
|
| 51 |
+
evaluation = dict(interval=2000, metric=['mIoU', 'mFscore'], pred_eval=True, save_best='mIoU')
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
|
EgoHOS/raw/script/mmsegmentation/configs/swin/upernet_swin_base_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_base_ = [
|
| 2 |
+
'./upernet_swin_tiny_patch4_window7_512x512_160k_ade20k_'
|
| 3 |
+
'pretrain_224x224_1K.py'
|
| 4 |
+
]
|
| 5 |
+
checkpoint_file = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/swin/swin_base_patch4_window7_224_20220317-e9b98025.pth' # noqa
|
| 6 |
+
model = dict(
|
| 7 |
+
backbone=dict(
|
| 8 |
+
init_cfg=dict(type='Pretrained', checkpoint=checkpoint_file),
|
| 9 |
+
embed_dims=128,
|
| 10 |
+
depths=[2, 2, 18, 2],
|
| 11 |
+
num_heads=[4, 8, 16, 32]),
|
| 12 |
+
decode_head=dict(in_channels=[128, 256, 512, 1024], num_classes=150),
|
| 13 |
+
auxiliary_head=dict(in_channels=512, num_classes=150))
|