938 Commits

Author SHA1 Message Date
Yang-ChangHui
1e937961b3
[CodeCamp2023-367] Add pp_mobileseg model (#3239) 2023-08-09 23:57:01 +08:00
yeedrag
817c18bf2c
[Fix] Added ignore_index and one hot encoding for dice loss (#3237)
Added ignore_index param to forward(),
also implemented one hot encoding to ensure the dims of target matches
pred.

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

Please describe the motivation of this PR and the goal you want to
achieve through this PR.

Attempted to solve the problems mentioned by #3172 

## Modification

Please briefly describe what modification is made in this PR.

Added ignore_index into forward function (although the dice loss itself
does not actually take account for it for some reason).
Added _expand_onehot_labels_dice, which takes the target with shape [N,
H, W] into [N, num_classes, H, W].

## 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.

This is my first time contributing to open-source code, so I might have
made some stupid mistakes. Please don't hesitate to point it out.
2023-08-09 10:16:22 +08:00
angiecao
4927b0ed03
[Fix] Fix module PascalContextDataset (#3235)
## Motivation

- 'PascalContextDataset' object has no attribute 'file_client', it will
cause an error.
- The attribute ‘ann_file’ is not allowed to be empty, otherwise, an
error will be reported.

## Modification
- Replace file_client with fileio
2023-08-09 10:15:50 +08:00
CastleDream
1235217667
[CodeCamp2023-154] Add semantic label to the segmentation visualization results (#3229)
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

[Add semantic label to the segmentation visualization results
分割可视化结果中加上语义信息
#154](https://github.com/open-mmlab/OpenMMLabCamp/discussions/154)

corresponding issue: [跑出来结果之后怎么在结果图片上获取各个语意部分的区域信息?
#2578](https://github.com/open-mmlab/mmsegmentation/issues/2578)

## Modification

1. mmseg/apis/inference.py, add withLabels in visualizer.add_datasample
call, to indicate whether add semantic label
2. mmseg/visualization/local_visualizer.py, add semantic labels by
opencv; modify the demo comment description
3. mmseg/utils/__init__.py, add bdd100k datasets to test
local_visualizer.py

**Current visualize result**
<img width="637" alt="image"
src="https://github.com/open-mmlab/mmsegmentation/assets/35064479/6ef6ce02-1d82-46f8-bde9-a1d69ff62df8">


**Add semantic label**
<img width="637" alt="image"
src="https://github.com/open-mmlab/mmsegmentation/assets/35064479/00716679-b43a-4794-8499-9bfecdb4b78b">

## Test results
**tests/test_visualization/test_local_visualizer.py** test
results:(MMSegmentation/tests/data/pseudo_cityscapes_dataset/leftImg8bit/val/frankfurt/frankfurt_000000_000294_leftImg8bit.png)
<img width="643" alt="image"
src="https://github.com/open-mmlab/mmsegmentation/assets/35064479/6792b7d2-2512-4ea9-8500-1a7ed2d5e0dc">

**demo/inference_demo.ipynb** test results:
<img width="966" alt="image"
src="https://github.com/open-mmlab/mmsegmentation/assets/35064479/dfc0147e-fb1a-490a-b6ff-a8b209352d9b">

-----
## Drawbacks
config opencv thickness according to image size
<img width="496" alt="image"
src="https://github.com/open-mmlab/mmsegmentation/assets/35064479/0a54d72c-62b1-422c-89ae-69dc753fe0fc">

I have no idea of dealing with label overlapping for the time being
2023-08-01 14:38:33 +08:00
谢昕辰
30a3f94f3e
bumpv1.1.1 (#3223) v1.1.1 2023-07-24 15:28:21 +08:00
谢昕辰
857f854b61
[Enhancement] Remove batch inference assertion (#3210)
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

https://github.com/open-mmlab/mmsegmentation/issues/3181
https://github.com/open-mmlab/mmsegmentation/issues/2965
https://github.com/open-mmlab/mmsegmentation/issues/2644
https://github.com/open-mmlab/mmsegmentation/issues/1645
https://github.com/open-mmlab/mmsegmentation/issues/1444
https://github.com/open-mmlab/mmsegmentation/issues/1370
https://github.com/open-mmlab/mmsegmentation/issues/125

## Modification

Remove the assertion at data_preprocessor

## 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.
2023-07-20 09:45:04 +08:00
Hongyuan Zhang
20fa12912f
[Fix] Albumentations default key mapping mismatch (#3195)
## Modification

Fix Albumentations default key mapping mismatch as mentioned in [issue #
3179](https://github.com/open-mmlab/mmsegmentation/issues/3179) by
changing `self.keymap_to_albu = { 'img': 'image', 'gt_masks': 'masks'}`
to `self.keymap_to_albu = { 'img': 'image', 'gt_seg_map': 'mask'}`

## Use cases (Optional)

Example albu config
```
crop_size = (512, 512)

albu_train_transforms = [
    dict(
        type='PadIfNeeded',
        min_height=crop_size[0]*2,
        min_width=crop_size[1]*2,
        border_mode=0,
        always_apply=True),
    dict(type='Flip', always_apply=True),
    dict(type='Rotate', limit=(-180, 180), interpolation=4, always_apply=True),
    dict(type='RandomScale', scale_limit=0.1, interpolation=4, always_apply=True),
    dict(
        type='ElasticTransform',
        alpha=20, 
        sigma=15, 
        interpolation=4, 
        border_mode=0,
        mask_value=(0, 0, 0),
        approximate=True,
        same_dxdy=True,
        p=0.8),
    dict(type='ColorJitter', brightness=0.2, contrast=0.1, saturation=0.2, hue=0.2, always_apply=True),
    dict(type='AdvancedBlur', p=0.5),
    dict(type='CenterCrop', height=crop_size[0], width=crop_size[1], always_apply=True)
]
```

Example training pipeline without specifying `keymap`
```
train_pipeline = [
    dict(type='LoadImageFromFile'),
    dict(type='LoadAnnotations', reduce_zero_label=False),
    dict(
        type='Albu',
        transforms=albu_train_transforms,
        ),
    dict(type='Resize', scale=crop_size, keep_ratio=False, interpolation='lanczos'), 
    dict(type='PackSegInputs')
]
```

Example viz_dataset before the issue fixing
![A thaliana Lucia 07 2022 col-0 30m-1h after Infection 22162057 object
id
0](https://github.com/open-mmlab/mmsegmentation/assets/66273343/5431472a-83fd-485f-aeb7-c65f27f1993d)

Example viz_dataset after the issue fixing
![A thaliana Lucia 07 2022 col-0 30m-1h after Infection 22162057 object
id
0](https://github.com/open-mmlab/mmsegmentation/assets/66273343/3d6d4937-41f0-4a18-ae47-35bc43d78843)

---------

Co-authored-by: xiexinch <xiexinch@outlook.com>
2023-07-14 12:44:03 +08:00
ChG
580f63e2ed
use correct link addresses for datasets in README_zh-CN (#3174)
## Motivation

Some links for datasets in README_zh-CN don't point to the correct
addresses.

## Modification

Update some links in README_zh-CN.

Co-authored-by: xiexinch <xiexinch@outlook.com>
2023-07-14 12:43:45 +08:00
谢昕辰
5fc197900f
[Fix] Update ddrnet readme (#3198) 2023-07-14 11:16:16 +08:00
CastleDream
057155d3ab
[Feature] add bdd100K datasets (#3158)
## Motivation
Integrate [BDD100K](https://paperswithcode.com/dataset/bdd100k) dataset.
It shares the same classes as Cityscapes, and it's commonly used for
evaluating segmentation/detection tasks in driving scenes, such as in
[RobustNet](https://arxiv.org/abs/2103.15597),
[WildNet](https://github.com/suhyeonlee/WildNet).

Enhancement for Add BDD100K Dataset #2808

---------

Co-authored-by: xiexinch <xiexinch@outlook.com>
2023-07-14 10:09:16 +08:00
ZiAn-Su
7254f5330f
[Fix] Fix SegTTAModel with no attribute '_gt_sem_seg' error (#3152)
## Motivation

When using the - tta command for multi-scale prediction, and the test
set is not annotated, although format_only has been set true in
test_evaluator, but SegTTAModel class still threw error 'AttributeError:
'SegDataSample' object has no attribute '_gt_sem_seg''.

## Modification

The reason is SegTTAModel didn't determine if there were annotations in
the dataset, so I added the code to make the judgment and let the
program run normally on my computer.
2023-07-13 17:06:06 +08:00
谢昕辰
067a95e40b
[Fix] fix mim search error (#3194) 2023-07-13 16:26:08 +08:00
OliverGrace
ac78b1308d
[Fix] Fix train map path for coco-stuff164k.py (#3187) 2023-07-12 15:29:45 +08:00
xiexinch
00790766af Release MMSegmentation v1.1.0 v1.1.0 2023-07-04 11:13:57 +08:00
谢昕辰
e4c1865a82
Bump1.1 (#3140)
Co-authored-by: CSH <40987381+csatsurnh@users.noreply.github.com>
2023-07-04 11:11:30 +08:00
谢昕辰
8806b4e548
[Fix] Fix visualizor (#3154)
## Motivation

**Current visualize result**


![rs-dev](https://github.com/open-mmlab/mmsegmentation/assets/15952744/147ea3f7-f632-457b-b257-031199320825)

**Fixed the visualization result**



![rs-fix](https://github.com/open-mmlab/mmsegmentation/assets/15952744/98a86025-5a1e-4c2b-83e0-653dd659ba79)


## Modification

remove mmengine `draw_binary_masks` api
2023-07-03 09:43:00 +08:00
谢昕辰
cc74c5c3fe
[Enhancement] update segformer default pretrain to configs (#3153) 2023-06-30 16:40:13 +08:00
谢昕辰
c55d7a721e
[Feature] support mim download dataset (#3089)
## Motivation

Please describe the motivation of this PR and the goal you want to
achieve through this PR.

## Modification

- add dataset-index.yml

## Dependencies

- [ ] https://github.com/open-mmlab/mim/pull/212
2023-06-28 17:57:22 +08:00
谢昕辰
b633093c27
[Dev] update owners (#3143) 2023-06-28 16:15:54 +08:00
谢昕辰
3dca9a0a5c
[Project] add x-decoder link (#3142) 2023-06-28 16:15:37 +08:00
谢昕辰
a2efc04a17
[CI] fix merge stage (#3138) 2023-06-26 17:10:42 +08:00
谢昕辰
ffb7e2e239
[Fix] Fix dependency (#3136)
## Motivation

Change the dependency `mmcls` to `mmpretrain`

## Modification

- modify `mmcls` to `mmpretrain`
- modify CI requirements

## BC-breaking (Optional)

If users have installed mmcls but not install mmpretrain, it might raise some error.
2023-06-26 16:02:37 +08:00
masaaki
d3f2922ff5
[Project] Medical semantic seg dataset: Chest x ray images with pneumothorax masks (#2687) 2023-06-25 18:24:49 +08:00
masaaki
c923f4d25b
[Project] Medical semantic seg dataset: Crass (#2690) 2023-06-25 16:54:38 +08:00
masaaki
c1de52a8be
[Project] Medical semantic seg dataset: Covid 19 ct cxr (#2688) 2023-06-25 16:36:17 +08:00
masaaki
e4db1f20c9
[Project] Medical semantic seg dataset: Pannuke (#2683) 2023-06-25 15:57:40 +08:00
masaaki
30e3b49b0b
[Project] Medical semantic seg dataset: Pcam (#2684) 2023-06-25 15:44:43 +08:00
masaaki
942b054426
[Project] Medical semantic seg dataset: 2pm vessel (#2685) 2023-06-25 15:05:00 +08:00
masaaki
ac241117cb
[Project] Medical semanti seg dataset: Fusc2021 (#2682) 2023-06-25 14:11:00 +08:00
masaaki
d934d10148
[Project] Medical semantic seg dataset: Rite (#2680) 2023-06-25 13:14:29 +08:00
masaaki
5a9cfa9193
[Project] Medical dataset: Kvasir seg aliyun (#2678) 2023-06-25 12:57:18 +08:00
masaaki
2ea4784012
[Project] Medical semantic seg dataset: Kvasir seg (#2677) 2023-06-25 11:50:46 +08:00
legendchilli
3cc9d30d04
[Project] Medical semantic seg dataset: ISIC-2017 Task1 (#2709) 2023-06-22 11:03:34 +08:00
legendchilli
b24f422a95
[Project] Medical semantic seg dataset: ISIC-2016 Task1 (#2708) 2023-06-21 16:39:07 +08:00
tianbin li
78e036c36f
[Project] Medical semantic seg dataset: orvs (#2728) 2023-06-21 15:16:27 +08:00
tianbin li
6333dc14f3
[Project] Medical semantic seg dataset: dr_hagis (#2729) 2023-06-21 14:41:58 +08:00
tianbin li
81edd98c05
[Project] Medical semantic seg dataset: conic2022 (#2725) 2023-06-21 14:24:56 +08:00
tianbin li
65c8d77d62
[Project] Medical semantic seg dataset: chest_image_pneum (#2727) 2023-06-20 21:13:32 +08:00
tianbin li
041f1f0f4f
[Project] Medical semantic seg dataset: breast_cancer_cell_seg (#2726) 2023-06-20 21:09:04 +08:00
tianbin li
b5fc5abcc4
[Project] Medical semantic seg dataset: consep (#2724) 2023-06-20 16:55:47 +08:00
Sizheng Guo
f419f618a1
[Project] add Gamma Task3 dataset project in dev-1.x (#2695) 2023-06-20 15:28:46 +08:00
Sizheng Guo
4feba3114f
[Project] Medical semantic seg dataset: bccs (#2861) 2023-06-20 11:39:22 +08:00
谢昕辰
b8b6ee6017
fix assert (#3119) 2023-06-19 18:34:52 +08:00
Leon Hamnett
b0635ff783
[Enhancement] Change assertion logic inference cfg.model.test_cfg (#3012)
## Motivation

In encode_decoder.py , assertion logic is not working correctly if user
modifes cfg.test_cfg and defines it in a dictionary format. See:
https://github.com/open-mmlab/mmsegmentation/issues/3011

## Modification

Slight change to assertion behaviour to change assertion depending on if
received test_cfg object is a dict or not.

## BC-breaking (Optional)

Unsure - I believe this will not break any downstream tasks as the
previous logic is still included

## Use cases (Optional)

n/a

---------

Co-authored-by: xiexinch <xiexinch@outlook.com>
2023-06-19 18:12:04 +08:00
谢昕辰
20adcfa355
[Dev] update benchmark script (#3116) 2023-06-19 16:59:33 +08:00
jinxianwei
bb93b482b8
[Feature] huasdorff distance loss (#2820)
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

Add Huasdorff distance loss

---------

Co-authored-by: xiexinch <xiexinch@outlook.com>
2023-06-19 14:26:08 +08:00
谢昕辰
b2f4b4fe33
[Fix] fix inferencer ut (#3117) 2023-06-19 13:08:04 +08:00
WRH
c30d5060f1
[Fix] Robust mapping from image path to seg map path (#3091)
## Motivation

Suppose an image is named `jpg.jpg` and its corresponding segmap is
named `jpg.png`.
The original implementation will try to read segmap from `png.png` and
causes FileNotfoundError

## Modification

Only replace the suffix, instead of full string search and replacement. 

## BC-breaking (Optional)

Probably no. 

## Use cases (Optional)


## 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.

---------

Co-authored-by: 谢昕辰 <xiexinch@outlook.com>
Co-authored-by: CSH <40987381+csatsurnh@users.noreply.github.com>
2023-06-16 11:07:17 +08:00
Xu CAO
279b89783e
[Feature] enhance swin pretrained model loading (#3097)
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

Enhance pretrained SwinTransformer loading when setting non-standard
backbone `depths`.

## Modification

Enhance pretrained SwinTransformer loading when setting non-standard
backbone `depths`.

## 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.

---------

Co-authored-by: SheffieldCao <1751899@tongji.edu.cn>
2023-06-16 10:43:34 +08:00
shi gengtian
e5cb1d2675
[Docker] update Dockerfile libgl1-mesa-dev (#3095)
add libgl1-mesa-dev

---------

Co-authored-by: 谢昕辰 <xiexinch@outlook.com>
Co-authored-by: CSH <40987381+csatsurnh@users.noreply.github.com>
2023-06-16 10:15:33 +08:00