Skip to content

Commit 684d79f

Browse files
csatsurnhMeowZheng
andauthored
[Doc] add zh_cn migration doc (#2733)
as title --------- Co-authored-by: MeowZheng <[email protected]>
1 parent 45fae72 commit 684d79f

File tree

7 files changed

+637
-31
lines changed

7 files changed

+637
-31
lines changed

README_zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ MMSegmentation 是一个基于 PyTorch 的语义分割开源工具箱。它是 O
7676

7777
同时,我们提供了 Colab 教程。你可以在[这里](demo/MMSegmentation_Tutorial.ipynb)浏览教程,或者直接在 Colab 上[运行](https://colab.research.google.com/github/open-mmlab/mmsegmentation/blob/1.x/demo/MMSegmentation_Tutorial.ipynb)
7878

79-
若需要将0.x版本的代码迁移至新版,请参考[迁移文档](docs/zh_cn/migration.md)
79+
若需要将0.x版本的代码迁移至新版,请参考[迁移文档](docs/zh_cn/migration)
8080

8181
## 基准测试和模型库
8282

docs/en/migration/interface.md

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ This guide describes the fundamental differences between MMSegmentation 0.x and
66

77
## New dependencies
88

9-
MMSegmentation 1.x depends on some new packages, you can prepare a new clean environment and install again according to the [installation tutorial](get_started.md).
9+
MMSegmentation 1.x depends on some new packages, you can prepare a new clean environment and install again according to the [installation tutorial](../get_started.md).
10+
1011
Or install the below packages manually.
1112

1213
1. [MMEngine](https://github.com/open-mmlab/mmengine): MMEngine is the core the OpenMMLab 2.0 architecture, and we splited many compentents unrelated to computer vision from MMCV to MMEngine.
1314

1415
2. [MMCV](https://github.com/open-mmlab/mmcv): The computer vision package of OpenMMLab. This is not a new dependency, but you need to upgrade it to above **2.0.0rc1** version.
1516

16-
3. [MMClassification](https://github.com/open-mmlab/mmclassification)(Optional): The image classification toolbox and benchmark of OpenMMLab. This is not a new dependency, but you need to upgrade it to above **1.0.0rc0** version.
17+
3. [MMClassification](https://github.com/open-mmlab/mmclassification)(Optional): The image classification toolbox and benchmark of OpenMMLab. This is not a new dependency, but you need to upgrade it to above **1.0.0rc0** version.
18+
19+
4. [MMDetection](https://github.com/open-mmlab/mmdetection)(Optional): The object detection toolbox and benchmark of OpenMMLab. This is not a new dependency, but you need to upgrade it to above **3.0.0rc0** version.
1720

1821
## Train launch
1922

@@ -86,7 +89,7 @@ Add `model.data_preprocessor` field to configure the `DataPreProcessor`, includi
8689

8790
- `bgr_to_rgb` (bool): whether to convert image from BGR to RGB.Defaults to False.
8891

89-
- `rgb_to_bgr` (bool): whether to convert image from RGB to RGB. Defaults to False.
92+
- `rgb_to_bgr` (bool): whether to convert image from RGB to BGR. Defaults to False.
9093

9194
**Note:**
9295
Please refer [models documentation](../advanced_guides/models.md) for more details.
@@ -260,8 +263,7 @@ tta_pipeline = [
260263
Changes in **`evaluation`**:
261264

262265
- The **`evaluation`** field is split to `val_evaluator` and `test_evaluator`. And it won't support `interval` and `save_best` arguments.
263-
The `interval` is moved to `train_cfg.val_interval`, and the `save_best`
264-
is moved to `default_hooks.checkpoint.save_best`. `pre_eval` has been removed.
266+
The `interval` is moved to `train_cfg.val_interval`, and the `save_best` is moved to `default_hooks.checkpoint.save_best`. `pre_eval` has been removed.
265267
- `'mIoU'` has been changed to `'IoUMetric'`.
266268

267269
<table class="docutils">
@@ -291,8 +293,7 @@ test_evaluator = val_evaluator
291293

292294
Changes in **`optimizer`** and **`optimizer_config`**:
293295

294-
- Now we use `optim_wrapper` field to specify all configuration about the optimization process. And the
295-
`optimizer` is a sub field of `optim_wrapper` now.
296+
- Now we use `optim_wrapper` field to specify all configuration about the optimization process. And the `optimizer` is a sub field of `optim_wrapper` now.
296297
- `paramwise_cfg` is also a sub field of `optim_wrapper`, instead of `optimizer`.
297298
- `optimizer_config` is removed now, and all configurations of it are moved to `optim_wrapper`.
298299
- `grad_clip` is renamed to `clip_grad`.
@@ -326,11 +327,9 @@ optim_wrapper = dict(
326327
Changes in **`lr_config`**:
327328

328329
- The `lr_config` field is removed and we use new `param_scheduler` to replace it.
329-
- The `warmup` related arguments are removed, since we use schedulers combination to implement this
330-
functionality.
330+
- The `warmup` related arguments are removed, since we use schedulers combination to implement this functionality.
331331

332-
The new schedulers combination mechanism is very flexible, and you can use it to design many kinds of learning
333-
rate / momentum curves. See [the tutorial](TODO) for more details.
332+
The new schedulers combination mechanism is very flexible, and you can use it to design many kinds of learning rate / momentum curves. See [the tutorial](TODO) for more details.
334333

335334
<table class="docutils">
336335
<tr>
@@ -374,8 +373,7 @@ param_scheduler = [
374373

375374
Changes in **`runner`**:
376375

377-
Most configuration in the original `runner` field is moved to `train_cfg`, `val_cfg` and `test_cfg`, which
378-
configure the loop in training, validation and test.
376+
Most configuration in the original `runner` field is moved to `train_cfg`, `val_cfg` and `test_cfg`, which configure the loop in training, validation and test.
379377

380378
<table class="docutils">
381379
<tr>
@@ -402,8 +400,7 @@ test_cfg = dict(type='TestLoop') # Use the default test loop.
402400
</tr>
403401
</table>
404402

405-
In fact, in OpenMMLab 2.0, we introduced `Loop` to control the behaviors in training, validation and test. The functionalities of `Runner` are also changed. You can find more details of [runner tutorial](https://github.com/open-mmlab/mmengine/blob/main/docs/en/design/runner.md)
406-
in [MMEngine](https://github.com/open-mmlab/mmengine/).
403+
In fact, in OpenMMLab 2.0, we introduced `Loop` to control the behaviors in training, validation and test. The functionalities of `Runner` are also changed. You can find more details of [runner tutorial](https://github.com/open-mmlab/mmengine/blob/main/docs/en/design/runner.md) in [MMEngine](https://github.com/open-mmlab/mmengine/).
407404

408405
### Runtime settings
409406

@@ -433,8 +430,7 @@ default_hooks = dict(
433430
visualization=dict(type='SegVisualizationHook'))
434431
```
435432

436-
In addition, we split the original logger to logger and visualizer. The logger is used to record
437-
information and the visualizer is used to show the logger in different backends, like terminal and TensorBoard.
433+
In addition, we split the original logger to logger and visualizer. The logger is used to record information and the visualizer is used to show the logger in different backends, like terminal and TensorBoard.
438434

439435
<table class="docutils">
440436
<tr>
@@ -478,8 +474,7 @@ Changes in **`load_from`** and **`resume_from`**:
478474
- If `resume=False` and `load_from` is **not None**, only load the checkpoint, not resume training.
479475
- If `resume=False` and `load_from` is **None**, do not load nor resume.
480476

481-
Changes in **`dist_params`**: The `dist_params` field is a sub field of `env_cfg` now. And there are some new
482-
configurations in the `env_cfg`.
477+
Changes in **`dist_params`**: The `dist_params` field is a sub field of `env_cfg` now. And there are some new configurations in the `env_cfg`.
483478

484479
```python
485480
env_cfg = dict(
@@ -496,8 +491,6 @@ env_cfg = dict(
496491

497492
Changes in **`workflow`**: `workflow` related functionalities are removed.
498493

499-
New field **`visualizer`**: The visualizer is a new design in OpenMMLab 2.0 architecture. We use a
500-
visualizer instance in the runner to handle results & log visualization and save to different backends.
501-
See the [visualization tutorial](user_guides/visualization.md) for more details.
494+
New field **`visualizer`**: The visualizer is a new design in OpenMMLab 2.0 architecture. We use a visualizer instance in the runner to handle results & log visualization and save to different backends. See the [visualization tutorial](../user_guides/visualization.md) for more details.
502495

503-
New field **`default_scope`**: The start point to search module for all registries. The `default_scope` in MMSegmentation is `mmseg`. See [the registry tutorial](https://github.com/open-mmlab/mmengine/blob/main/docs/en/tutorials/registry.md) for more details.
496+
New field **`default_scope`**: The start point to search module for all registries. The `default_scope` in MMSegmentation is `mmseg`. See [the registry tutorial](https://github.com/open-mmlab/mmengine/blob/main/docs/en/advanced_tutorials/registry.md) for more details.

docs/en/migration/package.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,8 @@ We moved registry implementations for all kinds of modules in MMSegmentation in
7474

7575
### `mmseg.apis`
7676

77-
OpenMMLab 2.0 tries to support unified interface for multitasking of Computer Vision,
78-
and releases much stronger [`Runner`](https://github.com/open-mmlab/mmengine/blob/main/docs/en/design/runner.md),
79-
so MMSeg 1.x removed modules in `train.py` and `test.py` renamed `init_segmentor` to `init_model` and `inference_segmentor` to `inference_model`
77+
OpenMMLab 2.0 tries to support unified interface for multitasking of Computer Vision, and releases much stronger [`Runner`](https://github.com/open-mmlab/mmengine/blob/main/docs/en/design/runner.md), so MMSeg 1.x removed modules in `train.py` and `test.py` renamed `init_segmentor` to `init_model` and `inference_segmentor` to `inference_model`.
78+
8079
Here is the changes of `mmseg.apis`:
8180

8281
| Function | Changes |
@@ -92,7 +91,7 @@ Here is the changes of `mmseg.apis`:
9291

9392
### `mmseg.datasets`
9493

95-
OpenMMLab 2.0 defines the `BaseDataset` to function and interface of dataset, and MMSegmentation 1.x also follow this protocol and defines the `BaseSegDataset` inherited from `BaseDataset`. MMCV 2.x collects general data transforms for multiple tasks e.g. classification, detection, segmentation, so MMSegmentation 1.x uses these data transforms and removes them from mmseg.datasets
94+
OpenMMLab 2.0 defines the `BaseDataset` to function and interface of dataset, and MMSegmentation 1.x also follow this protocol and defines the `BaseSegDataset` inherited from `BaseDataset`. MMCV 2.x collects general data transforms for multiple tasks e.g. classification, detection, segmentation, so MMSegmentation 1.x uses these data transforms and removes them from mmseg.datasets.
9695

9796
| Packages/Modules | Changes |
9897
| :-------------------: | :------------------------------------------------------------------------------------------ |

docs/zh_cn/migration.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/zh_cn/migration/index.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
迁移
2+
***************
3+
4+
.. toctree::
5+
:maxdepth: 1
6+
7+
interface.md
8+
package.md

0 commit comments

Comments
 (0)