Commit Graph

965 Commits (test-1.2.0)
 

Author SHA1 Message Date
xiexinch 1ddb642c72 update vpd test case 2023-09-28 09:58:05 +08:00
李开宇 cf8fc7bd49
[Fix] fix wrong variables passing for `set_dataset_meta` (#3348) 2023-09-26 18:42:27 +08:00
谢昕辰 2b3d91a76e
[Dev] add san metafile (#3353) 2023-09-26 18:39:21 +08:00
谢昕辰 ffbc7d7b7b
[Dev] update test case (#3352) 2023-09-26 18:22:57 +08:00
谢昕辰 4278fff1aa
[Dev] update requirement (#3351) 2023-09-26 18:17:44 +08:00
angiecao 608e319eb6
[Feature] Support Side Adapter Network (#3232)
## Motivation
Support SAN for Open-Vocabulary Semantic Segmentation
Paper: [Side Adapter Network for Open-Vocabulary Semantic
Segmentation](https://arxiv.org/abs/2302.12242)
official Code: [SAN](https://github.com/MendelXu/SAN)

## Modification
- Added the parameters of backbone vit for implementing the image
encoder of CLIP.
- Added text encoder code.
- Added segmentor multimodel encoder-decoder code for open-vocabulary
semantic segmentation.
- Added SideAdapterNetwork decode head code.
- Added config files for train and inference.
- Added tools for converting pretrained models.
- Added loss implementation for mask classification model, such as SAN,
Maskformer and remove dependency on mmdetection.
- Added test units for text encoder, multimodel encoder-decoder, san
decode head and hungarian_assigner.

## Use cases
### Convert Models
**pretrained SAN model**
The official pretrained model can be downloaded from
[san_clip_vit_b_16.pth](https://huggingface.co/Mendel192/san/blob/main/san_vit_b_16.pth)
and
[san_clip_vit_large_14.pth](https://huggingface.co/Mendel192/san/blob/main/san_vit_large_14.pth).
Use tools/model_converters/san2mmseg.py to convert offcial model into
mmseg style.
`python tools/model_converters/san2mmseg.py <MODEL_PATH> <OUTPUT_PATH>`

**pretrained CLIP model**
Use the CLIP model provided by openai to train SAN. The CLIP model can
be download from
[ViT-B-16.pt](https://openaipublic.azureedge.net/clip/models/5806e77cd80f8b59890b7e101eabd078d9fb84e6937f9e85e4ecb61988df416f/ViT-B-16.pt)
and
[ViT-L-14-336px.pt](https://openaipublic.azureedge.net/clip/models/3035c92b350959924f9f00213499208652fc7ea050643e8b385c2dac08641f02/ViT-L-14-336px.pt).
Use tools/model_converters/clip2mmseg.py to convert model into mmseg
style.
`python tools/model_converters/clip2mmseg.py <MODEL_PATH> <OUTPUT_PATH>`

### Inference
test san_vit-base-16 model on coco-stuff164k dataset
`python tools/test.py
./configs/san/san-vit-b16_coco-stuff164k-640x640.py
<TRAINED_MODEL_PATH>`

### Train
test san_vit-base-16 model on coco-stuff164k dataset
`python tools/train.py
./configs/san/san-vit-b16_coco-stuff164k-640x640.py --cfg-options
model.pretrained=<PRETRAINED_MODEL_PATH>`

## Comparision Results
### Train on COCO-Stuff164k
|                 |       | mIoU  | mAcc  | pAcc  |
| --------------- | ----- | ----- | ----- | ----- |
| san-vit-base16  | official  | 41.93 | 56.73 | 67.69 |
|                 | mmseg | 41.93 | 56.84 | 67.84 |
| san-vit-large14 | official  | 45.57 | 59.52 | 69.76 |
|                 | mmseg | 45.78 | 59.61 | 69.21 |

### Evaluate on Pascal Context
|                 |       | mIoU  | mAcc  | pAcc  |
| --------------- | ----- | ----- | ----- | ----- |
| san-vit-base16  | official  | 54.05 | 72.96 | 77.77 |
|                 | mmseg | 54.04 | 73.74 | 77.71 |
| san-vit-large14 | official  | 57.53 | 77.56 | 78.89 |
|                 | mmseg | 56.89 | 76.96 | 78.74 |

### Evaluate on Voc12Aug
|                 |       | mIoU  | mAcc  | pAcc  |
| --------------- | ----- | ----- | ----- | ----- |
| san-vit-base16  | official  | 93.86 | 96.61 | 97.11 |
|                 | mmseg | 94.58 | 97.01 | 97.38 |
| san-vit-large14 | official  | 95.17 | 97.61 | 97.63 |
|                 | mmseg | 95.58 | 97.75 | 97.79 |

---------

Co-authored-by: CastleDream <35064479+CastleDream@users.noreply.github.com>
Co-authored-by: yeedrag <46050186+yeedrag@users.noreply.github.com>
Co-authored-by: Yang-ChangHui <71805205+Yang-Changhui@users.noreply.github.com>
Co-authored-by: Xu CAO <49406546+SheffieldCao@users.noreply.github.com>
Co-authored-by: xiexinch <xiexinch@outlook.com>
Co-authored-by: 小飞猪 <106524776+ooooo-create@users.noreply.github.com>
2023-09-20 21:20:26 +08:00
谢昕辰 1471d1e529
bumpv1.1.2 (#3339) 2023-09-20 13:44:56 +08:00
Peng Lu 9c45a94cee
[Fix] fix import error raised by ldm (#3338) 2023-09-20 12:45:05 +08:00
zhen6618 56a40d78ab
Use the pytorch-grad-cam tool to visualize Class Activation Maps (CAM) (#3324)
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

Use the pytorch-grad-cam tool to visualize Class Activation Maps (CAM).

## Modification

Use the pytorch-grad-cam tool to visualize Class Activation Maps (CAM).

requirement: pip install grad-cam

run commad: python tools/analysis_tools/visualization_cam.py

## 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. The documentation has been modified accordingly, like docstring or
example tutorials.
2023-09-20 11:08:47 +08:00
Peng Lu 743171ddef
[Feature] Support inference and visualization of VPD (#3331)
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

Support inference and visualization of VPD

## Modification

1. add a new VPD model that does not generate black border in
predictions
2. update `SegLocalVisualizer` to support depth visualization
3. update `MMSegInferencer` to support save predictions of depth
estimation in method `postprocess`

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

Run inference with VPD using the this command

```sh
python demo/image_demo_with_inferencer.py demo/classroom__rgb_00283.jpg vpd_depth --out-dir vis_results
```

The following image will be saved under `vis_results/vis`


![classroom__rgb_00283](https://github.com/open-mmlab/mmsegmentation/assets/26127467/051e8c4b-8f92-495f-8c3e-f249aac888e3)




## Checklist

1. Pre-commit or other linting tools are used to fix the potential lint
issues.
4. The modification is covered by complete unit tests. If not, please
add more unit test to ensure the correctness.
5. If the modification has potential influence on downstream projects,
this PR should be tested with downstream projects, like MMDet or
MMDet3D.
6. The documentation has been modified accordingly, like docstring or
example tutorials.
2023-09-18 20:27:24 +08:00
谢昕辰 f1fa61a48a
[Fix] Fix inferencer (#3333) 2023-09-18 19:24:03 +08:00
ZhaoQiiii 913fe3e91c
[Doc] add openxlab badge (#3332) 2023-09-18 19:23:35 +08:00
Peng Lu 2b3d3d0603
[Fix] Fix training of VPD model (#3323) 2023-09-15 09:39:33 +08:00
Yang-ChangHui b6090a1550
[CodeCamp2023-608] Add Adabins model (#3257) 2023-09-13 17:06:03 +08:00
Peng Lu c46cc85cba
[Feature] Support VPD Depth Estimator (#3321)
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


Support depth estimation algorithm [VPD](https://github.com/wl-zhao/VPD)

## Modification

1. add VPD backbone
2. add VPD decoder head for depth estimation
3. add a new segmentor `DepthEstimator` based on `EncoderDecoder` for
depth estimation
4. add an integrated metric that calculate common metrics in depth
estimation
5. add SiLog loss for depth estimation 
6. add config for VPD 

## 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.
7. The modification is covered by complete unit tests. If not, please
add more unit test to ensure the correctness.
8. If the modification has potential influence on downstream projects,
this PR should be tested with downstream projects, like MMDet or
MMDet3D.
9. The documentation has been modified accordingly, like docstring or
example tutorials.
2023-09-13 15:31:22 +08:00
Gorgeous ebd5695104
[Fix] Update confusion_matrix.py (#3291)
## Motivation



## Modification

The confusion_matrix.py is not compatible with the current version of
mmseg.

---------

Co-authored-by: xiexinch <xiexinch@outlook.com>
2023-08-31 12:53:33 +08:00
zoulinxin 72e20a8854
[Feature] remote sensing inference (#3131)
## Motivation

Supports inference for ultra-large-scale remote sensing images.

## Modification

Add RSImageInference.py in demo.

## Use cases

Taking the inference of Vaihingen dataset images using PSPNet as an
example, the following settings are required:

**img**: Specify the path of the image.
**model**: Provide the configuration file for the model.
**checkpoint**: Specify the weight file for the model.
**out**: Set the output path for the results.
**batch_size**: Determine the batch size used during inference.
**win_size**: Specify the width and height(512x512) of the sliding
window.
**stride**: Set the stride(400x400) for sliding the window.
**thread(default: 1)**: Specify the number of threads to be used for
inference.
**Inference device (default: cuda:0)**: Specify the device for inference
(e.g., cuda:0 for CPU).

```shell
python demo/rs_image_inference.py demo/demo.png projects/pp_mobileseg/configs/pp_mobileseg/pp_mobileseg_mobilenetv3_2x16_80k_ade20k_512x512_tiny.py pp_mobileseg_mobilenetv3_2xb16_3rdparty-tiny_512x512-ade20k-a351ebf5.pth --batch-size 8 --device cpu --thread 2
```

---------

Co-authored-by: xiexinch <xiexinch@outlook.com>
2023-08-31 12:44:46 +08:00
Peng Lu 35ff78a07f
[Feature] Support depth metrics (#3297)
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.

Support metrics for the depth estimation task, including RMSE, ABSRel,
and etc.

## Modification

Please briefly describe what modification is made in this PR.

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

Using the following configuration to compute depth metrics on NYU

```python
dataset_type = 'NYUDataset'
data_root = 'data/nyu'

test_pipeline = [
    dict(type='LoadImageFromFile'),
    dict(dict(type='LoadDepthAnnotation', depth_rescale_factor=1e-3)),
    dict(
        type='PackSegInputs',
        meta_keys=('img_path', 'depth_map_path', 'ori_shape', 'img_shape',
                   'pad_shape', 'scale_factor', 'flip', 'flip_direction',
                   'category_id'))
]

val_dataloader = dict(
    batch_size=1,
    num_workers=4,
    persistent_workers=True,
    sampler=dict(type='DefaultSampler', shuffle=False),
    dataset=dict(
        type=dataset_type,
        data_root=data_root,
        test_mode=True,
        data_prefix=dict(
            img_path='images/test', depth_map_path='annotations/test'),
        pipeline=test_pipeline))
test_dataloader = val_dataloader

val_evaluator = dict(type='DepthMetric', max_depth_eval=10.0, crop_type='nyu')
test_evaluator = val_evaluator
```

Example log:

![image](https://github.com/open-mmlab/mmsegmentation/assets/26127467/8101d65c-dee6-48de-916c-818659947b59)


## 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-08-31 12:02:19 +08:00
Andrey Dolgovyazov 8233e64c7e
[CodeCamp2023-526] Kullback-Leibler divergence Loss implementation (#3242)
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

It's OpenMMLab  Codecamp task.

## Modification

Implementd Kullback-Leibler divergence loss and also added tests for it.

## 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 <xiexinch@outlook.com>
2023-08-28 16:48:26 +08:00
小飞猪 b2f10954e6
[Doc] translate doc for docs/zh_cn/user_guides/5_deployment.md (#3281)
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

translate doc for docs/zh_cn/user_guides/5_deployment.md

## Modification

update `docs/en/user_guides/5_deployment.md`
fix `docs/zh_cn/user_guides/5_deployment.md`

## 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: 谢昕辰 <xiexinch@outlook.com>
2023-08-25 10:19:14 +08:00
zhengjie.xu 05767a21a8
Update QR code (#3284) 2023-08-23 13:45:41 +08:00
Peng Lu 788b37f78f
[Feature] Support NYU depth estimation dataset (#3269)
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.

## Modification

Please briefly describe what modification is made in this PR.
1. add `NYUDataset`class
2. add script to process NYU dataset
3. add transforms for loading depth map
4. add docs & unittest

## 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.
5. The modification is covered by complete unit tests. If not, please
add more unit test to ensure the correctness.
6. If the modification has potential influence on downstream projects,
this PR should be tested with downstream projects, like MMDet or
MMDet3D.
7. The documentation has been modified accordingly, like docstring or
example tutorials.
2023-08-17 11:39:44 +08:00
谢昕辰 92774182ba
[Project] Add pp_mobileseg onnx inference demo (#3268)
## Motivation

Add a model deployment example.

## Modification

Add an inference script and update the README.

## BC-breaking (Optional)

None

## Use cases (Optional)

In README.
2023-08-16 18:01:22 +08:00
谢昕辰 0391bc4998
[Fix] Update dataset mim downloading source to OpenXLab (#3266) 2023-08-16 17:38:46 +08:00
小飞猪 22ffd0d2f6
[Doc]fix inference_segmentor to inference_model (#3261)
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

there is a code mistake in `docs\zh_cn\get_started.md` and
`docs\en\get_started.md`,it use the 0.x api,which is changed in 1.x

## Modification
`docs\zh_cn\get_started.md` ,`docs\en\get_started.md`
fix inference_segmentor --> inference_model

## 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-08-15 14:04:25 +08:00
谢昕辰 9801c62fd7
[Fix] update pp_mobileseg ckpt links (#3254) 2023-08-10 18:56:30 +08:00
Xu CAO e458a467d6
[Project] Support CAT-Seg from CVPR2023 (#3098)
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

Support CAT-Seg open-vocabulary semantic segmentation (CVPR2023).

## Modification

Support CAT-Seg open-vocabulary semantic segmentation (CVPR2023).
- [x] Support CAT-Seg model training.
- [x] CLIP model based `backbone` (R101 & Swin-B), aggregation layers
based `neck`, and `decoder` head.
  - [x] Provide customized coco-stuff164k_384x384 training configs.
- [x] Language model supports for `open vocabulary` (OV) tasks. 
  - [x] Support CLIP-based pretrained language model (LM) inference.
  - [x] Add commonly used prompts templates. 
- [x] Add README tutorials.
- [x] Add zero-shot testing scripts.

**Working on the following tasks.**
- [x] Add unit test.

## 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: xiexinch <xiexinch@outlook.com>
2023-08-09 23:57:30 +08:00
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) 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 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