[Docs] Fix some doc mistakes (#1630)

* [Docs] fix a mistake in user_guides/visualization.md

* [Docs] fix some mistakes in user_guides/dataset_prepare.md

* Update docs/en/user_guides/dataset_prepare.md

Co-authored-by: Tong Gao <gaotongxiao@gmail.com>
This commit is contained in:
Kevin Wang 2022-12-16 22:34:08 +08:00 committed by GitHub
parent b11c58897c
commit f6da8715b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 18 deletions

View File

@ -84,25 +84,23 @@ data/icdar2015
### Single Dataset Training
When training or evaluating a model on new datasets, we need to write the dataset config where the image path, annotation path, and image prefix are set. The path `configs/xxx/_base_/datasets/` is pre-configured with the commonly used datasets in MMOCR (if you use `prepare_dataset.py` to prepare dataset, this config will be generated automatically), here we take the ICDAR 2015 dataset as an example (see `configs/_base_/det_datasets/icdar2015.py`).
When training or evaluating a model on new datasets, we need to write the dataset config where the image path, annotation path, and image prefix are set. The path `configs/xxx/_base_/datasets/` is pre-configured with the commonly used datasets in MMOCR (if you use `prepare_dataset.py` to prepare dataset, this config will be generated automatically), here we take the ICDAR 2015 dataset as an example (see `configs/textdet/_base_/datasets/icdar2015.py`).
```Python
ic15_det_data_root = 'data/icdar2015' # dataset root path
icdar2015_textdet_data_root = 'data/icdar2015' # dataset root path
# Train set config
icdar2015_textdet_train = dict(
type='OCRDataset',
data_root=ic15_det_data_root, # dataset root path
ann_file='instances_training.json', # name of annotation
data_prefix=dict(img_path='imgs/'), # prefix of image path
data_root=icdar2015_textdet_data_root, # dataset root path
ann_file='textdet_train.json', # name of annotation
filter_cfg=dict(filter_empty_gt=True, min_size=32), # filtering empty images
pipeline=None)
# Test set config
icdar2015_textdet_test = dict(
type='OCRDataset',
data_root=ic15_det_data_root,
ann_file='instances_test.json',
data_prefix=dict(img_path='imgs/'),
data_root=icdar2015_textdet_data_root,
ann_file='textdet_test.json',
test_mode=True,
pipeline=None)
```

View File

@ -36,7 +36,7 @@ Based on the above example, we can see that the configuration of `Visualizer` co
MMOCR uses the local visualization backend [`LocalVisBackend`](mmengine.visualization.LocalVisBackend) by default, and the model loss, learning rate, model evaluation accuracy and visualization The information stored in `VisualizerHook` and `LoggerHook`, including loss, learning rate, evaluation accuracy will be saved to the `{work_dir}/{config_name}/{time}/{vis_data}` folder by default. In addition, MMOCR also supports other common visualization backends, such as `TensorboardVisBackend` and `WandbVisBackend`, and you only need to change the `vis_backends` type in the configuration file to the corresponding visualization backend. For example, you can store data to `TensorBoard` and `Wandb` by simply inserting the following code block into the configuration file.
```Python
_base_.Visualizer.vis_backends = [
_base_.visualizer.vis_backends = [
dict(type='LocalVisBackend'),
dict(type='TensorboardVisBackend'),
dict(type='WandbVisBackend'),]

View File

@ -84,25 +84,23 @@ data/icdar2015
### 单数据集训练
在使用新的数据集时,我们需要对其图像、标注文件的路径等基础信息进行配置。`configs/xxx/_base_/datasets/` 路径下已预先配置了 MMOCR 中常用的数据集(当你使用 `prepare_dataset.py` 来准备数据集时,这个配置文件通常会在数据集准备就绪后自动生成),这里我们以 ICDAR 2015 数据集为例(见 `configs/_base_/det_datasets/icdar2015.py`
在使用新的数据集时,我们需要对其图像、标注文件的路径等基础信息进行配置。`configs/xxx/_base_/datasets/` 路径下已预先配置了 MMOCR 中常用的数据集(当你使用 `prepare_dataset.py` 来准备数据集时,这个配置文件通常会在数据集准备就绪后自动生成),这里我们以 ICDAR 2015 数据集为例(见 `configs/textdet/_base_/datasets/icdar2015.py`
```Python
ic15_det_data_root = 'data/icdar2015' # 数据集根目录
icdar2015_textdet_data_root = 'data/icdar2015' # 数据集根目录
# 训练集配置
icdar2015_textdet_train = dict(
type='OCRDataset',
data_root=ic15_det_data_root, # 数据根目录
ann_file='instances_training.json', # 标注文件名称
data_prefix=dict(img_path='imgs/'), # 图片路径前缀
data_root=icdar2015_textdet_data_root, # 数据根目录
ann_file='textdet_train.json', # 标注文件名称
filter_cfg=dict(filter_empty_gt=True, min_size=32), # 数据过滤
pipeline=None)
# 测试集配置
icdar2015_textdet_test = dict(
type='OCRDataset',
data_root=ic15_det_data_root,
ann_file='instances_test.json',
data_prefix=dict(img_path='imgs/'),
data_root=icdar2015_textdet_data_root,
ann_file='textdet_test.json',
test_mode=True,
pipeline=None)
```

View File

@ -36,7 +36,7 @@ visualizer = dict(
MMOCR 默认使用本地可视化后端 [`LocalVisBackend`](mmengine.visualization.LocalVisBackend)`VisualizerHook``LoggerHook` 中存储的模型损失、学习率、模型评估精度以及可视化结果等信息将被默认保存至`{work_dir}/{config_name}/{time}/{vis_data}` 文件夹。此外MMOCR 也支持其它常用的可视化后端,如 `TensorboardVisBackend` 以及 `WandbVisBackend`用户只需要将配置文件中的 `vis_backends` 类型修改为对应的可视化后端即可。例如,用户只需要在配置文件中插入以下代码块,即可将数据存储至 `TensorBoard` 以及 `WandB`中。
```Python
_base_.Visualizer.vis_backends = [
_base_.visualizer.vis_backends = [
dict(type='LocalVisBackend'),
dict(type='TensorboardVisBackend'),
dict(type='WandbVisBackend'),]