Skip to content

Commit

Permalink
refine docs (#1925)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tau-J authored Jan 11, 2023
1 parent cec0a04 commit a30556a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
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

0 comments on commit a30556a

Please sign in to comment.