## 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._
## 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._
## 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._
## 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
## 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
## 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.
## Motivation
The docstring in the class PascalContextDataset59 is misleading. Try to fix it.
## Modification
The docstring in the class PascalContextDataset59 is changed.
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.
* [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
* logger hooks samples updated
* [Docs] Details for WandBLoggerHook Added
* [Docs] lint test pass
* [Enhancement] .dev Python files updated to get better performance and quality
* [Docs] Details for WandBLoggerHook Added
* [Docs] lint test pass
* [Enhancement] .dev Python files updated to get better performance and quality
* [Enhancement] lint test passed
* [Enhancement] Change Some Line from Previous to Support Python<3.9
* Update .dev/gather_models.py
Co-authored-by: Miao Zheng <76149310+MeowZheng@users.noreply.github.com>
* [Fix] Fix mmseg.api.inference inference_segmentor
Motivation
Fix inference_segmentor not working with multiple images path or images. List[str/ndarray]
Modification
- process images if instance is list
* fix typo
* Update mmseg/apis/inference.py
Co-authored-by: Hakjin Lee <nijkah@gmail.com>
Co-authored-by: Hakjin Lee <nijkah@gmail.com>
* fix binary
* add ut
* fix ut
* restore metric computation
* remove metric ut update
* set out_channels by num_classes
* replace num_classes in encoder_decoder
* update props setting and fix ut
* update ut
* minor change
* update warning