You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/user_guides/2_dataset_prepare.md
+34-39Lines changed: 34 additions & 39 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
##Prepare datasets
1
+
#Tutorial 2: Prepare datasets
2
2
3
3
It is recommended to symlink the dataset root to `$MMSEGMENTATION/data`.
4
4
If your folder structure is different, you may need to change the corresponding paths in config files.
@@ -179,20 +179,19 @@ mmsegmentation
179
179
| │ │ │ └── polygons
180
180
```
181
181
182
-
###Cityscapes
182
+
## Cityscapes
183
183
184
184
The data could be found [here](https://www.cityscapes-dataset.com/downloads/) after registration.
185
185
186
186
By convention, `**labelTrainIds.png` are used for cityscapes training.
187
-
We provided a [scripts](https://github.com/open-mmlab/mmsegmentation/blob/1.x/tools/dataset_converters/cityscapes.py) based on [cityscapesscripts](https://github.com/mcordts/cityscapesScripts)
188
-
to generate `**labelTrainIds.png`.
187
+
We provided a [script](https://github.com/open-mmlab/mmsegmentation/blob/1.x/tools/dataset_converters/cityscapes.py) based on [cityscapesscripts](https://github.com/mcordts/cityscapesScripts)to generate `**labelTrainIds.png`.
189
188
190
189
```shell
191
190
# --nproc means 8 process for conversion, which could be omitted as well.
Pascal VOC 2012 could be downloaded from [here](http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar).
198
197
Beside, most recent works on Pascal VOC dataset usually exploit extra augmentation data, which could be found [here](http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/semantic_contours/benchmark.tgz).
@@ -204,14 +203,14 @@ If you would like to use augmented VOC dataset, please run following command to
Please refer to [concat dataset](https://github.com/open-mmlab/mmsegmentation/blob/dev-1.x/docs/en/advanced_guides/datasets.md) for details about how to concatenate them and train them together.
206
+
Please refer to [concat dataset](../advanced_guides/add_datasets.md#concatenate-dataset) and [voc_aug config example](../../../configs/_base_/datasets/pascal_voc12_aug.py) for details about how to concatenate them and train them together.
208
207
209
-
###ADE20K
208
+
## ADE20K
210
209
211
210
The training and validation set of ADE20K could be download from this [link](http://data.csail.mit.edu/places/ADEchallenge/ADEChallengeData2016.zip).
212
211
We may also download test set from [here](http://data.csail.mit.edu/places/ADEchallenge/release_test.zip).
213
212
214
-
###Pascal Context
213
+
## Pascal Context
215
214
216
215
The training and validation set of Pascal Context could be download from [here](http://host.robots.ox.ac.uk/pascal/VOC/voc2010/VOCtrainval_03-May-2010.tar). You may also download test set from [here](http://host.robots.ox.ac.uk:8080/eval/downloads/VOC2010test.tar) after registration.
217
216
@@ -223,7 +222,7 @@ If you would like to use Pascal Context dataset, please install [Detail](https:/
The script will make directory structure automatically.
281
280
282
-
###DRIVE
281
+
## DRIVE
283
282
284
283
The training and validation set of DRIVE could be download from [here](https://drive.grand-challenge.org/). Before that, you should register an account. Currently '1st_manual' is not provided officially.
The script will make directory structure automatically.
317
316
318
-
###Dark Zurich
317
+
## Dark Zurich
319
318
320
319
Since we only support test models on this dataset, you may only download [the validation set](https://data.vision.ee.ethz.ch/csakarid/shared/GCMA_UIoU/Dark_Zurich_val_anon.zip).
321
320
322
-
###Nighttime Driving
321
+
## Nighttime Driving
323
322
324
323
Since we only support test models on this dataset, you may only download [the test set](http://data.vision.ee.ethz.ch/daid/NighttimeDriving/NighttimeDrivingTest.zip).
325
324
326
-
###LoveDA
325
+
## LoveDA
327
326
328
327
The data could be downloaded from Google Drive [here](https://drive.google.com/drive/folders/1ibYV0qwn4yuuh068Rnc-w4tPi0U0c-ti?usp=sharing).
Using trained model to predict test set of LoveDA and submit it to server can be found [here](https://github.com/open-mmlab/mmsegmentation/blob/dev-1.x/docs/en/user_guides/3_inference.md).
346
+
Using trained model to predict test set of LoveDA and submit it to server can be found [here](https://codalab.lisn.upsaclay.fr/competitions/421).
348
347
349
348
More details about LoveDA can be found [here](https://github.com/Junjue-Wang/LoveDA).
350
349
351
-
###ISPRS Potsdam
350
+
## ISPRS Potsdam
352
351
353
-
The [Potsdam](https://www2.isprs.org/commissions/comm2/wg4/benchmark/2d-sem-label-potsdam/)
354
-
dataset is for urban semantic segmentation used in the 2D Semantic Labeling Contest - Potsdam.
352
+
The [Potsdam](https://www2.isprs.org/commissions/comm2/wg4/benchmark/2d-sem-label-potsdam/) dataset is for urban semantic segmentation used in the 2D Semantic Labeling Contest - Potsdam.
355
353
356
354
The dataset can be requested at the challenge [homepage](https://www2.isprs.org/commissions/comm2/wg4/benchmark/data-request-form/).
357
355
The '2_Ortho_RGB.zip' and '5_Labels_all_noBoundary.zip' are required.
358
356
359
-
For Potsdam dataset, please run the following command to download and re-organize the dataset.
357
+
For Potsdam dataset, please run the following command to re-organize the dataset.
In our default setting, it will generate 3456 images for training and 2016 images for validation.
366
364
367
-
###ISPRS Vaihingen
365
+
## ISPRS Vaihingen
368
366
369
-
The [Vaihingen](https://www2.isprs.org/commissions/comm2/wg4/benchmark/2d-sem-label-vaihingen/)
370
-
dataset is for urban semantic segmentation used in the 2D Semantic Labeling Contest - Vaihingen.
367
+
The [Vaihingen](https://www2.isprs.org/commissions/comm2/wg4/benchmark/2d-sem-label-vaihingen/) dataset is for urban semantic segmentation used in the 2D Semantic Labeling Contest - Vaihingen.
371
368
372
369
The dataset can be requested at the challenge [homepage](https://www2.isprs.org/commissions/comm2/wg4/benchmark/data-request-form/).
373
370
The 'ISPRS_semantic_labeling_Vaihingen.zip' and 'ISPRS_semantic_labeling_Vaihingen_ground_truth_eroded_COMPLETE.zip' are required.
374
371
375
-
For Vaihingen dataset, please run the following command to download and re-organize the dataset.
372
+
For Vaihingen dataset, please run the following command to re-organize the dataset.
In our default setting (`patch_width`=896, `patch_height`=896,`overlap_area`=384), it will generate 33978 images for training and 11644 images for validation.
415
+
In our default setting (`patch_width`=896, `patch_height`=896,`overlap_area`=384), it will generate 33978 images for training and 11644 images for validation.
419
416
420
417
## LIP(Look Into Person) dataset
421
418
@@ -435,7 +432,7 @@ mv val_segmentations ../
435
432
cd ..
436
433
```
437
434
438
-
The contents of LIP datasets include:
435
+
The contents of LIP datasets include:
439
436
440
437
```none
441
438
├── data
@@ -456,10 +453,9 @@ The contents of LIP datasets include:
456
453
457
454
## Synapse dataset
458
455
459
-
This dataset could be download from [this page](https://www.synapse.org/#!Synapse:syn3193805/wiki/)
456
+
This dataset could be download from [this page](https://www.synapse.org/#!Synapse:syn3193805/wiki/).
460
457
461
-
To follow the data preparation setting of [TransUNet](https://arxiv.org/abs/2102.04306), which splits original training set (30 scans)
462
-
into new training (18 scans) and validation set (12 scans). Please run the following command to prepare the dataset.
458
+
To follow the data preparation setting of [TransUNet](https://arxiv.org/abs/2102.04306), which splits original training set (30 scans) into new training (18 scans) and validation set (12 scans). Please run the following command to prepare the dataset.
463
459
464
460
```shell
465
461
unzip RawData.zip
@@ -532,10 +528,9 @@ Then, use this command to convert synapse dataset.
Noted that MMSegmentation default evaluation metric (such as mean dice value) is calculated on 2D slice image,
536
-
which is not comparable to results of 3D scan in some paper such as [TransUNet](https://arxiv.org/abs/2102.04306).
531
+
Noted that MMSegmentation default evaluation metric (such as mean dice value) is calculated on 2D slice image, which is not comparable to results of 3D scan in some paper such as [TransUNet](https://arxiv.org/abs/2102.04306).
537
532
538
-
###REFUGE
533
+
## REFUGE
539
534
540
535
Register in [REFUGE Challenge](https://refuge.grand-challenge.org) and download [REFUGE dataset](https://refuge.grand-challenge.org/REFUGE2Download).
541
536
@@ -624,4 +619,4 @@ It includes 400 images for training, 400 images for validation and 400 images fo
624
619
```
625
620
626
621
- You could set Datasets version with `MapillaryDataset_v1` and `MapillaryDataset_v2` in your configs.
627
-
View the Mapillary Vistas Datasets config file here [V1.2](https://github.com/open-mmlab/mmsegmentation/blob/dev-1.x/configs/_base_/datasets/mapillary_v1.py) and [V2.0](https://github.com/open-mmlab/mmsegmentation/blob/dev-1.x/configs/_base_/datasets/mapillary_v2.py)
622
+
View the Mapillary Vistas Datasets config file here [V1.2](https://github.com/open-mmlab/mmsegmentation/blob/dev-1.x/configs/_base_/datasets/mapillary_v1.py) and [V2.0](https://github.com/open-mmlab/mmsegmentation/blob/dev-1.x/configs/_base_/datasets/mapillary_v2.py)
Copy file name to clipboardExpand all lines: docs/en/user_guides/3_inference.md
+13-21Lines changed: 13 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ MMSegmentation provides several interfaces for users to easily use pre-trained m
19
19
20
20
## Inferencer
21
21
22
-
We provides the most **convenient** way to use the model in MMSegmentation `MMSegInferencer`. You can get segmentation mask for an image with only 3 lines of code.
22
+
We provide the most **convenient** way to use the model in MMSegmentation `MMSegInferencer`. You can get segmentation mask for an image with only 3 lines of code.
23
23
24
24
### Basic Usage
25
25
@@ -36,15 +36,15 @@ The following example shows how to use `MMSegInferencer` to perform inference on
There is a optional parameter of inferencer, `return_datasamples`, whose default value is False, and
60
-
return value of inferencer is a `dict` type by default, including 2 keys 'visualization' and 'predictions'.
59
+
There is a optional parameter of inferencer, `return_datasamples`, whose default value is False, and return value of inferencer is a `dict` type by default, including 2 keys 'visualization' and 'predictions'.
61
60
If `return_datasamples=True` inferencer will return [`SegDataSample`](../advanced_guides/structures.md), or list of it.
62
61
63
62
```
64
63
result = inferencer('demo/demo.png')
65
-
# result is a `dict` including 2 keys 'visualization' and 'predictions'.
64
+
# result is a `dict` including 2 keys 'visualization' and 'predictions'
66
65
# 'visualization' includes color segmentation map
67
66
print(result['visualization'].shape)
68
67
# (512, 683, 3)
@@ -92,18 +91,12 @@ print(type(results[0]))
92
91
### Initialization
93
92
94
93
`MMSegInferencer` must be initialized from a `model`, which can be a model name or a `Config` even a path of config file.
95
-
The model names can be found in models' metafile, like one model name of maskformer is `maskformer_r50-d32_8xb2-160k_ade20k-512x512`, and if input model name and the weights of the model will be download automatically. Below are other input parameters:
96
-
97
-
- weights (str, optional) - Path to the checkpoint. If it is not specified and model is a model name of metafile, the weights will be loaded
98
-
from metafile. Defaults to None.
99
-
- classes (list, optional) - Input classes for result rendering, as the prediction of segmentation
100
-
model is a segment map with label indices, `classes` is a list which includes
101
-
items responding to the label indices. If classes is not defined, visualizer will take `cityscapes` classes by default. Defaults to None.
102
-
- palette (list, optional) - Input palette for result rendering, which is a list of color palette
103
-
responding to the classes. If palette is not defined, visualizer will take `cityscapes` palette by default. Defaults to None.
104
-
- dataset_name (str, optional)[Dataset name or alias](https://github.com/open-mmlab/mmsegmentation/blob/dev-1.x/mmseg/utils/class_names.py#L302-L317)
105
-
visulizer will use the meta information of the dataset i.e. classes and palette,
106
-
but the `classes` and `palette` have higher priority. Defaults to None.
94
+
The model names can be found in models' metafile (configs/xxx/metafile.yaml), like one model name of maskformer is `maskformer_r50-d32_8xb2-160k_ade20k-512x512`, and if input model name and the weights of the model will be download automatically. Below are other input parameters:
95
+
96
+
- weights (str, optional) - Path to the checkpoint. If it is not specified and model is a model name of metafile, the weights will be loaded from metafile. Defaults to None.
97
+
- classes (list, optional) - Input classes for result rendering, as the prediction of segmentation model is a segment map with label indices, `classes` is a list which includes items responding to the label indices. If classes is not defined, visualizer will take `cityscapes` classes by default. Defaults to None.
98
+
- palette (list, optional) - Input palette for result rendering, which is a list of colors responding to the classes. If the palette is not defined, the visualizer will take the palette of `cityscapes` by default. Defaults to None.
99
+
- dataset_name (str, optional) - [Dataset name or alias](https://github.com/open-mmlab/mmsegmentation/blob/dev-1.x/mmseg/utils/class_names.py#L302-L317), visualizer will use the meta information of the dataset i.e. classes and palette, but the `classes` and `palette` have higher priority. Defaults to None.
107
100
- device (str, optional) - Device to run inference. If None, the available device will be automatically used. Defaults to None.
108
101
- scope (str, optional) - The scope of the model. Defaults to 'mmseg'.
109
102
@@ -113,8 +106,7 @@ The model names can be found in models' metafile, like one model name of maskfor
113
106
114
107
- show (bool) - Whether to display the image in a popup window. Defaults to False.
115
108
- wait_time (float) - The interval of show (s). Defaults to 0.
116
-
- img_out_dir (str) - Subdirectory of `out_dir`, used to save rendering color segmentation mask, so `out_dir` must be defined
117
-
if you would like to save predicted mask. Defaults to 'vis'.
109
+
- img_out_dir (str) - Subdirectory of `out_dir`, used to save rendering color segmentation mask, so `out_dir` must be defined if you would like to save predicted mask. Defaults to 'vis'.
118
110
- opacity (int, float) - The transparency of segmentation mask. Defaults to 0.8.
119
111
120
112
The examples of these parameters is in [Basic Usage](#basic-usage)
0 commit comments