Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] config english #1372

Merged
merged 5 commits into from
Sep 23, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 14 additions & 21 deletions docs/en/user_guides/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ env_cfg = dict(
cudnn_benchmark=True,
mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0),
dist_cfg=dict(backend='nccl'))
random_cfg = dict(seed=None)
randomness = dict(seed=None)
```

There are three main components:
Expand All @@ -173,7 +173,8 @@ There are three main components:

- `env_cfg` configures the distributed environment, see {external+mmengine:doc}`MMEngine: Runner <tutorials/runner>` for more details.

- `env_cfg` configures the distributed environment, see {external+mmengine:doc}`MMEngine: Runner <tutorials/runner>` for more details.
- `randomness`: Some settings to make the experiment as reproducible
as possible like seed and deterministic. see {external+mmengine:doc}`MMEngine: Runner <tutorials/runner>` for more details.
gaotongxiao marked this conversation as resolved.
Show resolved Hide resolved

<div id="hook_config"></div>

Expand All @@ -183,12 +184,12 @@ Hooks are divided into two main parts, default hooks, which are required for all

```Python
default_hooks = dict(
timer=dict(type='IterTimerHook'), # Time recording, including data enhancement time as well as model inference time
logger=dict(type='LoggerHook', interval=1), # Logging printing interval
param_scheduler=dict(type='ParamSchedulerHook'), # Update learning rates and other super-references
checkpoint=dict(type='CheckpointHook', interval=1),# Save checkpoint. `interval` control save interval
sampler_seed=dict(type='DistSamplerSeedHook'), # Set random seeds in multi-machine situations
sync_buffer=dict(type='SyncBuffersHook'), # Synchronize buffer in case of multiple GPUS
timer=dict(type='IterTimerHook'), # Time recording, including data time as well as model inference time
logger=dict(type='LoggerHook', interval=1), # Collect logs from different components
param_scheduler=dict(type='ParamSchedulerHook'), # Update some hyper-parameters in optimizer
checkpoint=dict(type='CheckpointHook', interval=1),# Save checkpoint. `interval` control save interval
sampler_seed=dict(type='DistSamplerSeedHook'), # Data-loading sampler for distributed training.
sync_buffer=dict(type='SyncBuffersHook'), # Synchronize buffer in case of distributed training
visualization=dict( # Visualize the results of val and test
type='VisualizationHook',
interval=1,
Expand Down Expand Up @@ -321,7 +322,7 @@ ic15_rec_test = dict(

In MMOCR, dataset construction and data preparation are decoupled from each other. In other words, dataset classes such as `OCRDataset` are responsible for reading and parsing annotation files, while Data Transforms further implement data loading, data augmentation, data formatting and other related functions.

In general, there are different augmentation strategies for training and testing, so there are usually `training_pipeline` and `testing_pipeline`. More information can be found in [Data Pipeline](../basic_concepts/transforms.md)
In general, there are different augmentation strategies for training and testing, so there are usually `training_pipeline` and `testing_pipeline`. More information can be found in [Data Transforms](../basic_concepts/transforms.md)

- The data augmentation process of the training pipeline is usually: data loading (LoadImageFromFile) -> annotation information loading (LoadXXXAnntation) -> data augmentation -> data formatting (PackXXXInputs).

Expand Down Expand Up @@ -397,7 +398,7 @@ test_dataloader = val_dataloader

#### Network Configuration

This section configures the network architecture. Different algorithmic tasks use different network architectures.
This section configures the network architecture. Different algorithmic tasks use different network architectures. Find more info about network architecture in [structures](../basic_concepts/structures.md)

##### Text Detection

Expand Down Expand Up @@ -476,10 +477,6 @@ model = dict(
with_padding=True)))
```
Harold-lkk marked this conversation as resolved.
Show resolved Hide resolved

```{note}
Find more info about network architecture in [structures](../basic_concepts/structures.md)
```

<div id="weight_config"></div>

#### Checkpoint Loading Configuration
Expand All @@ -501,11 +498,11 @@ More can be found in {external+mmengine:doc}`MMEngine: Load Weights or Recover T

### Evaluation Configuration

In model validation and model testing, quantitative measurement of model accuracy is often required. MMOCR performs this function by means of `Metric` and `Evaluator`. For more information, please refer to {external+mmengine:doc}`MMEngine: Evaluation <tutorials/evaluation>`.
In model validation and model testing, quantitative measurement of model accuracy is often required. MMOCR performs this function by means of `Metric` and `Evaluator`. For more information, please refer to {external+mmengine:doc}`MMEngine: Evaluation <tutorials/evaluation>` and [Evaluation](../basic_concepts/evaluation.md)

#### Evaluator

Raters are mainly used to manage multiple datasets and multiple `Metric`s. For single and multiple dataset cases, there are single and multiple dataset evaluators, both of which can manage multiple `Metric`.
Evaluator is mainly used to manage multiple datasets and multiple `Metrics`. For single and multiple dataset cases, there are single and multiple dataset evaluators, both of which can manage multiple `Metrics`.

The single-dataset evaluator is configured as follows.

Expand Down Expand Up @@ -570,10 +567,6 @@ val_evaluator = dict(
test_evaluator = val_evaluator
```

Harold-lkk marked this conversation as resolved.
Show resolved Hide resolved
```{note}
For more information, please refer to {external+mmengine:doc}`MMEngine: Evaluation <tutorials/evaluation>` and [Evaluation](../basic_concepts/evaluation.md)
```

<div id="vis_config"></div>

### Visualizaiton Configuration
Expand All @@ -600,7 +593,7 @@ All configuration files of `MMOCR` are placed under the `configs` folder. To avo

1. Config files starting with `_base_`: Configures the model and data pipeline of an algorithm. In OCR domain, data augmentation strategies are generally strongly related to the algorithm, so the model and data pipeline are usually placed in the same config file.

2. Other config files, i.e. the algorithm-specific configurations on the specific dataset(s): These are the full config files that further configure training and testing settings, aggregating *base* configurations that are scattered in different locations. Inside some modifications to the fields in `_base_` configs may be performed, such as data pipeline, training strategy, etc.
2. Other config files, i.e. the algorithm-specific configurations on the specific dataset(s): These are the full config files that further configure training and testing settings, aggregating `_base_` configurations that are scattered in different locations. Inside some modifications to the fields in `_base_` configs may be performed, such as data pipeline, training strategy, etc.

All these config files are distributed in different folders according to their contents as follows:

Expand Down
16 changes: 4 additions & 12 deletions docs/zh_cn/user_guides/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ env_cfg = dict(
cudnn_benchmark=True,
mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0),
dist_cfg=dict(backend='nccl'))
random_cfg = dict(seed=None)
randomness = dict(seed=None)
```

主要包含三个部分:
Expand All @@ -171,7 +171,7 @@ random_cfg = dict(seed=None)

- `env_cfg` 设置分布式环境配置, 更多配置可以详见 {external+mmengine:doc}`MMEngine: Runner <tutorials/runner>`。

- `random_cfg` 设置 numpy, torch,cudnn 等随机种子,更多配置详见 {external+mmengine:doc}`MMEngine: Runner <tutorials/runner>`。
- `randomness` 设置 numpy, torch,cudnn 等随机种子,更多配置详见 {external+mmengine:doc}`MMEngine: Runner <tutorials/runner>`。

<div id="hook_config"></div>

Expand Down Expand Up @@ -397,7 +397,7 @@ test_dataloader = val_dataloader

#### 网络配置

用于配置模型的网络结构,不同的算法任务有不同的网络结构。
用于配置模型的网络结构,不同的算法任务有不同的网络结构。更多信息可以参考[网络结构](../basic_concepts/structures.md)

##### 文本检测

Expand Down Expand Up @@ -476,10 +476,6 @@ model = dict(
with_padding=True)))
```

```{note}
更多信息可以参考[网络结构](../basic_concepts/structures.md)
```

<div id="weight_config"></div>

#### 权重加载配置
Expand All @@ -501,7 +497,7 @@ resume = False # 是否 resume

### 评测配置

在模型验证和模型测试中,通常需要对模型精度做定量评测。MMOCR 通过评测指标(Metric)和评测器(Evaluator)来完成这一功能。更多可以参考{external+mmengine:doc}`MMEngine: 评测指标(Metric)和评测器(Evaluator) <tutorials/evaluation>`
在模型验证和模型测试中,通常需要对模型精度做定量评测。MMOCR 通过评测指标(Metric)和评测器(Evaluator)来完成这一功能。更多可以参考{external+mmengine:doc}`MMEngine: 评测指标(Metric)和评测器(Evaluator) <tutorials/evaluation>` 和 [评测器](../basic_concepts/evaluation.md)

评测部分包含两个部分,评测器和评测指标。接下来我们分部分展开讲解。

Expand Down Expand Up @@ -583,10 +579,6 @@ val_evaluator = dict(
test_evaluator = val_evaluator
```

```{note}
更多信息,请参考{external+mmengine:doc}`MMEngine: 评测器<tutorials/evaluation>`和[评测器](../basic_concepts/evaluation.md)
```

<div id="vis_config"></div>

### 可视化配置
Expand Down