Commit Graph

407 Commits (72e20a88543a4764780803a66a87d3f4897bc944)

Author SHA1 Message Date
MengzhangLI f15a21a30d [Enchance] Support random seed for distributed sampler (#1411)
* support random seed for distributed sampler

* move mmseg/utils/dist_util.py to mmseg/core/utils/dist_util.py

* move mmseg/utils/dist_util.py to mmseg/core/utils/dist_util.py

* change dist sampler

* change dist sampler

* fix docstring in sync_random_seed
2022-03-28 23:50:39 +08:00
Xiangxu-0103 7a8227b747 fix typo (#1405) 2022-03-23 10:36:27 +08:00
FangjianLin 415b20febd [Feature] Add multi machine `dist_train`. (#1383)
* Add training startup documentation

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix
2022-03-18 10:55:49 +08:00
CCODING 786a9f7902 Support #1375: add demo/image_demo.py support for STARE (#1376)
* Support #1375: add demo/image_demo.py support for STARE

* Update mmseg/core/evaluation/class_names.py

Co-authored-by: MengzhangLI <mcmong@pku.edu.cn>

Co-authored-by: MengzhangLI <mcmong@pku.edu.cn>
2022-03-15 22:42:20 +08:00
Rockey 42df28c7bd [Feature] add nlc2nchw2nlc and nchw2nlc2nchw (#1249)
* [Feature] add nlc2nchw2nlc and nchw2nlc2nchw

* add example

* add test, add **kwargs to make it more universal
2022-03-10 20:27:28 +08:00
MengzhangLI 054dc66145 [Feature] Support K-Net (#1289)
* knet first commit

* fix import error in knet

* remove kernel update head from decoder head

* [Feature] Add kenerl updation for some decoder heads.

* [Feature] Add kenerl updation for some decoder heads.

* directly use forward_feature && modify other 3 decoder heads

* remover kernel_update attr

* delete unnecessary variables in forward function

* delete kernel update function

* delete kernel update function

* delete kernel_generate_head

* add unit test & comments in knet.py

* add copyright to fix lint error

* modify config names of knet

* rename swin-l 640

* upload models&logs and refactor knet_head.py

* modify docstrings and add some ut

* add url, modify docstring and add loss ut

* modify docstrings
2022-03-10 20:05:37 +08:00
Rockey da6bb2c8c5 [Feature]: Add diff seeds to diff ranks and set torch seed in worker_init_fn (#1362) 2022-03-10 09:41:16 +08:00
MengzhangLI 6b05790429 Bump v0.22.1 (#1361) 2022-03-09 20:05:44 +08:00
Rockey 6665b42159 [Fix] Fix the bug that when all pixels in an image is ignored, the ac… (#1336)
* [Fix] Fix the bug that when all pixels in an image is ignored, the accuracy calculation raises ZeroDivisionError

* use eps

* all close

* add ignore test

* add eps
2022-03-09 13:20:46 +08:00
MengzhangLI 67e0f9dd15 Bump v0.22.0 (#1347)
* change version to v0.22.0

* change version to v0.22.0

* add mmcls version in get_started.md

* add mmcls installation and move PR1299 into enhancement

* add mmcls installation and move PR1299 into enhancement

* remove MMCLS and make mmcv <=1.5.0 version in get_started.md

* fix typo
2022-03-04 22:17:29 +08:00
MengzhangLI befdc93dc3 [Feature] Support ConvNext (#1216)
* upload original backbone and configs

* ConvNext Refactor

* ConvNext Refactor

* convnext customization refactor with mmseg style

* convnext customization refactor with mmseg style

* add ade20k_640x640.py

* upload files for training

* delete dist_optimizer_hook and remove layer_decay_optimizer_constructor

* check max(out_indices) < num_stages

* add unittest

* fix lint error

* use MMClassification backbone

* fix bugs in base_1k

* add mmcls in requirements/mminstall.txt

* add mmcls in requirements/mminstall.txt

* fix drop_path_rate and layer_scale_init_value

* use logger.info instead of print

* add mmcls in runtime.txt

* fix f string && delete

* add doctring in LearningRateDecayOptimizerConstructor and fix mmcls version in requirements

* fix typo in LearningRateDecayOptimizerConstructor

* use ConvNext models in unit test for LearningRateDecayOptimizerConstructor

* add unit test

* fix typo

* fix typo

* add layer_wise and fix redundant backbone.downsample_norm in it

* fix unit test

* give a ground truth lr_scale and weight_decay

* upload models and readme

* delete 'backbone.stem_norm' and 'backbone.downsample_norm' in get_num_layer()

* fix unit test and use mmcls url

* update md2yml.py and metafile

* fix typo
2022-03-04 15:52:01 +08:00
FangjianLin 38df41ea19 [Feature] Add `min_size` arg in `Resize` to keep the shape after resize bigger than slide window (#1318)
* [Feature] add setr_resize

* fix a bug

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix
2022-03-01 16:25:48 +08:00
sshuair 06b3533ee5 fix dnl_head export onnx inference difference type Cast error (#1161)
* fix export onnx inference difference type Cast error

* fix export onnx inference difference type Cast error.

* use yapf format

* use same device type with pairwise_weight
2022-03-01 10:16:08 +08:00
MengzhangLI 2717ee62f9 [Feature] Support kenerl updation for some decoder heads. (#1299)
* [Feature] Add kenerl updation for some decoder heads.

* [Feature] Add kenerl updation for some decoder heads.

* directly use forward_feature && modify other 3 decoder heads

* remover kernel_update attr

* delete unnecessary variables in forward function

* delete kernel update function

* delete kernel update function

* delete unnecessary docstrings

* modify comments in self._forward_feature()

* modify docstrings in self._forward_feature()

* fix docstring

* modify uperhead
2022-02-27 11:35:29 +08:00
Miao Zheng b97cfa77d2 [Enhancement] Revise pre-commit-hooks (#1315) 2022-02-23 23:44:27 +08:00
Waterman0524 a93423e1fd [Feature] Support iSAID aerial dataset. (#1115)
* support iSAID aerial dataset

* Update and rename docs/dataset_prepare.md to 博士/dataset_prepare.md

* Update dataset_prepare.md

* fix typo

* fix typo

* fix typo

* remove imgviz

* fix wrong order in annotation name

* upload models&logs

* upload models&logs

* add load_annotations

* fix unittest coverage

* fix unittest coverage

* fix correct crop size in config

* fix iSAID unit test

* fix iSAID unit test

* fix typos

* fix wrong crop size in readme

* use smaller figure as test data

* add smaller dataset in test data

* add blank in docs

* use 0 bytes pseudo data

* add footnote and comments for crop size

* change iSAID to isaid and add default value in it

* change iSAID to isaid in _base_

Co-authored-by: MengzhangLI <mcmong@pku.edu.cn>
2022-02-17 19:07:32 +08:00
MengzhangLI 1abf76decf [Fix] Fix wrong palette value in vaihingen (#1292) 2022-02-16 22:41:39 +08:00
Hyeokjoon Kwon 4d451a09dc [Fix] Make accuracy take into account ignore_index (#1259)
* make accuracy take into account ignore_index

* add UT for accuracy
2022-02-15 00:39:59 +08:00
MengzhangLI 4de0c3708d [Fix] Fix type in Swin Transformer (#1274) 2022-02-09 19:08:32 +08:00
MengzhangLI 574adbe43b Bump v0.21.1 (#1273)
* Bump v0.21.1

* add improvements in changelog

* add improvements in changelog

* fix cn readme

* change changelog
2022-02-09 17:17:55 +08:00
Jerry Jiarui XU b405ce0506 [Improve] Add exception for PointRend for support CPU-only usage (#1271)
* [Improve] Add exception for PointRend for support CPU-only usage

* fixed linting
2022-02-09 00:52:56 -05:00
Jerry Jiarui XU 548eec9580 [Improve] Use MMCV load_state_dict func in ViT/Swin (#1272)
* [Improve] Use MMCV load_state_dict func in ViT/Swin

* use CheckpointLoader instead
2022-02-09 00:52:42 -05:00
MengzhangLI d4f5bb25fc [Enhancement] Upgrade isort in pre-commit hook (#1270) 2022-02-08 19:06:33 +08:00
MengzhangLI a83f715bb8 Bump v0.21.0 (#1258)
* change version to v0.21.0

* change version to v0.21.0

* change version to v0.21.0

* change version to v0.21.0
2022-01-29 18:30:13 +08:00
MengzhangLI 574b195be1 [Enhance] New-style CPU training and inference. (#1251)
* [Enhance] New-style CPU training and inference.

* assert mmcv version

* SyncBN to BN in training and testing

* SyncBN to BN in training and testing

* upload untracked files to this branch

* delete gpu_ids

* fix bugs

* assert args.gpu_id in train.py

* use cfg.gpu_ids = [args.gpu_id]

* use cfg.gpu_ids = [args.gpu_id]

* fix typo

* fix typo

* fix typos
2022-01-28 23:03:01 +08:00
MengzhangLI 46898b8e8a delete unnecessary lines of STDCHead (#1231) 2022-01-28 10:53:11 +08:00
MengzhangLI 2729a6d4d1 add multi-processes script (#1238) 2022-01-27 21:18:55 +08:00
rstrudel ee47c41740 [Feature] Support Segmenter (#955)
* segmenter: add model

* update

* readme: update

* config: update

* segmenter: update readme

* segmenter: update

* segmenter: update

* segmenter: update

* configs: set checkpoint path to pretrain folder

* segmenter: modify vit-s/lin, remove data config

* rreadme: update

* configs: transfer from _base_ to segmenter

* configs: add 8x1 suffix

* configs: remove redundant lines

* configs: cleanup

* first attempt

* swipe CI error

* Update mmseg/models/decode_heads/__init__.py

Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>

* segmenter_linear: use fcn backbone

* segmenter_mask: update

* models: add segmenter vit

* decoders: yapf+remove unused imports

* apply precommit

* segmenter/linear_head: fix

* segmenter/linear_header: fix

* segmenter: fix mask transformer

* fix error

* segmenter/mask_head: use trunc_normal init

* refactor segmenter head

* Fetch upstream (#1)

* [Feature] Change options to cfg-option (#1129)

* [Feature] Change option to cfg-option

* add expire date and fix the docs

* modify docstring

* [Fix] Add <!-- [ABSTRACT] --> in metafile #1127

* [Fix] Fix correct num_classes of HRNet in LoveDA dataset #1136

* Bump to v0.20.1 (#1138)

* bump version 0.20.1

* bump version 0.20.1

* [Fix] revise --option to --options #1140

Co-authored-by: Rockey <41846794+RockeyCoss@users.noreply.github.com>
Co-authored-by: MengzhangLI <mcmong@pku.edu.cn>

* decode_head: switch from linear to fcn

* fix init list formatting

* configs: remove variants, keep only vit-s on ade

* align inference metric of vit-s-mask

* configs: add vit t/b/l

* Update mmseg/models/decode_heads/segmenter_mask_head.py

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

* Update mmseg/models/decode_heads/segmenter_mask_head.py

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

* Update mmseg/models/decode_heads/segmenter_mask_head.py

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

* Update mmseg/models/decode_heads/segmenter_mask_head.py

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

* Update mmseg/models/decode_heads/segmenter_mask_head.py

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

* model_converters: use torch instead of einops

* setup: remove einops

* segmenter_mask: fix missing imports

* add necessary imported init funtion

* segmenter/seg-l: set resolution to 640

* segmenter/seg-l: fix test size

* fix vitjax2mmseg

* add README and unittest

* fix unittest

* add docstring

* refactor config and add pretrained link

* fix typo

* add paper name in readme

* change segmenter config names

* fix typo in readme

* fix typos in readme

* fix segmenter typo

* fix segmenter typo

* delete redundant comma in config files

* delete redundant comma in config files

* fix convert script

* update lateset master version

Co-authored-by: MengzhangLI <mcmong@pku.edu.cn>
Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>
Co-authored-by: Rockey <41846794+RockeyCoss@users.noreply.github.com>
Co-authored-by: Miao Zheng <76149310+MeowZheng@users.noreply.github.com>
2022-01-26 13:50:51 +08:00
MengzhangLI fe42371297 [Feature] Support ISPRS Vaihingen Dataset. (#1171)
* Add Vaihingen

* upload models&logs of vaihingen

* fix unit test

* fix dataset pipeline

* fix unit test coverage

* fix vaihingen docstring
2022-01-22 20:27:51 +08:00
MengzhangLI bdecbdbdf1 [Fix] Add `COCOStuffDataset` in `class_names.py`. (#1222)
* add cocostuff in class_names

* add more class names
2022-01-22 18:03:24 +08:00
Kingdrone 634fbceab0 [Feature] Support ISPRS Potsdam Dataset. (#1097)
* add isprs potsdam dataset

* add isprs dataset configs

* fix lint error

* fix potsdam conversion bug

* fix error in potsdam class

* fix error in potsdam class

* add vaihingen dataset

* add vaihingen dataset

* add vaihingen dataset

* fix some description errors.

* fix some description errors.

* fix some description errors.

* upload models & logs of Potsdam

* remove vaihingen and add unit test

* add chinese readme

* add pseudodataset

* use mmcv and add class_names

* use f-string

* add new dataset unittest

* add docstring and remove global variables args

* fix metafile error in PSPNet

* fix pretrained value

* Add dataset info

* fix typo

Co-authored-by: MengzhangLI <mcmong@pku.edu.cn>
2022-01-18 14:15:15 +08:00
Kyungmin Lee 88944e9935 [Feature] Add MultiImageMixDataset (#1105)
* Fix typo in usage example

* original MultiImageMixDataset code in mmdet

* Add MultiImageMixDataset unittests in test_dataset_wrapper

* fix lint error

* fix value name ann_file to ann_dir

* modify retrieve_data_cfg (#1)

* remove dynamic_scale & add palette

* modify retrieve_data_cfg method

* modify retrieve_data_cfg func

* fix error

* improve the unittests coverage

* fix unittests error

* Dataset (#2)

* add cfg-options

* Add unittest in test_build_dataset

* add blank line

* add blank line

* add a blank line

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

Co-authored-by: Younghoon-Lee <72462227+Younghoon-Lee@users.noreply.github.com>
Co-authored-by: MeowZheng <meowzheng@outlook.com>
Co-authored-by: Miao Zheng <76149310+MeowZheng@users.noreply.github.com>
2022-01-11 16:18:24 +08:00
Kyungmin Lee e9dd32b6e8 [Feature] Add Mosaic transform (#1093)
* Fix typo in usage example

* original mosaic code in mmdet

* Adjust mosaic to the semantic segmentation

* Remove bbox test in test_mosaic

* Add unittests

* Fix resize mode for seg_fields

* Fix repr error

* modify Mosaic docs

* modify from Mosaic to RandomMosaic

* Add docstring

* modify Mosaic docstring

* [Docs] Add a blank line before Returns:

* add blank lines

Co-authored-by: MeowZheng <meowzheng@outlook.com>
2022-01-11 16:17:36 +08:00
Rockey 43ad37b478 [Feature] add auto resume (#1172)
* [Feature] add auto resume

* Update mmseg/utils/find_latest_checkpoint.py

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

* Update mmseg/utils/find_latest_checkpoint.py

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

* modify docstring

* Update mmseg/utils/find_latest_checkpoint.py

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

* add copyright

Co-authored-by: Miao Zheng <76149310+MeowZheng@users.noreply.github.com>
2022-01-11 12:27:24 +08:00
jbwang1997 44d4c3877e [Fix] Set random seed for generating `palette` if not given. (#1152)
* Fix colors

* fix comments

* Add comments

* Add comments. Add random seed in datasets
2021-12-23 09:51:50 +08:00
MengzhangLI 4a90241f91 [Docs] Refactor the structure of documentation (#1128)
* merge docs/ and docs_zh-CN/

* merge docs/ and docs_zh-CN/

* merge docs/ and docs_zh-CN/

* merge docs/ and docs_zh-CN/

* fix launch utility url

* fix launch utility url

* fix wrong pytorch doc url

* remove wrong links docs//
2021-12-16 18:56:45 +08:00
MengzhangLI fbcfa0568b Bump v0.20.2 #1141 2021-12-15 16:49:42 +08:00
MengzhangLI a87de3c025 Bump to v0.20.1 (#1138)
* bump version 0.20.1

* bump version 0.20.1
2021-12-14 22:32:11 +08:00
MengzhangLI 520372eec8 Bump v0.20.0 (#1124)
* change version to v0.20.0

* change version to v0.20.0

* change version to v0.20.0
2021-12-11 01:43:29 +08:00
MengzhangLI c1e72513c9 [Feature] Support STDC Network (new) (#995)
* refactor stdc code

* update key

* fix backbone inference

* remove comments

* fixing errors

* fixing version conflict

* fux typo

* use STDCHead

* upload models&logs

* adding model converters script and fix unittest

* fix error

* fix error

* fix error

* delete redundant keys in config

* fix errors in configs and unittest

* fix errors in configs and unittest

* fix errors in configs and unittest

* change Memory name

* refactor stdc2mmseg

* change name to STDC

* refactor stdc

* refactor stdc

* stdc refactor

* stdc refactor

* stdc refactor

* stdc refactor

* stdc refactor

* stdc refactor

* refactor stdc

* stdc refactor

Co-authored-by: xiexinch <xinchen.xie@qq.com>
2021-12-10 23:09:32 +08:00
Lxinyang cd246e3635 [Feature] Support Twins (NeurIPS2021) (#989)
* debug

* debug

* debug

* this is a debug step, and needs to be recovered

* need recover

* git

* debug

* git

* git

* git

* git

* git

* git

* debug need recover

* debug

* git

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debugf

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* git

* git

* git

* use config small/base/large

* debug

* debug

* git

* debug

* git

* debug

* debug

* debug args

* debug

* debug

* git

* git

* debug

* git

* git

* git

* git

* git

* debug

* debug

* git

* debug

* git

* debug

* debug

* debug

* debug

* git

* debug

* git

* git

* debug

* debug

* git

* git

* git

* git

* debug

* debug

* debug

* debug

* git

* debug

* debug

* git

* git

* debug

* debug

* git

* debug

* debug

* debug

* git

* debug

* debug

* debug

* Please enter the commit message for your changes. Lines starting

* git

* git

* debug

* debug

* debug

* git

* git

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* git

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* git

* fix pre-commit error

* fix error

* git

* git

* git

* git

* git

* git

* debug

* debug

* debug

* debug

* debug

* debug

* git

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* git

* git

* git

* debug

* debug

* debug

* git

* git

* git

* git

* git

* git

* git

* git

* git

* debug

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* fix unittest error

* fix config errors

* fix twins2mmseg bug

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* git

* fix init_weights() in twins.py

* git

* git

* git

* git

* fix comment

* fix comment

* fix comment

* fix comment

* fix unit test coverage in TwinsPR

* Add Twins README

* Add Twins README

* twins refactor

* twins refactor

* delete init_cfg in FFN

* delete init_cfg in FFN

* Update mmseg/models/backbones/twins.py

* Update mmseg/models/backbones/twins.py

* Update mmseg/models/backbones/twins.py

Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>

* Update mmseg/models/backbones/twins.py

* add conference name

Co-authored-by: linxinyang <linxinyang@meituan.com>
Co-authored-by: MengzhangLI <mcmong@pku.edu.cn>
Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>
2021-12-09 19:18:10 +08:00
Rockey a370777e3b [Fix] Fix the bug that mit cannot process init_cfg (#1102)
* [Fix] Fix the bug that mit cannot process init_cfg

* fix error
2021-12-08 23:17:43 -08:00
Rockey 0ad0303ebc [Fix] Remove the inplace operation in uper_head and fpn_neck (#1103)
* [Fix] Remove the inplace operation in  uper_head

* remove the inplace operation in fpn neck

* fix conflict

* increase the coverage
2021-12-09 12:12:31 +08:00
Han Zhang e06cbcd8b1 [Fix] Fix dist training infinite waiting issue (#1035)
* [#1034] fix dist training infinite waiting issue

* print log_vars keys in assertion msg

* linting issue
2021-12-08 21:02:41 +08:00
Zhaolun Zou 079c520e58 [Fix] Fix test error when using --show-dir (#1091)
* Fix test error when using --show-dir

* Move show before test

Co-authored-by: Jiarui XU <xvjiarui0826@gmail.com>
2021-12-06 08:10:18 -08:00
KangBK0120 3d58196e62 [Fix] Remove unexist arg in docstring #1106 2021-12-06 20:03:25 +08:00
Junjun2016 b8ca9b6d99 [Fix] Fix wrong init usage in transformer models (#1069)
* fix wrong trunc_normal_init usage

* fix mit init weights

* fix vit init weights

* fix mit init weights

* fix typo

* fix swin init weights
2021-12-06 19:59:33 +08:00
Rockey 07cd6c98e0 [Feature] Add focal loss (#1024)
* [Feature] add focal loss

* fix the bug of 'non' reduction type

* refine the implementation

* add class_weight and ignore_index; support different alpha values for different classes

* fixed some bugs

* fix bugs

* add comments

* modify test

* Update mmseg/models/losses/focal_loss.py

Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>

* update test_focal_loss.py

* modified the implementation

* Update mmseg/models/losses/focal_loss.py

Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>

* update focal_loss.py

Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>
Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>
2021-12-03 00:18:40 -08:00
MengzhangLI 6a2cfea73b [Feature] Support Real-time model ERFNet (#960)
* first commit

* Fixing Unittest Error

* first refactory of ERFNet

* Refactorying NonBottleneck1d Module

* uploading models&logs

* uploading models&logs

* fix partial bugs & typos

* ERFNet

* add ERFNet with FCNHead

* fix typos of ERFNet

* add name on README.md cover

* chane name to T-ITS'2017

* fix lint error
2021-12-01 23:54:39 -08:00
MengzhangLI defb21bf8a [Fix] Change the upper version of mmcv to 1.5.0 #1096 2021-12-01 21:16:23 +08:00
Kyungmin Lee 40b9ebb565 [Feature] Add Cutout transform (#1022)
* Fix typo in usage example

* [Feature] Add CutOut transform

* CutOut repr covered by unittests

* Cutout ignore index, test

* ignore_index -> seg_fill_in, defualt is None

* seg_fill_in is added to repr

* test is modified for seg_fill_in is None

* seg_fill_in (int), 0-255

* add seg_fill_in test

* doc string for seg_fill_in

* rename CutOut to RandomCutOut, add prob

* Add unittest when cutout is False
2021-11-30 20:37:06 +08:00
Junjun2016 341ecc7633 [Enchance] Set a random seed when the user does not set a seed. (#1039) 2021-11-26 10:55:15 +08:00
Kingdrone 48d4222412 [Feature] Support LoveDA dataset (#1028)
* update LoveDA dataset api

* revised lint errors in dataset_prepare.md

* revised lint errors in loveda.py

* revised lint errors in loveda.py

* revised lint errors in dataset_prepare.md

* revised lint errors in dataset_prepare.md

* checked with isort and yapf

* checked with isort and yapf

* checked with isort and yapf

* Revert "checked with isort and yapf"

This reverts commit 686a51d9

* Revert "checked with isort and yapf"

This reverts commit b877e121bb.

* Revert "revised lint errors in dataset_prepare.md"

This reverts commit 2289e27c

* Revert "checked with isort and yapf"

This reverts commit 159db2f8

* Revert "checked with isort and yapf"

This reverts commit 159db2f8

* add configs & fix bugs

* update new branch

* upload models&logs and add format-only

* change pretraied model path of HRNet

* fix the errors in dataset_prepare.md

* fix the errors in dataset_prepare.md and configs in loveda.py

* change the description in docs_zh-CN/dataset_prepare.md

* use init_cfg

* fix test converage

* adding pseudo loveda dataset

* adding pseudo loveda dataset

* adding pseudo loveda dataset

* adding pseudo loveda dataset

* adding pseudo loveda dataset

* adding pseudo loveda dataset

* Update docs/dataset_prepare.md

Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>

* Update docs_zh-CN/dataset_prepare.md

Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>

* Update docs_zh-CN/dataset_prepare.md

Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>

* Delete unused lines of unittest and Add docs

* add convert .py file

* add downloading links from zenodo

* move place of LoveDA and Cityscapes in doc

* move place of LoveDA and Cityscapes in doc

Co-authored-by: MengzhangLI <mcmong@pku.edu.cn>
Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>
2021-11-24 19:41:19 +08:00
Junjun2016 d4ec8ef963 fix EfficientMultiheadAttention in SegFormer (#1037) 2021-11-15 04:33:28 +08:00
Rockey bc27f24109 [Fix] Fix the bug that vit cannot load pretrain properly when using i… (#999)
* [Fix] Fix the bug that vit cannot load pretrain properly when using init_cfg to specify the pretrain scheme

* [Fix] fix the coverage problem

* Update mmseg/models/backbones/vit.py

Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>

* [Fix] make the predicate more concise and clearer

* [Fix] Modified the judgement logic

* Update tests/test_models/test_backbones/test_vit.py

Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>

* add comments

Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>
2021-11-03 10:36:09 -07:00
Junjun2016 28627a1288 Bump v0.19.0 (#1009)
* change version to v0.19.0

* update changelog
2021-11-03 05:27:20 +08:00
Junjun2016 0a06853bb6 [Feature] Support TIMMBackbone (#998)
* add TIMMBackbone and unittests

* add timm to tests requirements

* deprecate pt1.3.1

* reduce the unittests input of timm backbone

* fix ci

* fix ci

* fix ci

* fix ci

* fix ci

* fix ci

* fix ci

* fix ci

* fix ci

* remove unittests of large models of timm backbone

* generate coverage report for all unittests env

* reduce the unittests input of timm backbone

* reduce the unittests input of timm backbone
2021-11-02 12:51:11 +08:00
MengzhangLI 992d577783 [Fix] Change `self.loss_decode` back to `dict` in Single Loss situation. (#1002)
* fix single loss type

* fix error in ohem & point_head

* fix coverage miss

* fix uncoverage error of PointHead loss

* fix coverage miss

* fix uncoverage error of PointHead loss

* nn.modules.container.ModuleList to nn.ModuleList

* more simple format

* merge unittest def
2021-11-01 15:28:37 +08:00
gszh d7f82e5dc8 Update train.py (#428)
* Update train.py

Add user-defined hooks.

* Update train.py

* Update train.py
2021-10-29 12:13:40 -07:00
Yuan Haobo a33cbbf039 vit contiguous (#992) 2021-10-25 18:11:48 +08:00
Junjun2016 67f1420472 [Enhancement] Add codespell pre-commit hook and fix typos (#920)
* add codespell pre-commit hook and fix typos

* Update mmseg/models/decode_heads/dpt_head.py

* Update mmseg/models/backbones/vit.py

* Update mmseg/models/backbones/vit.py

* fix typos

* skip formating typo

* deprecate formating

* skip ipynb

* unstage ipynb changes

* unstage ipynb changes

* fix typos in ipynb

* unstage ipynb changes
2021-10-13 06:21:17 -07:00
Shouping Shan adb1cd361b [Fix] Fix bug when loading class name form file in custom dataset (#923)
* [Fix] #916 expection string type classes

* add unittests for string path classes

* fix double quote string in test_dataset.py

* move the import to the top of the file

* fix isort lint error

fix isort lint error when move the import to the top of the file
2021-10-08 01:06:18 +08:00
Junjun2016 1ce4904fe3 Bump to v0.18.0 (#940)
* bump to v0.18.0

* replace \ with /
2021-10-07 17:37:31 +08:00
MengzhangLI a9d1295bc3 [Feature] Support FastFCN (#885)
* FastFCN first commit

* FastFCN first commit

* Fixing lint error

* Fixing lint error

* use for loop on JPU

* Use For Loop

* Refactor FastFCN

* FastFCN

* FastFCN

* temp

* Uploading models & logs (4x4)

* Fixing typos

* fix typos

* rename config

* change README.md

* use _delete_=True

* change configs

* change start_level to 0

* change start_level to 0

* jpu

* add unittest for start_level!=0
2021-10-01 02:41:24 +08:00
MengzhangLI 7db1cbb181 [Feature] Support ICNet (#884)
* add icnet backbone

* add icnet head

* add icnet configs

* nclass -> num_classes

* Support ICNet

* ICNet

* ICNet

* Add ICNeck

* Add ICNeck

* Add ICNeck

* Add ICNeck

* Adding unittest

* Uploading models & logs

* Uploading models & logs

* add comment

* smaller test_swin.py

* try to delete test_swin.py

* delete test_unet.py

* delete test_unet.py

* temp

* smaller test_unet.py

Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>
2021-09-30 09:31:57 -07:00
Junjun2016 84edf6c190 fix load ckpt bug in swin (#928) 2021-09-30 07:50:44 -07:00
Jerry Jiarui XU 7edc71d532 [Improvement] Refactor Swin-Transformer (#800)
* [Improvement] Refactor Swin-Transformer

* fixed swin test

* update patch emebd, add more tests

* fixed test

* remove pretrain_style

* fixed padding

* resolve coments

* use mmcv 2tuple

* refactor init_cfg

Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>
2021-09-29 08:46:33 +08:00
MengzhangLI e701497a36 [Feature] Support BiSeNetV1 (#851)
* First Commit

* fix typos

* fix typos

* Fix assertion bug

* Adding Assert

* Adding Unittest

* Fixing typo

* Uploading models & logs

* Fixing unittest error

* changing README.md

* changing README.md
2021-09-29 02:12:57 +08:00
MengzhangLI f82e4d6fc9 [Feature] Support BiSeNetV2 (#804)
* BiSeNetV2 first commit

* BiSeNetV2 unittest

* remove pytest

* add pytest module

* fix ConvModule input name

* fix pytest error

* fix unittest

* refactor

* BiSeNetV2 Refactory

* fix docstrings and add some small changes

* use_sigmoid=False

* fix potential bugs about upsampling

* Use ConvModule instead

* Use ConvModule instead

* fix typos

* fix typos

* fix typos

* discard nn.conv2d

* discard nn.conv2d

* discard nn.conv2d

* delete **kwargs

* uploading markdown and model

* final commit

* BiSeNetV2 adding Unittest for its modules

* BiSeNetV2 adding Unittest for its modules

* BiSeNetV2 adding Unittest for its modules

* BiSeNetV2 adding Unittest for its modules

* BiSeNetV2 adding Unittest for its modules

* BiSeNetV2 adding Unittest for its modules

* BiSeNetV2 adding Unittest for its modules

* Fix README conflict

* Fix unittest problem

* Fix unittest problem

* BiSeNetV2

* Fixing fps

* Fixing typpos

* bisenetv2
2021-09-26 18:52:16 +08:00
Julius Zhang 96b369bd55 [Fix] Fix loss parse in val_step (#906)
* [Fix] Fix loss parse in val_step

* Add val_step unittest

* Add train_step unittest
2021-09-25 18:17:40 -07:00
MengzhangLI 0fd3972c41 [Feature] Support multiple losses during training (#818)
* multiple losses

* fix lint error

* fix typos

* fix typos

* Adding Attribute

* Fixing loss_ prefix

* Fixing loss_ prefix

* Fixing loss_ prefix

* Add Same

* loss_name must has 'loss_' prefix

* Fix unittest

* Fix unittest

* Fix unittest

* Update mmseg/models/decode_heads/decode_head.py

Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>
2021-09-24 15:08:28 +08:00
DerrickWang005 bf1bdba623 support coco stuff-10k/164k (#625)
* support coco stuff-10k/164k

* update docs

* fix docs

* update docs

* fix import lints

* Update docs/dataset_prepare.md

* Update docs/dataset_prepare.md

* Update tools/convert_datasets/coco_stuff164k.py

* Update tools/convert_datasets/coco_stuff10k.py

* Update tools/convert_datasets/coco_stuff10k.py

* Update tools/convert_datasets/coco_stuff10k.py

* Update tools/convert_datasets/coco_stuff10k.py

* Update coco_stuff.py

fix the description of the dataset

* Update dataset_prepare.md

fix the doc tree of coco stuff 10k

* Update coco_stuff10k.py

fix img_dir

* Update coco_stuff.py

fix descriptions

* Update coco_stuff164k.py

fix out_dir

* Update coco_stuff10k.py

fix save file name

* Update coco_stuff.py

fix seg_map_suffix

* Update dataset_prepare.md

fix -p

* Update dataset_prepare.md

fix doc tree

* modify coco stuff convertor

* Remove redundant code

* fix 164k convert bug

* remove redundant comment

* add deeplabv3 configs and more iterations

* replace shutil.move with shtil.copyfile

* Update deeplabv3_r50-d8_512x512_4x4_80k_coco_stuff10k.py

fix wrong config

* Update deeplabv3_r101-d8_512x512_4x4_80k_coco_stuff164k.py

fix wrong config

* fix wrong configs

* fix wrong configs

* fix wrong path for coco stuff 10k

* fix convert bugs

* fix seg_filename bug

* when nproc=0, use track progress

* rename configs: coco_stuff --> coco-stuff

* add coco-stuff 10k and 164k to README.md

* update configs

* add deeplabv3 benchmark

* add pspnet benchmark

* remove redundant comma

Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>
2021-09-22 20:48:08 +08:00
sennnnn 9ac053f49a [Fix] Convert SyncBN to BN when training on DP (#772)
* [Fix] Convert SyncBN to BN when training on DP.

* Modify SyncBN2BN.

* Add SyncBN2BN unit test.

* Resolve some comments.

* use mmcv official revert_sync_batchnorm

* Remove local syncbn2bn unit tests.

* Update mmcv version.

* Fix bugs of gather model tools.

* Modify warnings.

* Modify docker mmcv version.

* Update mmcv version table.
2021-09-15 09:39:37 -07:00
uni19 4583dc1033 [Enhancement] Support loading GT for evaluation from multi-file backend (#867)
* support load gt for evaluation from multi-backend

* move some code from get_gt_seg_maps to get_one_gt_seg_map

* rename gt_seg_map_loader_conf to gt_seg_map_loader_cfg

* fix doc str

* rename get_one_gt_seg_map to get_gt_seg_map_by_idx
2021-09-14 19:16:01 -07:00
FreyWang 598f5c7fa8 [Feature] Support eval concate dataset and add tool to show dataset (#833)
* [Feature] Add tool to show origin or augmented train data

* [Feature] Support eval concate dataset

* Add docstring and modify evaluate of concate dataset

Signed-off-by: FreyWang <wangwxyz@qq.com>

* format concat dataset in subfolder of imgfile_prefix

Signed-off-by: FreyWang <wangwxyz@qq.com>

* add unittest of concate dataset

Signed-off-by: FreyWang <wangwxyz@qq.com>

* update unittest for eval dataset with CLASSES is None

Signed-off-by: FreyWang <wangwxyz@qq.com>

* [FIX] bug of generator,  which lead metric to nan when pre_eval=False

Signed-off-by: FreyWang <wangwxyz@qq.com>

* format code

Signed-off-by: FreyWang <wangwxyz@qq.com>

* add more unittest

* add more unittest

* optim concat dataset builder
2021-09-09 13:00:23 +08:00
Layne b0787b8be2 [Feature] Support ISA module (#70)
* add isa module

* use more readable names, add more comments and exp results

* add unittests

* remove redundant docstring

* Apply suggestions from code review

Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>

* fix unittest

* Update configs

* add results

* update yml

* Update README

Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>
Co-authored-by: xiexinch <xinchen.xie@qq.com>
2021-09-08 21:13:53 -07:00
MengzhangLI 767de8f4d9 [Fix] Fix docstring link problem in readthedocs (#845)
* fix docstring link

* fix docstring link

* fix docstring link

* fix docstring link

* fix docstring link

* fix docstring link
2021-09-02 17:06:43 +08:00
Junjun2016 4a77b2a34e Bump to v0.17.0 (#841) 2021-09-01 22:43:38 +08:00
谢昕辰 ef4b30038f [Feature] add DPT head (#605)
* add DPT head

* [fix] fix init error

* use mmcv function

* delete code

* remove transpose clas

* support NLC output shape

* Delete post_process_layer.py

* add unittest and docstring

* rename variables

* fix project error and add unittest

* match dpt weights

* add configs

* fix vit pos_embed bug and dpt feature fusion bug

* match vit output

* fix gelu

* minor change

* update unitest

* fix configs error

* inference test

* remove auxilary

* use local pretrain

* update training results

* update yml

* update fps and memory test

* update doc

* update readme

* add yml

* update doc

* remove with_cp

* update config

* update docstring

* remove dpt-l

* add init_cfg and modify readme.md

* Update dpt_vit-b16.py

* zh-n README

* use constructor instead of build function

* prevent tensor being modified by ConvModule

* fix unittest

Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>
2021-08-30 16:53:05 +08:00
谢昕辰 0cf838f294 [Feature] Support dark dataset test (#815)
* rewrite init function

* support dark_zurich test

* reset image size

* add night

* add train_pipeline

* init function parameters

* remove base dataset config

* remove fcn config

* update doc

* add datasets to README

* update doc

* fix table of PSPNet config

* fix table of PSPNet config

* change 'model' tp 'evaluation checkpoint'

* fix typos in README_zh-CN

Co-authored-by: MengzhangLI <mcmong@pku.edu.cn>
2021-08-28 11:51:05 -07:00
Guangchen Lin b5ad23e545 [Fix] The interface multiscale_output is defined but not used (#830)
* Add interface multiscale_output

* Add space between args and their types

* Fix default value
2021-08-27 18:53:55 +08:00
谢昕辰 42c3f944e0 [Enhancement] Support inherit cityscapes dataset (#750)
* rewrite init function

* init function parameters
2021-08-27 14:53:36 +08:00
谢昕辰 119bbd838d [Enhancement] Delete convert function and add instruction to ViT/Swin README.md (#791)
* delete convert function and add instruction to README.md

* unified model convert and README

* remove url

* fix import error

* fix unittest

* rename pretrain

* rename vit and deit pretrain

* Update upernet_deit-b16_512x512_160k_ade20k.py

* Update upernet_deit-b16_512x512_80k_ade20k.py

* Update upernet_deit-b16_ln_mln_512x512_160k_ade20k.py

* Update upernet_deit-b16_mln_512x512_160k_ade20k.py

* Update upernet_deit-s16_512x512_160k_ade20k.py

* Update upernet_deit-s16_512x512_80k_ade20k.py

* Update upernet_deit-s16_ln_mln_512x512_160k_ade20k.py

* Update upernet_deit-s16_mln_512x512_160k_ade20k.py

Co-authored-by: Jiarui XU <xvjiarui0826@gmail.com>
Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>
2021-08-25 15:00:41 -07:00
sennnnn 4e9c26bbbc [Refactor] Support progressive test with fewer memory cost (#709)
* Support progressive test with fewer memory cost.

* Temp code

* Using processor to refactor evaluation workflow.

* refactor eval hook.

* Fix process bar.

* Fix middle save argument.

* Modify some variable name of dataset evaluate api.

* Modify some viriable name of eval hook.

* Fix some priority bugs of eval hook.

* Depreciated efficient_test.

* Fix training progress blocked by eval hook.

* Depreciated old test api.

* Fix test api error.

* Modify outer api.

* Build a sampler test api.

* TODO: Refactor format_results.

* Modify variable names.

* Fix num_classes bug.

* Fix sampler index bug.

* Fix grammaly bug.

* Support batch sampler.

* More readable test api.

* Remove some command arg and fix eval hook bug.

* Support format-only arg.

* Modify format_results of datasets.

* Modify tool which use test apis.

* support cityscapes eval

* fixed cityscapes

* 1. Add comments for batch_sampler;

2. Keep eval hook api same and add deprecated warning;

3. Add doc string for dataset.pre_eval;

* Add efficient_test doc string.

* Modify test tool to compat old version.

* Modify eval hook to compat with old version.

* Modify test api to compat old version api.

* Sampler explanation.

* update warning

* Modify deploy_test.py

* compatible with old output, add efficient test back

* clear logic of exclusive

* Warning about efficient_test.

* Modify format_results save folder.

* Fix bugs of format_results.

* Modify deploy_test.py.

* Update doc

* Fix deploy test bugs.

* Fix custom dataset unit tests.

* Fix dataset unit tests.

* Fix eval hook unit tests.

* Fix some imcompatible.

* Add pre_eval argument for eval hooks.

* Update eval hook doc string.

* Make pre_eval false in default.

* Add unit tests for dataset format_results.

* Fix some comments and bc-breaking bug.

* Fix pre_eval set cfg field.

* Remove redundant codes.

Co-authored-by: Jiarui XU <xvjiarui0826@gmail.com>
2021-08-19 20:44:58 -07:00
uni19 6dc3f7bd7f ensure items in dataset have the same order across multi machine (#780) 2021-08-20 02:42:21 +08:00
Junjun2016 2fe0bddf5e [Dcos] Add header for files (#796)
* Add header for files

* Delete header in config files
2021-08-16 23:16:55 -07:00
sennnnn 94a1946351 [Fix] Fix setr decode head typos. (#787) 2021-08-13 14:55:29 +08:00
sennnnn b4fd32d049 [Feature] Add segformer decode head and related train config (#599)
* [Feature]Segformer re-implementation

* Using act_cfg and norm_cfg to control activation and normalization

* Split this PR into several little PRs

* Fix lint error

* Remove SegFormerHead

* [Feature] Add segformer decode head and related train config

* Add ade20K trainval support for segformer

1. Add related train and val configs;

2. Add AlignedResize;

* Set arg: find_unused_parameters = True

* parameters init refactor

* 1. Refactor segformer backbone parameters init;

2. Remove rebundant functions and unit tests;

* Remove rebundant codes

* Replace Linear Layer to 1X1 Conv

* Use nn.ModuleList to refactor segformer head.

* Remove local to_xtuple

* 1. Remove rebundant codes;

2. Modify module name;

* Refactor the backbone of segformer using mmcv.cnn.bricks.transformer.py

* Fix some code logic bugs.

* Add mit_convert.py to match pretrain keys of segformer.

* Resolve some comments.

* 1. Add some assert to ensure right params;

2. Support flexible peconv position;

* Add pe_index assert and fix unit test.

* 1. Add doc string for MixVisionTransformer;

2. Add some unit tests for MixVisionTransformer;

* Use hw_shape to pass shape of feature map.

* 1. Fix doc string of MixVisionTransformer;

2. Simplify MixFFN;

3. Modify H, W to hw_shape;

* Add more unit tests.

* Add doc string for shape convertion functions.

* Add some unit tests to improve code coverage.

* Fix Segformer backbone pretrain weights match bug.

* Modify configs of segformer.

* resolve the shape convertion functions doc string.

* Add pad_to_patch_size arg.

* Support progressive test with fewer memory cost.

* Modify default value of pad_to_patch_size arg.

* Temp code

* Using processor to refactor evaluation workflow.

* refactor eval hook.

* Fix process bar.

* Fix middle save argument.

* Modify some variable name of dataset evaluate api.

* Modify some viriable name of eval hook.

* Fix some priority bugs of eval hook.

* Fix some bugs about model loading and eval hook.

* Add ade20k 640x640 dataset.

* Fix related segformer configs.

* Depreciated efficient_test.

* Fix training progress blocked by eval hook.

* Depreciated old test api.

* Modify error patch size.

* Fix pretrain of mit_b0

* Fix the test api error.

* Modify dataset base config.

* Fix test api error.

* Modify outer api.

* Build a sampler test api.

* TODO: Refactor format_results.

* Modify variable names.

* Fix num_classes bug.

* Fix sampler index bug.

* Fix grammaly bug.

* Add part of benchmark results.

* Support batch sampler.

* More readable test api.

* Remove some command arg and fix eval hook bug.

* Support format-only arg.

* Modify format_results of datasets.

* Modify tool which use test apis.

* Update readme.

* Update readme of segformer.

* Updata readme of segformer.

* Update segformer readme and fix segformer mit_b4.

* Update readme of segformer.

* Clean AlignedResize related config.

* Clean code from pr #709

* Clean code from pr #709

* Add 512x512 segformer_mit-b5.

* Fix lint.

* Fix some segformer head bugs.

* Add segformer unit tests.

* Replace AlignedResize to ResizeToMultiple.

* Modify readme of segformer.

* Fix bug of ResizeToMultiple.

* Add ResizeToMultiple unit tests.

* Resolve conflict.

* Simplify the implementation of ResizeToMultiple.

* Update test results.

* Fix multi-scale test error when resize_ratio=1.75 and input size=640x640.

* Update segformer results.

* Update Segformer results.

* Fix some url bugs and pipelines bug.

* Move ckpt convertion to tools.

* Add segformer official pretrain weights usage.

* Clean redundant codes.

* Remove redundant codes.

* Unfied format.

* Add description for segformer converter.

* Update workers.
2021-08-13 13:31:19 +08:00
Junjun2016 93a558f0d7 [Fix] Update digit_version (#778)
* update digit_version

* add unittest

* fix import
2021-08-11 23:34:02 -07:00
Junjun2016 b539a43dd7 [Fix] Fix the log error (#766)
* set the priority of EvalHook to LOW

* add comment for priority change

* fix comment
2021-08-09 17:20:02 -07:00
Junjun2016 06f0c5de33 Bump to v0.16.0 (#749)
* Bump to v0.16.0

* fix doc

* fix changelog

* fix changelog
2021-08-04 17:17:39 +08:00
sshuair 778961dd2e [Enhancement] Support hrnet frozen stage (#743)
* support hrnet frozen stage

* support hrnet frozen stage
2021-08-03 09:45:42 -07:00
Junjun2016 e09c700f15 [Enhancement] Refine the docstring of ResNet (#723)
* refine docstring of resnet

* refine docstring
2021-07-28 17:33:15 +08:00
Miguel Méndez 50461efe85 [Fix] Replace interpolate with resize (#731)
* Replace interpolate with resize

* Replace nn.Upsample with ops.Upsample

* Fix test
2021-07-28 16:56:22 +08:00
Junjun2016 b5ae7a7f69 [Fix] Fix ATTENTION registry (#729)
* register ATTENTION registry from the parent ATTENTION registry of MMCV to avoid conflict with other repos

* remove redundant file
2021-07-27 23:19:12 +08:00
sennnnn 095ed243c0 [Feature] Segformer backbone re-implementation (#594)
* [Feature]Segformer re-implementation

* Using act_cfg and norm_cfg to control activation and normalization

* Split this PR into several little PRs

* Fix lint error

* Remove SegFormerHead

* parameters init refactor

* 1. Refactor segformer backbone parameters init;

2. Remove rebundant functions and unit tests;

* Remove rebundant codes

* 1. Remove rebundant codes;

2. Modify module name;

* Refactor the backbone of segformer using mmcv.cnn.bricks.transformer.py

* Fix some code logic bugs.

* Add mit_convert.py to match pretrain keys of segformer.

* Resolve some comments.

* 1. Add some assert to ensure right params;

2. Support flexible peconv position;

* Add pe_index assert and fix unit test.

* 1. Add doc string for MixVisionTransformer;

2. Add some unit tests for MixVisionTransformer;

* Use hw_shape to pass shape of feature map.

* 1. Fix doc string of MixVisionTransformer;

2. Simplify MixFFN;

3. Modify H, W to hw_shape;

* Add more unit tests.

* Add doc string for shape convertion functions.

* Add some unit tests to improve code coverage.

* Fix Segformer backbone pretrain weights match bug.

* resolve the shape convertion functions doc string.

* Add pad_to_patch_size arg.

* Modify default value of pad_to_patch_size arg.
2021-07-19 09:40:40 -07:00
谢昕辰 f6246d6eaa [Fix] fix patch_embed and pos_embed mismatch error (#685)
* fix patch_embed and pos_embed mismatch error

* add docstring

* update unittest

* use downsampled image shape

* use tuple

* remove unused parameters and add doc

* fix init weights function

* revise docstring

* Update vit.py

If -> Whether

* fix lint

Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>
2021-07-19 09:27:10 -07:00
Jerry Jiarui XU 5184c6a8db [Bug fix] Fix efficient test for multi-node (#707)
* [Bug fix] Fix efficient test for multi-node

* fixed CI

* add efficient test dir

* remove unused args
2021-07-15 12:13:03 -07:00
Ivan Rubachev 55085a85c3 Fix init_cfg in resnet backbone (#697) 2021-07-14 20:45:14 -07:00
Junjun2016 00defd6b7f update resource limit (#700) 2021-07-14 20:43:21 -07:00
Junjun2016 259eeb08c8 fix efficient test bug (#702) 2021-07-14 20:42:33 -07:00
Jerry Jiarui XU ae61e66521 Bump to v0.15.0 (#669)
* Bump to v0.15.0

* fixed version
2021-07-04 01:09:17 -07:00
谢昕辰 fb9462fc7c [Fix] fix fast scnn (#606)
* [Refactor] Match paddle seg weight

* Match inference

* fix exp setting

* delete comment and rename config files

* replace hard code with config parameters

* fix ppm concat order

* remove hardcode

* update result

* fix typo

* complement docstring

* complement FutureFusionModule docstring

* modify log link
2021-07-02 17:58:35 +08:00
Junjun2016 5864f3f807 [Fix] Fix mmcv version compatible in get_started.md (#658)
* fix mmcv version compatible

* update version compatible
2021-07-01 09:41:52 -07:00
Ze Liu 214d083cce [WIP] Add Swin Transformer (#511)
* add Swin Transformer

* add Swin Transformer

* fixed import

* Add some swin training settings.

* Fix some filename error.

* Fix attribute name: pretrain -> pretrained

* Upload mmcls implementation of swin transformer.

* Refactor Swin Transformer to follow mmcls style.

* Refactor init_weigths of swin_transformer.py

* Fix lint

* Match inference precision

* Add some comments

* Add swin_convert to load official style ckpt

* Remove arg: auto_pad

* 1. Complete comments for each block;

2. Correct weight convert function;

3. Fix the pad of Patch Merging;

* Clean function args.

* Fix vit unit test.

* 1. Add swin transformer unit tests;

2. Fix some pad bug;

3. Modify config to adapt new swin implementation;

* Modify config arg

* Update readme.md of swin

* Fix config arg error and Add some swin benchmark msg.

* Add MeM and ms test content for readme.md of swin transformer.

* Fix doc string of swin module

* 1. Register swin transformer to model list;

2. Modify pth url which keep meta attribute;

* Update swin.py

* Merge config settings.

* Modify config style.

* Update README.md

Add ViT link

* Modify main readme.md

Co-authored-by: Jiarui XU <xvjiarui0826@gmail.com>
Co-authored-by: sennnnn <201730271412@mail.scut.edu.cn>
Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>
2021-07-01 23:41:55 +08:00
谢昕辰 5245edb0a0 add configs for vit backbone plus decode_heads (#520)
* add config

* add cityscapes config

* add default value to docstring

* fix lint

* add deit-s and deit-b

* add readme

* add eps at norm_cfg

* add drop_path_rate experiment

* add deit case at init_weight

* add upernet result

* update result and add upernet 160k config

* update upernet result and fix settings

* Update iters number

* update result and delete some configs

* fix import error

* fix drop_path_rate

* update result and restore config

* update benchmark result

* remove cityscapes exp

* remove neck

* neck exp

* add more configs

* fix init error

* fix ffn setting

* update result

* update results

* update result

* update results and fill table

* delete or rename configs

* fix link delimiter

* rename configs and fix link

* rename neck to mln
2021-07-01 23:00:39 +08:00
Jerry Jiarui XU bf746bf737 [Feature] Support persistent_workers in DataLoader (PyTorch>=1.7.0) (#646) 2021-06-28 17:39:32 +08:00
sennnnn 60baa4e841 [Fix] Add setr & vit msg. (#635)
* [Fix] Add setr & vit msg.

* Fix init bug

* Modify init_cfg arg

* Add conv_seg init
2021-06-23 22:25:06 -07:00
Sixiao Zheng 5876868a48 [Feature] Official implementation of SETR (#531)
* Adjust vision transformer backbone architectures;

* Add DropPath, trunc_normal_ for VisionTransformer implementation;

* Add class token buring intermediate period and remove it during final period;

* Fix some parameters loss bug;

* * Store intermediate token features and impose no processes on them;

* Remove class token and reshape entire token feature from NLC to NCHW;

* Fix some doc error

* Add a arg for VisionTransformer backbone to control if input class token into transformer;

* Add stochastic depth decay rule for DropPath;

* * Fix output bug when input_cls_token=False;

* Add related unit test;

* Re-implement of SETR

* Add two head -- SETRUPHead (Naive, PUP) & SETRMLAHead (MLA);

* * Modify some docs of heads of SETR;

* Add MLA auxiliary head of SETR;

* * Modify some arg of setr heads;

* Add unit test for setr heads;

* * Add 768x768 cityscapes dataset config;

* Add Backbone: SETR -- Backbone: MLA, PUP, Naive;

* Add SETR cityscapes training & testing config;

* * Fix the low code coverage of unit test about heads of setr;

* Remove some rebundant error capture;

* * Add pascal context dataset & ade20k dataset config;

* Modify auxiliary head relative config;

* Modify folder structure.

* add setr

* modify vit

* Fix the test_cfg arg position;

* Fix some learning schedule bug;

* optimize setr code

* Add arg: final_reshape to control if converting output feature information from NLC to NCHW;

* Fix the default value of final_reshape;

* Modify arg: final_reshape to arg: out_shape;

* Fix some unit test bug;

* Add MLA neck;

* Modify setr configs to add MLA neck;

* Modify MLA decode head to remove rebundant structure;

* Remove some rebundant files.

* * Fix the code style bug;

* Remove some rebundant files;

* Modify some unit tests of SETR;

* Ignoring CityscapesCoarseDataset and MapillaryDataset.

* Fix the activation function loss bug;

* Fix the img_size bug of SETR_PUP_ADE20K

* * Fix the lint bug of transformers.py;

* Add mla neck unit test;

* Convert vit of setr out shape from NLC to NCHW.

* * Modify Resize action of data pipeline;

* Fix deit related bug;

* Set find_unused_parameters=False for pascal context dataset;

* Remove arg: find_unused_parameters which is False by default.

* Error auxiliary head of PUP deit

* Remove the minimal restrict of slide inference.

* Modify doc string of Resize

* Seperate this part of code to a new PR #544

* * Remove some rebundant codes;

* Modify unit tests of SETR heads;

* Fix the tuple in_channels of mla_deit.

* Modify code style

* Move detailed definition of auxiliary head into model config dict;

* Add some setr config for default cityscapes.py;

* Fix the doc string of SETR head;

* Modify implementation of SETR Heads

* Remove setr aux head and use fcn head to replace it;

* Remove arg: img_size and remove last interpolate op of heads;

* Rename arg: conv3x3_conv1x1 to kernel_size of SETRUPHead;

* non-square input support for setr heads

* Modify config argument for above commits

* Remove norm_layer argument of SETRMLAHead

* Add mla_align_corners for MLAModule interpolate

* [Refactor]Refactor of SETRMLAHead

* Modify Head implementation;

* Modify Head unit test;

* Modify related config file;

* [Refactor]MLA Neck

* Fix config bug

* [Refactor]SETR Naive Head and SETR PUP Head

* [Fix]Fix the lack of arg: act_cfg and arg: norm_cfg

* Fix config error

* Refactor of SETR MLA, Naive, PUP heads.

* Modify some attribute name of SETR Heads.

* Modify setr configs to adapt new vit code.

* Fix trunc_normal_ bug

* Parameters init adjustment.

* Remove redundant doc string of SETRUPHead

* Fix pretrained bug

* [Fix] Fix vit init bug

* Add some vit unit tests

* Modify module import

* Remove norm from PatchEmbed

* Fix pretrain weights bug

* Modify pretrained judge

* Fix some gradient backward bugs.

* Add some unit tests to improve code cov

* Fix init_weights of setr up head

* Add DropPath in FFN

* Finish benchmark of SETR

1. Add benchmark information into README.MD of SETR;

2. Fix some name bugs of vit;

* Remove DropPath implementation and use DropPath from mmcv.

* Modify out_indices arg

* Fix out_indices bug.

* Remove cityscapes base dataset config.

Co-authored-by: sennnnn <201730271412@mail.scut.edu.cn>
Co-authored-by: CuttlefishXuan <zhaoxinxuan1997@gmail.com>
2021-06-23 09:39:29 -07:00
sennnnn 2a9bf2d21b [Fix] Fix some vit init bugs (#609)
* [Fix] Fix vit init bug

* Add some vit unit tests

* Modify module import

* Fix pretrain weights bug

* Modify pretrained judge

* Add some unit tests to improve code cov

* Optimize code

* Fix vit unit test
2021-06-19 15:53:13 -07:00
sennnnn c01abb4f30 [Refactor] Using mmcv transformer bricks to refactor vit. (#571)
* [Refactor] Using mmcv bricks to refactor vit

* Follow the vit code structure from mmclassification

* Add MMCV install into CI system.

* Add  to 'Install MMCV' CI item

* Add 'Install MMCV_CPU' and 'Install MMCV_GPU CI' items

* Fix & Add

1. Fix low code coverage of vit.py;

2. Remove HybirdEmbed;

3. Fix doc string of VisionTransformer;

* Add helpers unit test.

* Add converter to convert vit pretrain weights from timm style to mmcls style.

* Clean some rebundant code and refactor init

1. Use timm style init_weights;

2. Remove to_xtuple and trunc_norm_;

* Add comments for VisionTransformer.init_weights()

* Add arg: pretrain_style to choose timm or mmcls vit pretrain weights.
2021-06-17 10:41:25 -07:00
Jerry Jiarui XU 7d52bc0caa Bump to v0.14.1 (#604) 2021-06-16 21:49:56 -07:00
Jerry Jiarui XU 9849a8dc23 [Refactor]: Unified parameter initialization (#567)
* [Refactor]: Unified parameter initialization

* fixed pretrained
2021-06-16 21:41:29 -07:00
Jerry Jiarui XU af6478dd7a Bump to v0.14 (#580) 2021-06-02 18:43:08 -07:00
Yinhao Li 02b5d768aa [feature]: Able to use save_best option (#575)
* Add  save_best option in eval_hook.

* Update meta to fix best model can not test bug

* refactor with _do_evaluate

* remove redundent

* add meta

Co-authored-by: Jiarui XU <xvjiarui0826@gmail.com>
2021-06-02 16:25:26 -07:00
sennnnn 83df7ec21a [Feature] Add results2img, format_results for ade dataset (#544)
* [Feature] Add results2img, format_results for ade dataset.

* clean rebundant code.
2021-05-16 19:29:28 -07:00
谢昕辰 1052f8d5d3 support loading deit weights (#538) 2021-05-08 20:34:18 -07:00
Ziyi Wu f253451b54 infer batch size using len(result) in test function (#532) 2021-05-06 08:16:46 -07:00
RangiLyu aa14be1871 fix typo (#533) 2021-05-06 08:16:06 -07:00
sennnnn 5c195db1bd Add option for output shape of ViT (#530)
* Add arg: final_reshape to control if converting output feature information from NLC to NCHW;

* Fix the default value of final_reshape;

* Modify arg: final_reshape to arg: out_shape;

* Fix some unit test bug;
2021-05-05 22:49:28 -07:00
Jerry Jiarui XU 0d477ac577 Bump to v0.13 (#529) 2021-05-05 16:56:19 -07:00
谢昕辰 4f2ef8af78 Use MMCV's EvalHook in MMSegmentation (#438)
* mmcv eval hook

* mmcv evalhook compatible

* add warnings

* inherit from base class

* fix unitest

* adapt to mmcv 1.3.1

* fixed unittest

* set by_epoch=False

* fixed efficient test

* update docstring

Co-authored-by: Jiarui XU <xvjiarui0826@gmail.com>
2021-05-05 16:19:54 -07:00
sshuair 7fbdd6f197 add metric mFscore (#509)
* add mFscore and refactor the metrics return value

* fix linting

* some docstring and name fix
2021-04-30 11:34:57 -07:00
sennnnn c27ef91942 Adjust vision transformer backbone architectures (#524)
* Adjust vision transformer backbone architectures;

* Add DropPath, trunc_normal_ for VisionTransformer implementation;

* Add class token buring intermediate period and remove it during final period;

* Fix some parameters loss bug;

* * Store intermediate token features and impose no processes on them;

* Remove class token and reshape entire token feature from NLC to NCHW;

* Fix some doc error

* Add a arg for VisionTransformer backbone to control if input class token into transformer;

* Add stochastic depth decay rule for DropPath;

* * Fix output bug when input_cls_token=False;

* Add related unit test;

* * Add arg: out_indices to control model output;

* Add unit test for DropPath;

* Apply suggestions from code review

Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>
2021-04-30 10:37:47 -07:00
Ziyi Wu 771ca7d3e0 [Enhance] Support reading class_weight from file in loss functions to help MMDet3D (#513)
* support reading class_weight from file in loss function

* add unit test of loss with class_weight from file

* minor fix

* move get_class_weight to utils
2021-04-29 01:04:15 -07:00
Ziyi Wu ce56e68d30 [Enhance] Replace data_dict calling 'img' key to support MMDet3D (#514)
* remove dict calling img key for compatibility

* fix unit test

* infer batch size using len(result) to be consistent with mmcv
2021-04-29 01:01:34 -07:00
Jerry Jiarui XU fb031c59c8 [Refactor] Use MMCV MODEL_REGISTRY (#515)
* [Refactor] Use MMCV MODEL_REGISTRY

* fixed args
2021-04-27 23:51:09 -07:00
谢昕辰 07cc26ae5a add upsample neck (#512)
* init

* upsample v1.0

* fix errors

* change to in_channels list

* add unittest, docstring, norm/act config and rename

Co-authored-by: xiexinch <test767803@foxmail.com>
2021-04-24 21:22:09 -07:00
谢昕辰 b379b5a5b3 support transformer backbone (#465)
* vit backbone

* fix lint

* add docstrings and fix pretrained pos_embed dim not match prob

* add unittest for vit

* fix lint

* add vit based fcn configs

* fix import error

* support multiple resolution input images

* upsample pos_embed at init_weights

* support resize pos_embed at evaluation

* fix training errors

* add more unitest code for vit backbone

* unitest for uncovered code

* add norm_eval unittest

* refactor _pos_embeding

* minor change

* change var name

* rafactor init_weight

* load weights after resize

* ignore 'module' in pretrain checkpoint

* add with_cp

* add with_cp

Co-authored-by: Jiarui XU <xvjiarui0826@gmail.com>
2021-04-21 20:19:55 -07:00
sennnnn 38d2e969dd Add support for Pascal Context 59 classes (#459)
* Add support for Pascal Context 59 classes (#459)

* Create PascalContextDataset59 class in mmseg/datasets/pascal_context.py;

* Set reduce_zero_label=True for train_pipeline and PascalContextDataset59;

* Add some configs for Pascal-Context 59 classes training and testing;

* Try to solve the problem about "fence(IoU)=nan grass(IoU)=0";

* Continue(1): Try to solve the problem about "fence(IoU)=nan grass(IoU)=0";

* ignore files and folders named tempxxx;

* Continue(2): Try to solve the problem about "fence(IoU)=nan grass(IoU)=0";

* Modify the calculation of IoU;

* Modify the CLASSES order of PascalContextDataset;

* Add "fcn", "deeplabv3", "deeplabv3+", "pspnet" config file for model training based on PascalContextDataset59;

Add some ignore items in ".gitignore";

* fix the bug "test_cfg specified in both outer field and model field " of pspnet config file;

* * Clean unnecessary codes;

* Add weighs link, config link, log link and evaluation results about PascalContextDataset59 in README.md

* Add command line argument: "-p | --port", this arg can change the transmit port when you transmit data to distributed machine.

* * Remove rebundant config files;

* Remove "-p|--port" command argument;

Co-authored-by: Jiarui XU <xvjiarui0826@gmail.com>
2021-04-19 21:20:54 -07:00
Ziyi Wu c4049bab3e add BaseSegmentor import to segmentors/__init__.py (#495) 2021-04-19 08:52:42 -07:00
sennnnn d3603e5335 Fix mIoU calculatiton range (#471)
* Fix fence(IoU) = 0 when training on PascalContextDataset59;

* Add a test case in test_metrics() of tests/test_metrics.py to test the bug caused by torch.histc;

* Update tests/test_metrics.py

Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>

Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>
2021-04-14 08:37:23 -07:00
q.yao bc2dc1277a add dynamic export and visualize to pytorch2onnx (#463)
* add dynamic export and visualize to pytorch2onnx

* update document

* fix lint

* fix dynamic error and add visualization

* fix lint

* update docstring

* update doc

* Update help info for --show

Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>

* fix lint

Co-authored-by: maningsheng <maningsheng@sensetime.com>
Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>
2021-04-12 11:54:59 -07:00
Jerry Jiarui XU d283ca6fea [Improvement] Add more CI (#460)
* add more CI

* fix missing

* remove python-version

* fixed acc
2021-04-08 19:29:00 -07:00
Jerry Jiarui XU ac2aab74e9 Bump to v0.12 (#455) 2021-04-03 21:02:56 -07:00
Jerry Jiarui XU 3150dd0ce4 refactor test organization (#440)
* refactor test organization

* fixed se layer

* update mmcv uper bound
2021-03-30 17:55:09 -07:00
lizz fcad6df7a6 Save base_channels for UNet (#450)
Signed-off-by: lizz <lizz@sensetime.com>
2021-03-30 09:52:08 -07:00
lizz bbb9f074f6 Fix typo: upsampe_cfg -> upsample_cfg (#449)
* Fix typo: upsampe_cfg -> upsample_cfg

Signed-off-by: lizz <lizz@sensetime.com>

* convoluton -> convolution

Signed-off-by: lizz <lizz@sensetime.com>

* more

Signed-off-by: lizz <lizz@sensetime.com>

* ok

Signed-off-by: lizz <lizz@sensetime.com>
2021-03-30 09:51:38 -07:00
sshuair 7c329fa775 Include each class metrics in logs (#445)
* Include each class metrics in logs

* format

* fix the unitest

* fix the custom int class_name

* fix the custom int class_name
2021-03-29 09:53:54 -07:00
谢昕辰 71be1c2793 [Bug fixed]Fix dice_loss errors (#417)
* fix training bugs

* fix unitest error

* fix error in num_classes==2 case

* delete comments
2021-03-29 09:49:54 -07:00
谢昕辰 d474cfde4b pytorch metrics implementation (#430)
* pytorch metrics impl and test

* support list[str] input, delete unused test code and delete numpy version

* modify input data type

* add docstring and unitest of filename inputs

* add indents in docstring and use tempfile lib to create dir

* using with statement
2021-03-29 09:49:14 -07:00
David de la Iglesia Castro 9cbb4b1288 Add opacity option to show_result (#425) 2021-03-22 20:34:38 -07:00
谢昕辰 bac0714347 Support fcn dilate 6 (#400)
* Support fcn dilate 6

* Support dilate in FCNHead

* configs for cityscapse dataset

* add configs for pytorch pretrained model

* update README

* add fps test results

* add memory test results and links

* modify log names

* Update mmseg/models/decode_heads/fcn_head.py

Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>
2021-03-20 10:32:04 -07:00
谢昕辰 a3b523e3fd dice loss (#396)
* dice loss

* format code, add docstring and calculate denominator without valid_mask

* minor change

* restore
2021-03-10 18:32:37 -08:00
Jerry Jiarui XU 96ddb41c6e Fix PhotoMetricDistortion docstring (#388) 2021-02-24 18:22:00 -08:00
Jerry Jiarui XU 45f07af4c8 Bump v0.11 (#368)
* bump to v0.11

* update readme
2021-02-02 15:09:20 -08:00
Jerry Jiarui XU f3cf96b63e [Bug fix] Fixed ADE20k test (#359)
* [Bug fix] Fixed ADE20k test

* fixed ade cfg
2021-01-24 02:17:59 -08:00
Jerry Jiarui XU 4423d32702 [Improvement] Move train_cfg/test_cfg inside model (#341)
* [Improvement] Move train_cfg/test_cfg inside model

* fixed config dict

* fixed config dict
2021-01-19 17:06:23 -08:00
yamengxi c8bbd3fa95 [New Feature]add lovasz loss (#351)
* add lovasz loss

* Modify as comments

* Modify paper url

* add unittest and remove Var

* impove unittest
2021-01-18 19:05:30 -08:00
yamengxi 7e156454a2 memory efficient test (#330)
* memory efficient test

* implement efficient test

* merge

* Add document and docstring

* fix unit test

* add memory usage report
2021-01-09 23:47:31 -08:00
yamengxi 022b055a66 [Bug Fix] Fix TTA resize scale (#334)
* fix tta bug

* modify as suggested

* fix test_tta bug
2021-01-07 09:58:34 -08:00
Jerry Jiarui XU 5eafe8f6df Bump to v0.10 (#325)
* Bump to v0.10

* change version
2021-01-02 15:29:56 -08:00
yamengxi 25d8d77fab [New model] Support MobileNetV3 (#268)
* delete markdownlint

* Support MobileNetV3

* fix import

* add mobilenetv3 head and configs

* Modify MobileNetV3 to semantic segmentation version

* modify mobilenetv3 configs

* add std configs

* fix Conv2dAdaptivePadding bug

* add configs

* add unitest and fix bugs

* fix lraspp unitest bugs

* restore

* fix unitest

* add MobileNetV3 docstring

* add mmcv

* add mmcv

* fix syntax bug

* fix unitest bug

* fix unitest bug

* fix unitest bugs

* fix docstring

* add configs

* restore

* delete unnecessary assert

* modify unitest

* delete benchmark
2020-12-26 00:02:50 -08:00
Junjun2016 b9ba9f6ce7 Support DMNet (#313)
* Support DMNet

* fix doc and delete norm_name
2020-12-23 22:16:34 -08:00
Junjun2016 a5d15ae228 Support APCNet (#299)
* Support APCNet

* code optimization

* add apcnet configs

* add benchmark

* add readme and model zoo

* fix doc
2020-12-17 23:23:45 -08:00
Junjun2016 55df29beab Support resize data augmentation according to original image size (#291)
* Support resize data augmentation according to original image size (img_scale=None and retio_range is tuple)

* fix docstring

* fix bug

* add unittest

* img_scale=None in TTA

* fix bug

* add unittest

* fix typos

* fix bug
2020-12-14 20:23:18 -08:00
Youqing Xiaozhua d5712c4d38 Bugfix: num of augmentations and image meta not match when run TTA on CPU (#276)
* add inference test

* fix E501 line too long (81 > 79 characters

* fix wrong config path

* fix num of augmentations (2) != num of image meta (1)

* Update test_inference.py

Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>
2020-12-13 23:51:42 -08:00
yinchimaoliang b77623e783 change 'reduct' to 'reduce' (#298) 2020-12-13 10:06:01 -08:00
Jerry Jiarui XU 7678ecc333 Bump to 0.9.0 (#285)
* Bump to 0.9.0

* add version
2020-12-01 21:10:55 -08:00
yamengxi 26f4bed242 [Feature]add CLAHE transform (#229)
* add CLAHE transform

* fix syntax error

* fix syntax error

* restore

* add a test

* modify cv2 to mmcv

* add docstring

* modify

* restore

* fix mmcv.clahe error

* change mmcv version to 1.3.0

* fix bugs

* add all data transformers to __init__

* fix __init__

* fix test_transform
2020-12-01 21:08:16 -08:00
yamengxi e8d643fe3a [Feature] add AdjustGamma transform (#232)
* add AdjustGamma transform

* restore

* change cv2 to mmcv

* simplify AdjustGamma

* fix syntax error

* modify

* fix syntax error

* change mmcv version to 1.3.0

* fix lut function name error

* fix syntax error

* fix range
2020-12-01 20:14:01 -08:00
Junjun2016 1530af6533 add dice evaluation metric (#225)
* add dice evaluation metric

* add dice evaluation metric

* add dice evaluation metric

* support 2 metrics

* support 2 metrics

* support 2 metrics

* support 2 metrics

* fix docstring

* use np.round once for all
2020-11-23 19:21:22 -08:00
Jerry Jiarui XU 97f10dbb04 [Bug Fix] Add missing transforms in __init__.py (#260) 2020-11-18 12:22:46 +08:00
Jerry Jiarui XU ffcdfd36d0 [Enhancement] Support ignore_index for sigmoid BCE (#210)
* [Enhancement] Add args check for ignore_index

* Support ignore_index
2020-11-17 16:14:03 +08:00
Junjun2016 378ea27e4f fix _resize_seg bug in Resize data transforms (#246) 2020-11-16 17:28:41 +08:00
yamengxi 365ce9e2af [Feature] Add Rerange transform (#228)
* add rerange transform

* restore

* delete rerange config

* delete rerange config hint

* add min < max assert

* restore
2020-11-10 02:30:07 -08:00
yamengxi 0588426eaa [Feature] Add Rgb2Gray transform (#227)
* add transformer Rgb2Gray

* restore

* fix self.weights

* restore

* fix code

* restore

* fix syntax error

* restore
2020-11-08 23:23:34 -08:00
Jerry Jiarui XU 500babf958 [Feature] Add RandomRotate transform (#215)
* add RandomRotate for transforms

* change rotation function to mmcv.imrotate

* refactor

* add unittest

* fixed test

* fixed docstring

* fixed test

* add more test

* fixed repr

* rename to prob

* fixed unittest

Co-authored-by: hkzhang95 <GodBlessZhk@outlook.com>
2020-11-07 09:53:12 -08:00
Jerry Jiarui XU be94bbf1cc Bump to v0.8 (#226)
* Bump to v0.8

* add version
2020-11-04 16:18:02 -08:00
yamengxi 86d473002f [New model] Support CGNet (#223)
* added cgnet

* added testing for cgnet

* git test

* add cgnet

* fix __init__

* rename FGlo with GlobalContextExtractor

* add readme.md and rename bn with norm

* delete cg_head

* fix a language mistake

* rename cgnet_m3n21.py to cgnet.py

* modify README.md

* modify list to tuple

* add fcn_head test

* add assert to fcn_head

* blank

* fix fcn_head assert bug

* add

* add cgnet to README.md and model_zoo.md

* modify cgnet README.md

Co-authored-by: KID <wps_@mail.nankai.edu.cn>
2020-11-03 00:05:25 -08:00
yamengxi 294a1f377a fix dataset jpg bug (#213)
* fix dataset jpg bug

* fix syntax error
2020-10-28 11:58:44 -07:00
David de la Iglesia Castro 969c7fd8e4 Add runner type (#118)
* Add runner_type option

* pre-commit

* Fix max_iters

* Add by_epoch to EvalHook

* Add test_eval_hook for epoch runner

* Remove runner-type arg from tools/train

* Add missing every_n_iters check for epoch mode

* Bump mmcv min version

* Use build_runner

* Use interval in tests

* Update test_eval_hook.py

* Use every_n_epochs instead of every_n_iters. Update DistEvalHook

* Add test_dist_eval_hook_epoch

* Fix tests

* Add DeprecationWarning

* Update docs

* Replace DeprecationWarning with UserWarning
2020-10-25 15:18:46 -07:00
yamengxi 464ffb77ad Define blood vessel dataset and fix filename bug (#203)
* fix filename bug

* define blood vessel dataset

* redo debug

* fix small bug

* rename dataset

Co-authored-by: yamengxi <yamengxi@sensetime.com>
2020-10-22 17:27:40 -07:00
Junjun2016 5956451014 add unet (#161)
* add unet

* add unet

* add unet

* update test_unet

* update test_unet

* update test_unet

* update test_unet

* fix bugs

* add init method for unet

* add test of UNet init_weights method

* add registry

* merge upsample

* fix test

* Update mmseg/models/backbones/unet.py

Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>

* Update mmseg/models/backbones/unet.py

Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>

* split UpConvBlock from UNet

* use reversed

* rename upsample module

* rename upsample module

* rename upsample module

* rename upsample module

Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>
2020-10-21 11:24:38 -07:00
Jerry Jiarui XU a2e9d97096 add missing 0.7 (#188) 2020-10-11 18:08:40 +08:00
David de la Iglesia Castro e7240c8cf1 Support custom palette (#157)
* Fix split

* Update tests/test_data/test_dataset.py

Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>

Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>
2020-09-30 18:02:08 +08:00
Jerry Jiarui XU 2610a11981 [Enhance] Refactor inverted residual (#164)
* [Enhance] Unifed InvertedResidual in MobileNetV2 and FastSCNN

* [Enhance] Unifed InvertedResidual in MobileNetV2 and FastSCNN
2020-09-28 00:33:51 +08:00
Jerry Jiarui XU f3f443ff71 [Enhance] Migrate to MMCV DepthwiseSeparableConv (#158)
* Add D16-MG124 models

* Use MMCV DepthSepConv

* add OHEM

* add warmup

* fixed test

* fixed test

* change to bs 16

* revert config

* add models

* seperate
2020-09-25 19:56:10 +08:00
David de la Iglesia Castro e385842557 Fix cpu inference (#152)
* Add missing map_location

* Add docstring

* Update mmseg/apis/inference.py

Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>

* Update inference.py

* Update inference.py

Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>
2020-09-25 01:34:40 +08:00
David de la Iglesia Castro 51e4cdefc5 Use img_prefix and seg_prefix for loading (#153)
* Use img_prefix and seg_prefix for loading

* flake8

* Fix split
2020-09-25 00:48:16 +08:00
robin Han 588a2c036a add support for 4D output (#150) 2020-09-23 17:01:20 +08:00
yamengxi 7baed6513e Add Pascal Context to mmsegmentation (#133)
* Add Pascal Context to mmsegmentation

* Add benchmark result to Pascal Context

* fix mmcv version

* fix code syntax

* fix code syntax again

* Update mmseg/models/segmentors/encoder_decoder.py

update hint

Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>

* update comment

* fix pascal context model path

* fix model path mistake again

* fix model path mistake again

* fix model path mistakes again

Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>
2020-09-22 14:56:13 +08:00
sshuair cac4138f99 fix acc and iou compute nan problem (#116)
* fix acc and iou compute nan problem

* fix acc and iou compute nan problem

* add nan_to_num args for mean_iou

* add nan_to_num args for mean_iou

* add nan_to_num args for mean_iou

* add nan_to_num args for mean_iou

* add nan_to_num args for mean_iou

* Update mmseg/core/evaluation/mean_iou.py

* Update mean_iou.py

* Update mean_iou.py

Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>
2020-09-22 01:04:46 +08:00
Jerry Jiarui XU 276e9ca75e [Enhance] Use MMCV collect_env (#137) 2020-09-19 21:32:41 +08:00
Iago González 7c6fa48411 Add support for custom classes (#71)
* Support for custom classes

* Fix test

* Fix pre-commit

* Add pipeline logic for custom classes

* Fix minor issues, fix test

* Fix issues from PR review

* Fix tests

* Remove palette as str

* Rename old_to_new_ids to label_map

* Test for load_anns

* Remove get_palette function

* fixed temp

* Add subset of palette, remove palette as arg

* minor update

Co-authored-by: Jiarui XU <xvjiarui0826@gmail.com>
2020-09-16 21:33:01 +08:00
Jerry Jiarui XU e2371a196e Bump to version 0.6 (#119)
* Bump to version 0.6

* fixed format
2020-09-10 20:57:18 +08:00
Jerry Jiarui XU 4448647e90 [Feature] Support PointRend (#109)
* [Feature] Support PointRend

* add previous test

* update modelzoo
2020-09-07 19:59:44 +08:00
Han Hu d7ae15c7f7 Add "disentangled non-local (DNL) neural networks" [ECCV2020] (#37)
* Add DNLHead

* add configs

* add weight decay mult

* add norm back

* Update README.md

* matched inference performance

* Fixed shape

* sep conv_out

* no norm

* add norm back

* complete model zoo

* add tests

* Add test forward

* Add more test

Co-authored-by: Jiarui XU <xvjiarui0826@gmail.com>
2020-09-07 16:22:00 +08:00
Xia Li 李夏 4b883ab717 [Feature] Support EMANet (#34)
* add emanet

* fixed bug and typos

* add emanet config

* fixed padding

* fixed identity

* rename

* rename

* add concat_input

* fallback to update last

* Fixed concat

* update EMANet

* Add tests

* remove self-implement norm

Co-authored-by: Jiarui XU <xvjiarui0826@gmail.com>
2020-09-07 13:06:59 +08:00
Jerry Jiarui XU 1fbb537958 [Feature] Support MobileNetV2 backbone (#86)
* [Feature] Support MobileNetV2 backbone

* Fixed import

* Fixed test

* Fixed test

* Fixed dilate

* upload model

* update table

* update table

* update bibtex

* update MMCV requirement
2020-09-04 15:35:52 +08:00
robin Han 2e5260b58a Onnx upsample (#100)
* add customized Upsample which can convert to ONNX

* support multiply decode head for hrnet

* support size for Upsample
2020-09-03 19:59:13 +08:00
Jerry Jiarui XU 56f6941331 Add Semantic FPN (#94)
* Add Semantic FPN

* remove HRFPN
2020-09-03 19:56:36 +08:00
John Zhu 683b34d486 Windows Support (Experimental) (#75)
* Windows basic support

* getting_started updated for Windows.

* add experimental

* install.md restructured to seperate Windows & Linux.

* fix problems in install.md

* fix mmcv version problem.

* Fix fastscnn resize problems. (#82)

* Fix fast_scnn resize problems

* Fix fast_scnn resize problems 1

* Fix fast_scnn resize problems 2

* test for pascal voc

* [Doc] Add annotaion format note (#77)

* update pytorch version to 1.6.0 in install.md

* del fastscnn_pascal config

* del create_symlink=True

* Merge instructions for Linux & Windows

* mmcv version updated

* redundant newline deleted

* Update docs/install.md

Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>

* Update docs/install.md

Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>

Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>
2020-08-28 11:34:44 +08:00
MY_ 429c8b3fbf Update test.py (#93) 2020-08-25 21:12:39 +08:00
Jerry Jiarui XU 8c0e093b31 Fixed slide inference (#90) 2020-08-25 20:01:01 +08:00
John Zhu 65dae41bbf Fix fastscnn resize problems. (#82)
* Fix fast_scnn resize problems

* Fix fast_scnn resize problems 1

* Fix fast_scnn resize problems 2

* test for pascal voc
2020-08-23 14:41:30 +08:00
John Zhu f6b9da55f3 Fast-SCNN implemented (#58)
* init commit: fast_scnn

* 247917iters

* 4x8_80k

* configs placed in configs_unify.  4x8_80k exp.running.

* mmseg/utils/collect_env.py modified to support Windows

* study on lr

* bug in configs_unify/***/cityscapes.py fixed.

* lr0.08_100k

* lr_power changed to 1.2

* log_config by_epoch set to False.

* lr1.2

* doc strings added

* add fast_scnn backbone  test

* 80k 0.08,0.12

* add 450k

* fast_scnn test: fix BN bug.

* Add different config files into configs/

* .gitignore recovered.

* configs_unify del

* .gitignore recovered.

* delete sub-optimal config files of fast-scnn

* Code style improved.

* add docstrings to component modules of fast-scnn

* relevant files modified according to Jerry's instructions

* relevant files modified according to Jerry's instructions

* lint problems fixed.

* fast_scnn config extremely simplified.

* InvertedResidual

* fixed padding problems

* add unit test for inverted_residual

* add unit test for inverted_residual: debug 0

* add unit test for inverted_residual: debug 1

* add unit test for inverted_residual: debug 2

* add unit test for inverted_residual: debug 3

* add unit test for sep_fcn_head: debug 0

* add unit test for sep_fcn_head: debug 1

* add unit test for sep_fcn_head: debug 2

* add unit test for sep_fcn_head: debug 3

* add unit test for sep_fcn_head: debug 4

* add unit test for sep_fcn_head: debug 5

* FastSCNN type(dwchannels) changed to tuple.

* t changed to expand_ratio.

* Spaces fixed.

* Update mmseg/models/backbones/fast_scnn.py

Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>

* Update mmseg/models/decode_heads/sep_fcn_head.py

Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>

* Update mmseg/models/decode_heads/sep_fcn_head.py

Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>

* Docstrings fixed.

* Docstrings fixed.

* Inverted Residual kept coherent with mmcl.

* Inverted Residual kept coherent with mmcl. Debug 0

* _make_layer parameters renamed.

* final commit

* Arg scale_factor deleted.

* Expand_ratio docstrings updated.

* final commit

* Readme for Fast-SCNN added.

* model-zoo.md modified.

* fast_scnn README updated.

* Move InvertedResidual module into mmseg/utils.

* test_inverted_residual module corrected.

* test_inverted_residual.py moved.

* encoder_decoder modified to avoid bugs when running PSPNet.
getting_started.md bug fixed.

* Revert "encoder_decoder modified to avoid bugs when running PSPNet. "

This reverts commit dd0aadfb

Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>
2020-08-18 23:33:05 +08:00
Jerry Jiarui XU c8b250df4a Support ResNeSt backbone (#47)
* Support ResNeSt backbone

* fixed avg_down

* add docstring and test

* update table

* update docs and tests

* fixed test

* rename

* refactor splits
2020-08-17 00:54:01 +08:00
robin Han 5ddef979fc add pytorch2onnx part (#12)
* add pytorch2onnx part

* Update according to the latest mmcv

* add docstring

* update docs

* update docs

Co-authored-by: Jiarui XU <xvjiarui0826@gmail.com>
2020-08-14 03:28:21 +08:00
Jerry Jiarui XU 0f702f44af Auto get version info and git hash (#55)
* Auto get version info and git hash

* bump 0.5.1 and update doc

* fixed docs

* Add change log
2020-08-11 19:23:35 +08:00
Jerry Jiarui XU 99e3e5e499 Generalized OHEM (#54)
* Generalized OHEM

* remove config

* update docstring

* fixed sort prob

* fixed valid_mask
2020-08-09 23:49:23 +08:00
ycr a932cbe02e Fix palette type. (#27) 2020-07-23 13:01:31 +08:00
Jerry Jiarui XU e1f5b9231e Support FP16 (#21)
* Support FP16

* add miss folder

* add tests

* remove useless config

* update memory

* reduce config

* migrate fp16 to mmcv

* add model link
2020-07-20 15:17:18 +08:00
Kai Chen bc285bea28 Add pypi deployment (#11)
* add pypi deployment

* remove useless jobs

* fixed typo and cleanup

* delete build.tx

* add change log

Co-authored-by: Jiarui XU <xvjiarui0826@gmail.com>
2020-07-13 20:54:32 +08:00
Jerry Jiarui XU 2fc821ec13 Add test tutorial (#9)
* add test tutorial

* remote torch/torchvision from requirements

* update getting started

* rename drop_out_ratio -> dropout_ratio
2020-07-12 23:53:56 +08:00
Jerry Jiarui XU 6c6330fe85 Add Colab Tutorial (#7)
* add badge

* Created using Colaboratory

* add read docs

* Fixed readthedocs

* fixed colab ref

* add readthedocs.txt

* add link

* fixed modelzoo link

* add missing reference

* fixed docs

* remove relative path in docs

* add colab in README.md

* update docker image

* add newline

* fixed br
2020-07-10 16:55:47 +08:00
Jiarui XU b2724da80b init commit 2020-07-10 02:39:01 +08:00