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] refine docs #1925

Merged
merged 1 commit into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions docs/en/user_guides/configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ loss_cfg = dict(
loss = MODELS.build(loss_cfg) # equals to `loss = Loss_A(param1=1.0, param2=True)`
```

```{note}
Note that all new modules need to be registered using `Registry` and imported in `__init__.py` in the corresponding directory before we can create their instances from configs.
```

Here is a list of pre-defined registries in MMPose:

- `DATASETS`: data-related modules
Expand Down
9 changes: 9 additions & 0 deletions docs/zh_cn/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,15 @@ init_cfg=dict(
checkpoint='PATH/TO/YOUR_MODEL_WEIGHTS.pth'),
```

如果你想只加载一个训练好的 checkpoint 的 backbone 部分,你需要指明一下前缀 `prefix`:

```Python
init_cfg=dict(
type='Pretrained',
prefix='backbone.',
checkpoint='PATH/TO/YOUR_CHECKPOINT.pth'),
```

其中 `checkpoint` 既可以是本地路径,也可以是下载链接。因此,如果你想使用 Torchvision 提供的预训练模型(比如ResNet50),可以使用:

```Python
Expand Down
4 changes: 4 additions & 0 deletions docs/zh_cn/user_guides/configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ MMPose 预定义的 Registry 在 `$MMPOSE/mmpose/registry.py` 中,目前支持

- `HOOKS`:钩子类

```{note}
需要注意的是,所有新增的模块都需要使用注册器(Registry)进行注册,并在对应目录的 `__init__.py` 中进行 `import`,以便能够使用配置文件构建其实例。
```

## 配置系统

具体而言,一个配置文件主要包含如下五个部分:
Expand Down