From c053556abee4bca24c0c9b65ef592d1a8b5fafb1 Mon Sep 17 00:00:00 2001 From: Tau-J <674106399@qq.com> Date: Thu, 13 Apr 2023 12:05:59 +0800 Subject: [PATCH] update docs --- docs/en/how_to.md | 9 --------- docs/en/user_guides/configs.md | 11 ++++++++++- docs/zh_cn/how_to.md | 9 --------- docs/zh_cn/user_guides/configs.md | 9 +++++++++ 4 files changed, 19 insertions(+), 19 deletions(-) delete mode 100644 docs/en/how_to.md delete mode 100644 docs/zh_cn/how_to.md diff --git a/docs/en/how_to.md b/docs/en/how_to.md deleted file mode 100644 index a880209806..0000000000 --- a/docs/en/how_to.md +++ /dev/null @@ -1,9 +0,0 @@ -# How to - -## Print Entire Config - -Officially provided config files inherit multiple config files, which can facilitate management and reduce redundant code. But sometimes we want to know what the default parameter values that are not explicitly written in the configuration file are. MMPose provides `tools/analysis_tools/print_config.py` to print the entire configuration information verbatim. - -```shell -python tools/analysis_tools/print_config.py ${CONFIG} [-h] [--options ${OPTIONS [OPTIONS...]}] -``` diff --git a/docs/en/user_guides/configs.md b/docs/en/user_guides/configs.md index 6b2e72fbec..9d2c44f7ff 100644 --- a/docs/en/user_guides/configs.md +++ b/docs/en/user_guides/configs.md @@ -36,6 +36,15 @@ Class Loss_A(nn.Module): return x ``` +And import the new module in `__init__.py` in the corresponding directory: + +```Python +# __init__.py of mmpose/models/losses +from .loss_a.py import Loss_A + +__all__ = ['Loss_A'] +``` + Then you can define the module anywhere you want: ```Python @@ -102,7 +111,7 @@ General configuration refers to the necessary configuration non-related to train Here is the description of General configuration: ```Python -# 通用配置 +# General default_scope = 'mmpose' default_hooks = dict( timer=dict(type='IterTimerHook'), # time the data processing and model inference diff --git a/docs/zh_cn/how_to.md b/docs/zh_cn/how_to.md deleted file mode 100644 index 8e0b90ae02..0000000000 --- a/docs/zh_cn/how_to.md +++ /dev/null @@ -1,9 +0,0 @@ -# How to - -## 打印全部配置信息 - -官方提供的配置文件,有时候继承了多个配置文件,这样做可以方便管理,减少冗余代码。但有时候我们希望知道配置文件中没有写明的默认参数值是什么,MMPose 提供了 `tools/analysis_tools/print_config.py` 来逐字逐句打印全部的配置信息。 - -```shell -python tools/analysis_tools/print_config.py ${CONFIG} [-h] [--options ${OPTIONS [OPTIONS...]}] -``` diff --git a/docs/zh_cn/user_guides/configs.md b/docs/zh_cn/user_guides/configs.md index b7c0c4cdb6..0bcb7aa1a8 100644 --- a/docs/zh_cn/user_guides/configs.md +++ b/docs/zh_cn/user_guides/configs.md @@ -36,6 +36,15 @@ Class Loss_A(nn.Module): return x ``` +并在对应目录下的 `__init__.py` 中进行 `import`: + +```Python +# __init__.py of mmpose/models/losses +from .loss_a.py import Loss_A + +__all__ = ['Loss_A'] +``` + 我们就可以通过如下方式来从配置文件定义并进行实例化: ```Python