165 Commits

Author SHA1 Message Date
Junhwa Song
ced29fcaf8
[Refactor] Handle case where device is neither CPU nor CUDA in HamHead (#2868) 2023-04-14 10:12:49 +08:00
MengzhangLI
ff8d971988
[Feature] Support SegNeXt in MMSegmentation 2.0 (#2654)
## Motivation

Support SegNeXt in MMSeg 1.x branch.

0.x PR: https://github.com/open-mmlab/mmsegmentation/pull/2600

---------

Co-authored-by: xiexinch <xiexinch@outlook.com>
2023-03-16 16:49:15 +08:00
谢昕辰
dd47cef801
[Feature] Support PIDNet (#2609)
## Motivation

Support SOTA real-time semantic segmentation method in [Paper with
code](https://paperswithcode.com/task/real-time-semantic-segmentation)

Paper: https://arxiv.org/pdf/2206.02066.pdf
Official repo: https://github.com/XuJiacong/PIDNet

## Current results

**Cityscapes**

|Model|Ref mIoU|mIoU (ours)|
|---|---|---|
|PIDNet-S|78.8|78.74|
|PIDNet-M|79.9|80.22|
|PIDNet-L|80.9|80.89|

## TODO

- [x] Support inference with official weights
- [x] Support training on Cityscapes
- [x] Update docstring
- [x] Add unit test
2023-03-15 14:55:30 +08:00
谢昕辰
19f92851f5
[Fix] Add out_channels in CascadeEncoderDecoder and update OCRNet and MobileNet v2 results (#2656)
## Motivation

As title.

## Modification

1. update results in readme
2. fix attr error in cascade encoder decoder
2023-02-28 15:57:43 +08:00
Siddharth Ancha
698dee9525
Backward merge #2535 from 1.x into dev-1.x (#2546)
## Motivation

This is essentially #2535 that I had intended to submit to the `dev-1.x`
branch but accidentally submitted it directly to the `1.x` branch
(apologies!). This also got approved possibly because the core devs also
didn't realize this.

The problem is that now `1.x` and `dev-1.x` are out of sync -- the
changes introduced by #2535 will never be reflected in `dev-1.x`.

## Modification

I'm proposing this "backward-merge" so that `1.x` and `dev-1.x` can be
in sync again. If you look at "files changed", they are exactly the
changes introduced by #2535.

Co-authored-by: MeowZheng <meowzheng@outlook.com>
2023-02-01 10:26:44 +08:00
Miao Zheng
d88f393ffa
[Fix] Remove dependcy mmdet when do not use MaskFormerHead and MMDET_Mask2FormerHead (#2448)
## Motivation

Calling `mmseg.utils.register_all_modules` will import `MaskFormerHead`
and `Mask2FormerHead`, it will crash if mmdet is not installed as `None`
cannot be initialized.

## Modification

- Modify `MMDET_MaskFormerHead=BaseModule` and `MMDET_Mask2FormerHead =
BaseModule` when cannot import from mmdet
2022-12-31 01:02:58 +08:00
谢昕辰
da4125587e [Refactor] Support TTA (#2184)
* tta init

* use mmcv transform

* test city

* add multiscale

* fix merge

* add softmax to post process

* add ut

* add tta pipeline to other datasets

* remove softmax

* add encoder_decoder_tta ut

* add encoder_decoder_tta ut

* rename

* rename file

* rename config

* rm aug_test

* move flip to post process

* fix channel
2022-12-30 22:52:07 +08:00
nulam
3bac6ef5a4
Fix typo in warning on binary classification (#2382) 2022-12-06 11:29:11 +08:00
谢昕辰
163277bfe0
[Feature] Support Mask2former in MMSeg 1.x (#2255)
* init commits

* fix crop size

* add seg_data2instance_data method

* add ut and update requirement

* update configs and readme

* add model-indel

* update optional requirements

* fix results

* fix lint error

* update results

* update results

* remove mmdet from requirements/optional.txt

* use try import and update README

* add docstring to overwrtied method

* minor change

Co-authored-by: MengzhangLI <mcmong@pku.edu.cn>
2022-12-05 18:34:24 +08:00
MengzhangLI
933e4d3cb6
[Feature] Support MaskFormer(NeurIPS'2021) in MMSeg 1.x (#2215)
* [Feature] Support MaskFormer(NeurIPS'2021) in MMSeg 1.x

* add mmdet try except logic

* refactor config files

* add readme

* fix config

* update models & logs

* add MMDET installation and fix info

* fix comments

* fix

* fix config norm optimizer setting

* update models & logs & unittest

* add docstring of MaskFormerHead

* wait for mmdet 3.0.0rc4

* replace seg_mask with seg_logits & add docstring for batch_input_shape

* use mmdet3.0.0rc4

* fix readme and modify config comments

* add mmdet installation in pr_stage_test.yml

* update mmcv version in pr_stage_test.yml

* add mmdet in build_cpu of pr_stage_test.yml

* modify mmdet& mmcv installation in merge_stage_test.yml

* fix typo

* update test.yml

* update test.yml
2022-12-01 19:03:10 +08:00
谢昕辰
925faea5bf
[Fix] Fix the problem of post-processing not removing padding (#2367)
* add img_padding_size

* minor change

* add pad_shape to data_samples
2022-12-01 16:35:39 +08:00
MengzhangLI
e98231ba5f [Enhance] Make scipy as a default dependency in runtime 1.x 2022-11-30 20:11:14 +08:00
MengzhangLI
8b61820751 add comment 2022-11-22 22:42:11 +08:00
MengzhangLI
58e73c3fab [Fix] Fix KNet IterativeDecodeHead bug in dev-1.x branch 2022-11-22 12:46:24 +08:00
Miao Zheng
c56a299571
Merge pull request #2290 from xiexinch/fix_gt_padding
[Enhancement] Support padding in testing
2022-11-19 18:24:59 +08:00
xiexinch
4e12bcd053 fix data sample is None 2022-11-19 18:08:19 +08:00
xiexinch
f915df4b0c remove gt padding 2022-11-19 17:38:10 +08:00
xiexinch
26e9729a84 fix swin load statedict 2022-11-15 16:55:49 +08:00
xiexinch
d33af5215a fix ut 2022-11-10 18:42:18 +08:00
xiexinch
d0b35cdacd fix get gt data 2022-11-10 14:28:20 +08:00
xiexinch
70daaaad59 support padding in test and fix remove gt padding at post_process 2022-11-10 14:21:05 +08:00
Miao Zheng
b732fae265
Upgrade pre commit hooks (#2154)
* Upgrade pre commit hooks

* fix lint
2022-10-08 12:04:24 +08:00
谢昕辰
b3b7629d38
[Fix] Fix binary segmentation (#2101)
* add out_channels

* fix forward

* add decode_head ut

* add segmentor ut

* refine postprocess

* fix
2022-09-27 16:49:38 +08:00
谢昕辰
230246f557
[Refactor] Add pyupgrade pre-commit hook (#2078)
* add pyupgrade hook

* run pyupgrade precommit hook
2022-09-19 14:06:29 +08:00
MengzhangLI
ee7f340dff
[Feature] Support Tversky Loss in dev-1.x branch (#2000) 2022-08-31 10:58:21 +08:00
Miao Zheng
ef2152fd54
[Fix] Fix inputs dtype convert in data preprocessor (#1975) 2022-08-26 17:25:48 +08:00
Miao Zheng
8de0050f25
[Refactor] data flow (#1956)
* [WIP] Refactor data flow

* model return

* [WIP] Refactor data flow

* support data_samples is optional

* fix benchmark

* fix base

* minors

* rebase

* fix api

* ut

* fix api inference

* comments

* docstring

* docstring

* docstring

* fix bug of slide inference

* add assert c > 1
2022-08-26 15:54:23 +08:00
Miao Zheng
50546da85c
[Fix]Remove modules from mmcv.runner and mmcv.utils (#1966)
* [WIP] mmcv-clean

* [WIP]Remove modules from mmcv.runner and mmcv.utils

* wip

* fix import mmengine

* remove ut

* loadcheckpoint in mae
2022-08-25 15:15:21 +08:00
Miao Zheng
e0499d5a77 [Fix] Fix repo based on refactoring standard (#1869)
* [Fix] Fix repo based on refactory standard

* fix ut
2022-08-19 20:50:02 +08:00
谢昕辰
167f94a70b rename data to structures (#1854) 2022-08-19 20:50:02 +08:00
Miao Zheng
d265778b6f
[Fix] Import Sequential from mmengine (#1899) 2022-08-09 21:41:03 +08:00
Miao Zheng
e2f26e3fde
[Fix] Import BaseModule from mmengien (#1862) 2022-08-04 09:35:05 +08:00
MengzhangLI
4079d6dfed
[Fix] Use MMEngine BaseModule (#1829)
* [Fix] Use MMEngine BaseModule

* delete auto_fp16
2022-07-27 15:35:12 +08:00
zhengmiao
4b76f277a6 [Refactory] MMSegmentation Content 2022-07-15 15:47:29 +00:00
xiexinchen.vendor
1b3a4876a1 [Refactor] Fix STDCNet custom loss 2022-07-12 10:20:41 +00:00
xiexinchen.vendor
3e8594d2dc [Refactor] Move tensor2list operation to EncoderDecoder 2022-07-08 10:34:03 +00:00
xiexinch
55b0c3aef5 fix cgnet configs and encnet forward error 2022-07-07 14:18:17 +08:00
xiexinch
761e1a9983 minor change 2022-07-05 20:43:33 +08:00
limengzhang.vendor
c5ad7fb0b7 [Fix] Delete all **kwargs in Segmentor Forward function 2022-06-22 08:24:13 +00:00
zhengmiao
ffa0616a68 [Refactory] KNet head 2022-06-20 04:04:48 +00:00
zhengmiao
b23982d1b3 [Refactory] Refactory BaseSegmentor based BaseModel 2022-06-19 06:32:09 +00:00
linfangjian.vendor
6ca42737b6 [Fix] Fix pred 2022-06-14 02:53:46 +00:00
linfangjian.vendor
dd9c411335 [Refactor] Refactor decode_head and segmentors and add preprocess_cfg 2022-06-10 14:02:40 +00:00
MeowZheng
ee025ea33b [Fix]Add build head 2022-06-08 13:05:41 +08:00
linfangjian.vendor
7a32d610e4 [Refactor] Refactor all registries 2022-05-10 12:15:20 +00:00
wangbin
578d4d0c42 [Fix] Fix the bug in binary_cross_entropy (#1527)
* [Fix] Fix the bug in binary_cross_entropy

 Fix the bug in binary_cross_entropy
'label.max() <= 1' should mask out ignore_index, since the ignore_index often set as 255.

* [Fix] Fix the bug in binary_cross_entropy, add comments

As the ignore_index often set as 255, so the binary class label check should mask out ignore_index.

Co-authored-by: Miao Zheng <76149310+MeowZheng@users.noreply.github.com>

* [Fix] Fix the bug in binary_cross_entropy

As the ignore_index often set as 255, so the binary class label check should mask out ignore_index.

Co-authored-by: Miao Zheng <76149310+MeowZheng@users.noreply.github.com>
Co-authored-by: MeowZheng <meowzheng@outlook.com>
2022-04-29 19:32:12 +08:00
Yuan Liu
43b8a1d8dc [Feature]: Add MAE (#1307)
* [Fix]: Fix lint

* [WIP]: Add mae seg config

* [Feature]: Add MAE seg

* [Fix]: Fix mae dataset img scale bug

* [Fix]: Fix lint

* [Feature]: Change mae config to mae_segmentation's config

* [Feature]: Add interpolate pe when loading

* [Fix]: Fix pos_embed not used bug

* [Fix]: Fix lint

* [Fix]: Init rel pos embed with zeros

* [Fix]: Fix lint

* [Fix]: Change the type name of backbone to MAE

* [Fix]: Delete ade20k_512x512.py

* [Fix]: Use mmseg provided ade20k.py

* [Fix]: Change 1 sample per gpu to 2 samples per gpu

* [Fix]: Fix conflict

* [Refactor]: Use the TransformerEncoderLayer of  BEiT

* [Feature]: Add UT

* [Fix]: Change the default value of qv bias to False

* [Fix]: Initialize relative pos table with zeros

* [Fix]: Delete redundant code in mae

* [Fix]: Fix lint

* [Fix]: Rename qkv_bias to qv_bias

* [Fix]: Add docstring to weight_init of MAEAttention

* [Refactor]: Delete qv_bias param

* [Fix]: Add reference to fix_init_weight

* [Fix]: Fix lint

* [Fix]: Delete extra crop size

* [Refactor]: Rename mae

* [Fix]: Set bias to True

* [Fix]: Delete redundant params

* [Fix]: Fix lint

* [Fix]: Fix UT

* [Fix]: Add resize abs pos embed

* [Fix]: Fix UT

* [Refactor]: Use build layer

* [Fix]: Add licsense and fix docstring

* [Fix]: Fix docstring

* [Feature]: Add README metafile

* [Fix]: Change 640 to 512

* [Fix]: Fix README

* fix readme of MAE

Co-authored-by: MengzhangLI <mcmong@pku.edu.cn>
2022-04-28 00:54:20 +08:00
Miao Zheng
d90e700284 [Refactor] Add build_pos_embed and build_layers for BEiT (#1517)
* [Refactor] Add build_pos_embed and build_layers for BEiT

* Update mmseg/models/backbones/beit.py
2022-04-27 11:37:03 +08:00
Miao Zheng
f64c7c331b [Refactor] Refactor transfomer encode layer in ViT and BEiT backbone (#1481)
* [Refactor] Refactor transfomer encoder layer

* fix ffn cfg

* fix drop path cfg

* private init func

* fix qv bias

* fix qkv bias

* fix qkv bias

* wH->Wh
2022-04-23 17:35:05 +08:00
Mladen Fernežir
9e17a0d364 Fix validation loss logging (#1494) 2022-04-22 15:25:32 +08:00