Commit Graph

581 Commits (master)
 

Author SHA1 Message Date
Zifu Wang 38900d5c51
[Feature] Add support for the focal Tversky loss (#2791)
Thanks for your contribution and we appreciate it a lot. The following
instructions would make your pull request more healthy and more easily
get feedback. If you do not understand some items, don't worry, just
make the pull request and seek help from maintainers.

## Motivation

The focal Tversky loss was proposed in https://arxiv.org/abs/1810.07842.
It has nearly 600 citations and has been shown to be extremely useful
for highly imbalanced (medical) datasets. To add support for the focal
Tversky loss, only few lines of changes are needed for the Tversky loss.

## Modification

Add `gamma` as (optional) argument in the constructor of `TverskyLoss`.
This parameter is then passed to `tversky_loss` to compute the focal
Tversky loss.

## BC-breaking (Optional)

Does the modification introduce changes that break the
backward-compatibility of the downstream repos?
If so, please describe how it breaks the compatibility and how the
downstream projects should modify their code to keep compatibility with
this PR.

## Use cases (Optional)

If this PR introduces a new feature, it is better to list some use cases
here, and update the documentation.

## Checklist

1. Pre-commit or other linting tools are used to fix the potential lint
issues.
2. The modification is covered by complete unit tests. If not, please
add more unit test to ensure the correctness.
3. If the modification has potential influence on downstream projects,
this PR should be tested with downstream projects, like MMDet or
MMDet3D.
4. The documentation has been modified accordingly, like docstring or
example tutorials.

Reopening of previous
[PR](https://github.com/open-mmlab/mmsegmentation/pull/2783).
2023-05-12 16:32:45 +08:00
Timo Kaiser a85675c16f
Created KITTI dataset for segmentation in autonomous driving scenario (#2730)
Note that this PR is a modified version of the withdrawn PR
https://github.com/open-mmlab/mmsegmentation/pull/1748

## Motivation

In the last years, panoptic segmentation has become more into the focus
in reseach. Weber et al.
[[Link]](http://www.cvlibs.net/publications/Weber2021NEURIPSDATA.pdf)
have published a quite nice dataset, which is in the same style like
Cityscapes, but for KITTI sequences. Since Cityscapes and KITTI-STEP
share the same classes and also a comparable domain (dashcam view),
interesting investigations, e.g. about relations in the domain e.t.c.
can be done.

Note that KITTI-STEP provices panoptic segmentation annotations which
are out of scope for mmsegmentation.

## Modification

Mostly, I added the new dataset and dataset preparation file. To
simplify the first usage of the new dataset, I also added configs for
the dataset, segformer and deeplabv3plus.

## BC-breaking (Optional)

No BC-breaking

## Use cases (Optional)

Researchers want to test their new methods, e.g. for interpretable AI in
the context of semantic segmentation. They want to show, that their
method is reproducible on comparable datasets. Thus, they can compare
Cityscapes and KITTI-STEP.

---------

Co-authored-by: CSH <40987381+csatsurnh@users.noreply.github.com>
Co-authored-by: csatsurnh <cshan1995@126.com>
Co-authored-by: 谢昕辰 <xiexinch@outlook.com>
2023-05-09 18:08:31 +08:00
谢昕辰 83e7cc24ea
[Fix] Fix accepting an unexpected argument local-rank in PyTorch 2.0 (#2813) 2023-03-30 16:34:38 +08:00
谢昕辰 db09c540d6
[Doc] Fix inference doc (#2787)
## Motivation

https://github.com/open-mmlab/mmsegmentation/issues/2779
2023-03-26 17:31:08 +08:00
luomaoling ae78cb9d53
[Feature] Support mmseg with NPU backend. (#2768)
## Motivation

Added ascending device support in mmseg.

## Modification

The main modification points are as follows:
We added an NPU device in the DDP scenario and DP scenario when using
the NPU.

## BC-breaking (Optional)

None

## Use cases (Optional)

We tested
[fcn_unet_s5-d16_4x4_512x1024_160k_cityscapes.py](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/unet/fcn_unet_s5-d16_4x4_512x1024_160k_cityscapes.py)
.
2023-03-23 19:42:49 +08:00
Miguel Méndez 49f2a71953
[Feature] Add albu transform (#2710) 2023-03-23 14:35:53 +08:00
CSH d6079bc3f3
Change assignees (#2766)
as title
2023-03-17 15:46:38 +08:00
Waqar Shahid Qureshi 186572a3ce
Update README.md (#2734)
Use the word "Library" instead of using the word "toolbox".
2023-03-10 19:45:39 +08:00
Mr.Fire c269154505
Docs: change MMPose to MMSegmentation (#2651) 2023-02-28 15:58:13 +08:00
MengzhangLI 048c0ba3c3
[Fix] Fix pretrained models of SegNeXt in master branch. (#2653)
## Motivation

Transfer keys of each `mscan_x.pth` pretrained models of SegNeXt, and
upload them in the website.

The reason of transferring keys is we modify original repo
[`.dwconv.dwconv.xxx`](https://github.com/Visual-Attention-Network/SegNeXt/blob/main/mmseg/models/backbones/mscan.py#L21)
to
[`.dwconv.xxx`](https://github.com/open-mmlab/mmsegmentation/blob/master/mmseg/models/backbones/mscan.py#L43).
2023-02-28 15:53:04 +08:00
谢昕辰 49a5931c6e
[Doc] Update MobileNet-v2 result in master (#2657)
## Motivation

As title.
2023-02-28 15:49:23 +08:00
MengzhangLI 70477d21ad
[NEW][Feature]Support SegNeXt(NeurIPS'2022) in master branch (#2600)
## Motivation

Support SegNeXt.

Due to many commits & changed files caused by WIP too long (perhaps it
could be resolved by `git merge` or `git rebase`).

This PR is created only for backup of old PR
https://github.com/open-mmlab/mmsegmentation/pull/2247

Co-authored-by: MeowZheng <meowzheng@outlook.com>
Co-authored-by: Miao Zheng <76149310+MeowZheng@users.noreply.github.com>
2023-02-24 16:08:27 +08:00
Christoph Reich b2fdae7ce7
Fix work-dir flag name in example (#2622)
Just fixes a small typo in the example.
2023-02-21 13:58:17 +08:00
Boyin Zhang 409caf8548
[DEST] add DEST model (#2482)
## Motivation

We are from NVIDIA and we have developed a simplified and
inference-efficient transformer for dense prediction tasks. The method
is based on SegFormer with hardware-friendly design choices, resulting
in better accuracy and over 2x reduction in inference speed as compared
to the baseline. We believe this model would be of particular interests
to those who want to deploy an efficient vision transformer for
production, and it is easily adaptable to other tasks. Therefore, we
would like to contribute our method to mmsegmentation in order to
benefit a larger audience.

The paper was accepted to [Transformer for Vision
workshop](https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsites.google.com%2Fview%2Ft4v-cvpr22%2Fpapers%3Fauthuser%3D0&data=05%7C01%7Cboyinz%40nvidia.com%7Cbf078d69821449d1f4c908dab5e8c7da%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638022308636438546%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=XtSgPQrbVgHxt5L9XkXF%2BGWvc95haB3kKPcHnsVIF3M%3D&reserved=0)
at CVPR 2022, here below are some resource links:
Paper
[https://arxiv.org/pdf/2204.13791.pdf](https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Farxiv.org%2Fpdf%2F2204.13791.pdf&data=05%7C01%7Cboyinz%40nvidia.com%7Cbf078d69821449d1f4c908dab5e8c7da%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638022308636438546%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=X%2FCVoa6PFA09EHfClES36QOa5NvbZu%2F6IDfBVwiYywU%3D&reserved=0)
(Table 3 shows the semseg results)
Code
[https://github.com/NVIDIA/DL4AGX/tree/master/DEST](https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FNVIDIA%2FDL4AGX%2Ftree%2Fmaster%2FDEST&data=05%7C01%7Cboyinz%40nvidia.com%7Cbf078d69821449d1f4c908dab5e8c7da%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638022308636438546%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=9DLQZpEq1cN75%2FDf%2FniUOOUFS1ABX8FEUH02O6isGVQ%3D&reserved=0)
A webinar on its application
[https://www.nvidia.com/en-us/on-demand/session/other2022-drivetraining/](https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.nvidia.com%2Fen-us%2Fon-demand%2Fsession%2Fother2022-drivetraining%2F&data=05%7C01%7Cboyinz%40nvidia.com%7Cbf078d69821449d1f4c908dab5e8c7da%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638022308636438546%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=8jrBC%2Bp3jGxiaW4vtSfhh6GozC3tRqGNjNoALM%2FOYxs%3D&reserved=0)

## Modification

Add backbone(smit.py) and head(dest_head.py) of DEST

## BC-breaking (Optional)

N/A

## Use cases (Optional)

N/A

---------

Co-authored-by: MeowZheng <meowzheng@outlook.com>
2023-02-16 17:42:34 +08:00
Zhongyu Li 486a40995e
add baseline methods for imagenets (#2573)
as title
2023-02-15 21:12:43 +08:00
vansin 6fd82cc8af
docs: Add twitter discord medium youtube link (#2603)
Add twitter discord medium youtube link
2023-02-15 12:03:30 +08:00
JM Xu 8ea3ea39ee
Fix ch-zn doc.md error. (#2567)
Fix doc errors.
2023-02-07 11:51:19 +08:00
Jonas Sitzmann 5b438f45b6
change typo in CrossEntropyLoss (#2534)
The documentation of the use_sigmoid argument in CrossEntropyLoss
currently suggests the sigmoid would be applied in addition to the
softmax function. This change fixes this typo.
2023-01-30 21:56:17 +08:00
Siddharth Ancha 190063fbb4
[Fix] Fix `reduce_zero_label` in evaluation (#2504)
## Motivation

Through this PR, I (1) fix a bug, and (2) perform some associated cleanup, and (3) add a unit test. The bug occurs during evaluation when two options -- `reduce_zero_label=True`, and custom classes are used. The bug was that the `reduce_zero_label` is not properly propagated (see details below).

## Modification

1. **Bugfix**

The bug occurs [in the initialization of `CustomDataset`](5d49918b3c/mmseg/datasets/custom.py (L108-L110)) where the `reduce_zero_label` flag is not propagated to its member `self.gt_seg_map_loader_cfg`:

```python
self.gt_seg_map_loader = LoadAnnotations(
) if gt_seg_map_loader_cfg is None else LoadAnnotations(
    **gt_seg_map_loader_cfg)
```

Because the `reduce_zero_label` flag was not being propagated, the zero label reduction was being [unnecessarily and explicitly duplicated during the evaluation](5d49918b3c/mmseg/core/evaluation/metrics.py (L66-L69)).

As pointed in a previous PR (#2500), `reduce_zero_label` must occur before applying the `label_map`. Due to this bug, the order gets reversed when both features are used simultaneously.

This has been fixed to:

```python
self.gt_seg_map_loader = LoadAnnotations(
    reduce_zero_label=reduce_zero_label, **gt_seg_map_loader_cfg)
```

2. **Cleanup**

Due to the bug fix, since both `reduce_zero_label` and `label_map` are being applied in `get_gt_seg_map_by_idx()` (i.e. `LoadAnnotations.__call__()`), the evaluation does not need perform them anymore. However, for backwards compatibility, the evaluation keeps previous input arguments.

This was pointed out for `label_map` in a previous issue (#1415) that the `label_map` should  not be applied in the evaluation. This was handled by [passing an empty dict](5d49918b3c/mmseg/datasets/custom.py (L306-L311)):

```python
# as the labels has been converted when dataset initialized
# in `get_palette_for_custom_classes ` this `label_map`
# should be `dict()`, see
# https://github.com/open-mmlab/mmsegmentation/issues/1415
# for more ditails
label_map=dict(),
reduce_zero_label=self.reduce_zero_label))
```

Similar to this, I now also set `reduce_label=False` since it is now also being handled by `get_gt_seg_map_by_idx()` (i.e. `LoadAnnotations.__call__()`).

3. **Unit test**

I've added a unit test that tests the `CustomDataset.pre_eval()` function when `reduce_zero_label=True` and custom classes are used. The test fails on the original `master` branch but passes with this fix.

## BC-breaking (Optional)

I do not anticipate this change braking any backward-compatibility.

## Checklist

- [x] Pre-commit or other linting tools are used to fix the potential lint issues.
  - _I've fixed all linting/pre-commit errors._
- [x] The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  - _I've added a test that passes when the fix is introduced, and fails on the original master branch._
- [x] If the modification has potential influence on downstream projects, this PR should be tested with downstream projects, like MMDet or MMDet3D.
  - _I don't think this change affects MMDet or MMDet3D._
- [x] The documentation has been modified accordingly, like docstring or example tutorials.
  - _This change fixes an existing bug and doesn't require modifying any documentation/docstring._
2023-01-30 12:01:20 +08:00
谢昕辰 ac5d650526
[CI] Upgrade the version of isort to fix lint error in master branch (#2520)
## Motivation

https://github.com/open-mmlab/mmeval/pull/85

---------

Co-authored-by: Miao Zheng <76149310+MeowZheng@users.noreply.github.com>
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-01-29 20:21:56 +08:00
Siddharth Ancha 64ad5871ae
[Fix] Fix ignore class id from -1 to 255 in `master` (#2515)
## Motivation

This fixes #2493. When the `label_map` is created, the index for ignored
classes was being set to -1, whereas the index that is actually ignored
is 255. This worked indirectly since -1 was underflowed to 255 when
converting to uint8.

The same fix was made in the 1.x by #2332 but this fix was never made to
`master`.

## Modification

The only small modification is setting the index of ignored classes to
255 instead of -1.

## Checklist

- [x] Pre-commit or other linting tools are used to fix the potential
lint issues.
  - _I've fixed all linting/pre-commit errors._
- [x] The modification is covered by complete unit tests. If not, please
add more unit test to ensure the correctness.
- _No unit tests need to be added. Unit tests that are affected were
modified.
- [x] If the modification has potential influence on downstream
projects, this PR should be tested with downstream projects, like MMDet
or MMDet3D.
  - _I don't think this change affects MMDet or MMDet3D._
- [x] The documentation has been modified accordingly, like docstring or
example tutorials.
- _This change fixes an existing bug and doesn't require modifying any
documentation/docstring._
2023-01-28 22:53:29 +08:00
Siddharth Ancha 5d49918b3c
[Fix] Switch order of `reduce_zero_label` and applying `label_map` (#2500)
## Motivation

I want to fix a bug through this PR. The bug occurs when two options --
`reduce_zero_label=True`, and custom classes are used.
`reduce_zero_label` remaps the GT seg labels by remapping the zero-class
to 255 which is ignored. Conceptually, this should occur *before* the
`label_map` is applied, which maps *already reduced labels*. However,
currently, the `label_map` is applied before the zero label is reduced.

## Modification

The modification is simple:
- I've just interchanged the order of the two operations by moving 4
lines from bottom to top.
- I've added a test that passes when the fix is introduced, and fails on
the original `master` branch.

## BC-breaking (Optional)

I do not anticipate this change braking any backward-compatibility.

## Checklist

- [x] Pre-commit or other linting tools are used to fix the potential
lint issues.
  - _I've fixed all linting/pre-commit errors._
- [x] The modification is covered by complete unit tests. If not, please
add more unit test to ensure the correctness.
  - _I've added a unit test._ 
- [x] If the modification has potential influence on downstream
projects, this PR should be tested with downstream projects, like MMDet
or MMDet3D.
  - _I don't think this change affects MMDet or MMDet3D._
- [x] The documentation has been modified accordingly, like docstring or
example tutorials.
- _This change fixes an existing bug and doesn't require modifying any
documentation/docstring._
2023-01-19 15:01:40 +08:00
Shanghua Gao 6cb7fe0c51
Imagenet-s dataset for large-scale semantic segmentation (#2480)
## Motivation

Based on the ImageNet dataset, we propose the ImageNet-S dataset has 1.2 million training images and 50k high-quality semantic segmentation annotations to support unsupervised/semi-supervised semantic segmentation on the ImageNet dataset.

paper:
Large-scale Unsupervised Semantic Segmentation (TPAMI 2022)
[Paper link](https://arxiv.org/abs/2106.03149)

## Modification

1. Support imagenet-s dataset and its' configuration
2. Add the dataset preparation in the documentation
2023-01-16 16:42:19 +08:00
MengzhangLI ba7608cefe
[Fix] Fix no revert_sync_batchnorm in image_demo of master branch (#2489)
Fix: https://github.com/open-mmlab/mmsegmentation/issues/2478
2023-01-16 15:40:29 +08:00
谢昕辰 ed83982876
bump v0.30.0 (#2462) 2023-01-11 17:39:09 +08:00
whooray 35cd28bb5f Support for occludedface for external use (#2463)
## Motivation

Please describe the motivation of this PR and the goal you want to
achieve through this PR.
support get_classes, get_palette for Occluded Face dataset. 

## Modification

Please briefly describe what modification is made in this PR.
add occludedface_classes()
add occludedface_palette()
modified dataset_aliases
2023-01-11 13:59:27 +08:00
Miao Zheng a6ea630e62 [Fix]Fix circile ci env (#2467)
## Motivation

1. circle ci failed without zlib1g-dev installation
3. add approve button

## Modification

1. .circleci/
2023-01-11 13:59:27 +08:00
谢昕辰 b312e796d6 [Projects] Add 'Projects/' folder, and the first example project in 0.x (#2457)
## Motivation

Introducing new models and features into OpenMMLab's algorithm libraries
has long been complained to be troublesome due to the rigorous
requirements on code quality, which could hinder the fast iteration of
SOTA models and might discourage potential contributors from sharing
their latest outcome here.

Ref: https://github.com/open-mmlab/mmsegmentation/pull/2412

## Modification

This PR adds a new `projects/` folder, which will be a place for some
experimental models/features. Implementations inside might be not quite
perfect but already fine to produce some exciting results. We hope that
this PR can help us better embrace the contribution from our community.
We also add the first example project to illustrate what we expect a
good project to have.
2023-01-11 13:59:27 +08:00
Vinson bedec406e1 Fix the docstring error in the class PascalContextDataset59 (#2450)
## Motivation

The docstring in the class PascalContextDataset59 is misleading. Try to fix it.

## Modification

The docstring in the class PascalContextDataset59 is changed.
2023-01-11 13:59:27 +08:00
whooray c143f96c1d Add high quality synthetic face occlusion dataset link to readme. (#2453)
## Motivation

Add link for high quality synthetic face occlusion dataset.

## Modification

readme.md
2023-01-11 13:59:27 +08:00
Miao Zheng 632fb9b651 [Fix]Fix the deprecation of np.float and fix ci configuration (#2451)
## Motivation

1. numpy from 1.24 deprecated the aliases np.object, np.bool, np.float,
np.complex, np.str, and np.int
https://numpy.org/devdocs/release/1.24.0-notes.html

2. timm needs to pytorch>=1.7, so ignore test timm in pytorch 1.5 and
1.6

3. Remove install pillow as it doesn't test torchvision < 0.5

## Modification

1. np.float->np.float32
 
2. torch >= '1.7.0' -> matrix.torch != '1.5.1+cu101' && matrix.torch !=
'1.6.0+cu101' (as '1.10' < '1.7'

3. Remove install pillow
2023-01-11 13:59:27 +08:00
MilkClouds c0515a1be5 Fixed deadlock issue related with MMSegWandbHook (#2398)
Co-authored-by: WangYudong <yudong.wang@akane.waseda.jp>
2023-01-11 13:59:27 +08:00
MengzhangLI 320d8c60f3 [Fix] Fix KNet IterativeDecodeHead bug in v0.x branch #2333
* add comment
2023-01-11 13:59:27 +08:00
smttsp 2aeb010e7a [FIX] fixing bug in `test_cfg` for U-Net _base_ script
tuples were required as default input, but int was given
2023-01-11 13:59:27 +08:00
xiexinch bc9b3388f2 [CI] Add torch1.13 checking in CI (#2331)
add torch1.13 in ci

remove coverage and fix cuda version
2023-01-11 13:59:27 +08:00
jinwonkim93 2e840ac696 gitlab.com/pycqa/flake8 no longer exists (#2309) 2023-01-11 13:59:27 +08:00
jinwonkim93 a1d8174017 [Feature] Support Delving into High-Quality Synthetic Face Occlusion Segmentation Datasets (#2194)
add custom dataset

add face occlusion dataset

add config file for occlusion face

fix format

update prepare.md

formatting

formatting

fix typo error for doc

update downloading process

Update dataset_prepare.md

PR fix version to original repository. change to original repository.
2023-01-11 13:58:44 +08:00
Miao Zheng 7b09967fcc
Merge pull request #2257 from xiexinch/bumpv0.29.1
bumpv0.29.1
2022-11-03 16:19:52 +08:00
xiexinch 47c7ed5dec bumpv0.29.1 2022-11-03 14:37:38 +08:00
Jinhee Lee eb5ea47d9c
Update customize_datasets.md (#2249) 2022-11-01 19:14:36 +08:00
MengzhangLI b42c487767
[Doc] Update FAQ doc about binary segmentation and ReduceZeroLabel (#2206)
* [Doc] Update FAQ doc about binary segmentation and ReduceZeroLabel

* update

* modify

* fix typo and add modification

* fix typo

* fix comments

* fix order

* fix

* fix

* Update docs/en/faq.md

* Update docs/zh_cn/faq.md

Co-authored-by: Miao Zheng <76149310+MeowZheng@users.noreply.github.com>
2022-10-28 21:44:37 +08:00
谢昕辰 6db09358f0
modify results (#2114) 2022-10-27 13:08:34 +08:00
zhijiejia 8dbbdd8c17
[Feature] Add model ensemble tools (#2218)
* [Feature] Add model ensemble tool

* [Enhance] Add en and zh_cn instructions for model_ensemble

* [Enhance] Add default-value for --out and modify instruction

* [Enhance] Add arg-type for --out

* [Enhance] Delete redundant code
2022-10-24 19:03:48 +08:00
Xu Lin 76a5138ac8
add MMYOLO desc in README (#2219) 2022-10-21 19:57:39 +08:00
MengzhangLI a68e7c2823
[Fix] Fix PoolFormer mIoU result (#2190) 2022-10-18 22:58:21 +08:00
谢昕辰 04afdb3f27
use syncbn (#2207) 2022-10-18 20:13:53 +08:00
谢昕辰 356215bf58
Bump v0.29.0 (#2167)
* bump v0.29.0

* remove 2159
2022-10-10 14:06:25 +08:00
Miao Zheng 5811b3f74d
[Fix] Ignore timm test in ircleCI (#2162) 2022-10-09 16:13:08 +08:00
Miao Zheng abb0932966
Fix lint (#2159) 2022-10-08 17:36:56 +08:00
mangelroman 963b8edc32
Add missing dependencies to torchserve docker file (#2133) 2022-10-08 16:33:03 +08:00